UK time on Maxcube

Begonnen von homer, 29 März 2013, 20:11:22

Vorheriges Thema - Nächstes Thema

homer

Hi All,

My maxcube seems to be fixed to CET time. I have issued "set ml clock" in my fhem.cfg file but I still get the following msg:

Opening ml device 192.168.0.44:62910
2013.03.29 19:09:30 3: ml device opened
2013.03.29 19:09:30 2: MAXLAN_Parse: Cube thinks it is 29.3.2013 20:9
2013.03.29 19:09:30 2: MAXLAN_Parse: Time difference is 60 minutes

Can anyone help?

Thanks
Homer

Matthias Gehre

The relevant section in the code is in FHEM/00_MAXLAN.pm line 220:
    #The offset was obtained by experiment and is up to 1 minute, I don't know exactly what
    #time format the cube uses. Something based on ntp I guess. Maybe this only works in GMT+1?
    my $time = time()-946684774;
You may try to add/substract 3600 from the magic number 946684774.

Please report your findings!

homer

Hi Matthias,

Thank you for your reply. I tried the following (as a test):

my $time = time()-946684774-1800;

and this was displayed in the log:

2013.03.30 19:40:12 3: Opening ml device 192.168.0.44:62910
2013.03.30 19:40:12 3: ml device opened
2013.03.30 19:40:12 2: MAXLAN_Parse: Cube thinks it is 30.3.2013 20:40
2013.03.30 19:40:12 2: MAXLAN_Parse: Time difference is 60 minutes

I don't always get this time error message - which seems strange, and I don't understand why. It seems like the adjustment isn't working. What I do is stop FHEM running, make the adjustment to 00_MAXLAN.pm and restart FHEM. I assume this should be sufficient? Do you know of a way to check the cube time when FHEM is still running? i.e. from the command line, so that I don't have to wait for the MAXLAN_Parse warning?

Thanks
Homer


Matthias Gehre

Restarting FHEM is necessary to make the changes to any pm file effective.

The line you changed affects only setting the time on the cube,
not reading/parsing it.
So after restarting FHEM, you'll have to issue
  set ml clock

I guess the reading/parsing is okey, because the cube sends us hours/minutes/seconds separated. (As shown in the line
"MAXLAN_Parse: Cube thinks it is ..."). I suspect setting is time is broken, which would be fixed by changing that mentioned line.