After scratching my head for a bit, I thought it looked like a timer I had set up ages ago to turn my sonās bedroom light off in the night once he was asleep (something Iām hoping openHAB will make easier and more transparent for me now!).
But looking at those times, theyāre pretty weird (thatās around the time he gets up - heās 3!) and it sends two āoffsā and then an āonā, which isnāt how I would ever have set it up in the first place. Theyāre roughly around the time of the start of ācivil twilightā but that could be a coincidence.
So even though I did a hard reset on the WiFi Link, it looks like it might be doing something funky with an old setup. Or more likely, the Lightwave RF cloud server is attempting to send a command to my WiFi Link, but the device is rejecting it because itās been deregistered.
Interestingā¦the messages there are different to the ones that I handle (which is why the error comes up)ā¦
**030Fxx,**361,!R7D1F0|mainlight|Off
The bit in bold isnāt supported and as far as I know isnāt in the API unless theyāve changed it.
These commands you see must have been sent by either the iOS/Andriod App or some thing other than openhab on your network. Could anything else be sending updates?
I know the issue with the Dusk/Dawn time and will fix as soon as I can. I just need to multiply the number by 1000 for Java.
030Fxx = Last few characters of the MAC address of WiFi Link (Iām going to obfuscate that in the original post, can you too @neil_renaud, slight security risk!)
361 = command number, maybe 3xx numbers come from the cloud?
!R7D1F0|mainlight|Off = device mapping & action
So yeah I think itās coming from the cloud server, based on a timer I set up ages ago, and completely forgot about (it would have been in v1 of their iOS app - theyāre now on v3!)
Also added an extra bit of info to the debug logging that will say which IP a message came from. @tinkerfailure if you enable debug logging you should then be able to see where those commands came from. It will look like this:
Message received from: āreceivePacket.getAddress()ā message: āreceivedMessageā
Iāve still got it how you had it "Wifi Link Uptime [%.2f]". Itās just a number isnāt it, not a Datetime? Have you managed to change it?
Turns out I was getting connection requests from an IP on my network. Checked on the router and itās my iPhoneā¦
Opened up the old Lightwave iOS app (where Iād created the timers) and tried to delete them using the app. It gave me a load of errors, so I tried sending the string via the shell on the Pi and it seemed to accept the command:
Interesting as when I open the official LightwaveRF app on an iOS device I get these version messages and the version item I have configured is updated correctly, the version message is coming from the new Wifi Link and the other message from the iOS device :-
UPDATE: just did some more testing and when the LightwaveRF app is in the foreground I am getting version messages over and over, not a problem just an observation.
I believe the app does that to detect if it is on your local network or remote. As youāve seen it just constantly sends a registration message to which the hub replies with the Version message that doesnāt include all the other data.
I didnāt change the uptime - Are you fairly sure it is the date the router started as opposed to a number of seconds, minutes etc that it has been up? What happens if you power on/off your router do you get a number close to 0 or something that is obviously the date you restarted it? One check you can do is take the number you get. Times it be 1000 (Add 3 "0"s on the end). Then enter it into the left box on this site to see what date it would represent: http://www.fileformat.info/tip/java/date2millis.htm
In my mind uptime is a number of seconds/minutes/hours and not a date however if it is a real date Iāll change it.
Also Iāve not implemented Timers. These are pushed to the wifi link I believe so that it actually runs the timer at a given time. I didnāt see an easy/nice way to fit that into Openhabā¦
Yeah thatās true, it probably is a count of seconds since it last rebooted. Or milliseconds! I just need to reformat it into something more readable likexx days, xx hours and xx minutes or something like that. Iāll write a simple rule.
As far as Iām concerned the timers on the WiFi Link become obsolete once openHAB is involved. As I found, there was an ancient one Iād set up, forgotten about, and had no way of seeing it was there! Iād much rather have something I can control more explicitly like rules in openHAB.
Canāt remember the setup. I guess it must have asked something.
Maybe it does a reverse whois on the IP address the WiFi Link appears from or something. I think mine looks pretty accurate for where we are.
I have entered accurate ones for the astro binding anyway, so Iāll be using that for sunset/sunrise type stuff.
I checked the logs again this morning, and didnāt see those weird timer messages, so hopefully theyāre deleted now. I switched a few lights on and off from the iOS interface and it paused a bit and then caused the RF jam alarm to go off on my DSC alarm! Never had that before. Hope thatās just a one off.
Oh yeah, just found my location in the new iOS app. Donāt ever remember setting it though. I think it must have done a reverse whois on my IP. Thatās the most logical way to do it, as far as I can see.
Iāve been looking into the uptime thing. I thought there would be a simple inbuilt function to convert seconds to days/hours/minutes. But I canāt seem to find anything.
The reason I expected it was because you can do just that in PHP. You can use the gmdate() function:
> echo gmdate("H:i:s", 685);
Where 685 is the number of seconds. Giving the result:
If it was set to Birmingham I suspect that default it to their office location
This might help converting the time - as openhab uses Joda I believe you can use it in the rules but Iāve no experience iām sure wiki/forum might have some examples: