LightwaveRF Binding Updated

I’m still getting intermittent problems with the connection to the WiFi Link. It was fine last night. Would send commands with no problems. Yet now I’m getting a load of errors complaining about openHAB not receiving an ‘OK’.

I’ve changed nothing on either box since last night!

2015-12-17 13:25:04.256 [DEBUG] [.b.l.i.LightwaveRFSenderThread] - Sending command[306,!R7D1F0
]
2015-12-17 13:25:04.758 [INFO ] [.b.l.i.LightwaveRFSenderThread] - Ok message not received for 306,!R7D1F0
, retrying again. Retry count 4
2015-12-17 13:25:06.760 [DEBUG] [.b.l.i.LightwaveRFSenderThread] - Sending command[306,!R7D1F0
]
2015-12-17 13:25:07.265 [INFO ] [.b.l.i.LightwaveRFSenderThread] - Ok message not received for 306,!R7D1F0
, retrying again. Retry count 5
2015-12-17 13:25:09.267 [DEBUG] [.b.l.i.LightwaveRFSenderThread] - Sending command[306,!R7D1F0
]
2015-12-17 13:25:09.769 [ERROR] [.b.l.i.LightwaveRFSenderThread] - Unable to send message 306,!R7D1F0
 after 5 attemps giving up

I think it must be the WiFi Link being flakey. It’s quite a serious problem, as it sets off the RF Jam detection on my DSC alarm because it’s flooding the airwaves with RF!. Which would set the whole alarm off if I wasn’t in.

EDIT: Actually, I don’t think it is the WiFi Link. I restarted openHAB and voila, it works again…

2015-12-17 13:31:28.236 [DEBUG] [.b.l.i.LightwaveRFSenderThread] - Sending command[211,!R7D1F0
]
2015-12-17 13:31:28.347 [DEBUG] [.l.i.LightwaveRFReceiverThread] - Message received from: /192.168.1.xx message:211,OK

2015-12-17 13:31:28.352 [INFO ] [.b.l.i.LightwaveRFSenderThread] - Ok message received for 211,!R7D1F0

Yeah there was a bug I’ve just fixed here:

Essentially overnight there is a message that I wasn’t parsing correctly and it caused the receiving thread to die. This release should fix it.

For ALL_OFF as we don’t have a push button in openhab you’ll need to bind it to a switch. Turning the switch on or off will send an ALL_OFF.

For Moods you need a Number item and then you set it to the number of the mood you want to send… so set it to 1 will call mood 1, 2 will call mood2 etc. I’m not sure how they are numbered but I suspect in the Lightwave App the first mood you entered is number 1 etc.

1 Like

Also

@SupraWez, @tinkerfailure, @morak

Can you comment on the pull request if you have tested and are happy this is working? Then I can get the changes merged properly into Openhab.

1 Like

Also if the resend logic causes issues with the alarm I’d suggest you might want to try setting the okTimeout higher in openhab.cfg. In reality I think the ok messages are quite quick so really this will just delay how quickly it retries.

Also I could make the number of retries configurable.

Both of these might stop the alarm going off if there is a genuine issue getting to the wifi link (e.g its fuse blew in the middle of the night)?

Neil

Yea I set the pause between messages to 500ms and the lenght of time to wait for an OK to 5000ms. Seems to work OK.
It did cross my mind to have the number of retries configurable. That could be quite handy.

Just so you know, I’ve just spotted an error on the tail of the log:

2015-12-19 00:19:47.183 [ERROR] [l.internal.LightwaveRfWifiLink] - Error converting message: *?{"trans":1338,"mac":"03:xx:xx","cmd":"get_duskdawn","lat":xx.xx,"long":xx.xx,"offset":0}
    2015-12-19 00:19:47.216 [ERROR] [l.internal.LightwaveRfWifiLink] - Error converting message: *!{"trans":1339,"source_id":"03:xx:xx","source":"wfl","type":"log","payload":"DAWN/DUSK SET"}

But I still have ‘normal’ connectivity with the WiFi Link, no errors about it being unregistred,

Yeah I will try to make the retries configurable.

That message is the one that caused the problem where it died (interesting I don’t get the second message that is the response). I will look to make it not error in the future but time is short at the moment.

I’ve just pushed out another version allowing you to configure some items to be in only or out only. I’m going to start to use this to allow me to send the messages using the RFXCOM binding but get updates if someone uses the app.

It is here:

Did Mood and ALL_OFF work for you?

Hey @neil_renaud

First off happy new year.

I have not been on here for a few days so have just upgraded from ALPHA5 straight to ALPHA9 and all looks good to me, my dimming is working etc, in fact it all seems a little more responsive than before.

Any actions taken in the official LightwaveRF app are also showing up in the OpenHAB GUI but not the other way round, I guess this is normal behavior.

Thanks

1 Like

Happy New Year.

Glad it is working well.

Yeah I’m not sure the Lightwave App will replicate any actions you do in openhab it isn’t well coded and I’m not sure they’d be expecting other systems to send commands.

That being said I’d personally ditch the lightwave app and only use openhab you could easily create a sitemap to replicate the lightwave app functionality.

Also I assume that if you send a dimming command in the lightwave app, close the app and open it again later it probably don’t load the same dimming level you set…after all the one problem with Lightwave is it is one way communication so there is no way for the app to know the current setting.

Neil

I am having problems getting a dimmer working. If I set up an item as a switch it works OK but when I set a dimmer up I cannot get it working and don’t see any commands being sent in the log file. Clearly I have set up the dimmer wrongly.

My item is:
Dimmer Lamp_Master_Bedroom "Master Bedroom Lamp Dimmer [%d %%]" (gFF_MasterBedroom) { lightwaverf="room=1,device=3,type=DIMMER" }

and the sitemap entry is:
Slider item=Lamp_Master_Bedroom

with a rule based on the dimmer rule in the open demo rule file.

Can anyone point me to a correct set of declarations to get this to work?

P.S. I have Moods working OK. They start numbering from 0 (zero).

On your sitemap can you try adding:

Group item=gFF_MasterBedroom

And when you go into it see if the Dimmer works there?

I’ve never set them up individually as you mention (although I’m sure there will be a way).

Hey @neil_renaud

Just a quick one, I have noticed since the upgrade that the LightWave Wifi Link stats are no longer updating.

The log shows error converting message :-

2016-01-19 11:32:43.419 [DEBUG] [.l.i.LightwaveRFReceiverThread:118 ]- Message received from: /1.1.1.1 message:*!{"trans":293,"mac":"00:00:00","time":1453203224,"type":"hub","prod":"lwl","fw":"N2.91Z","uptime":950631,"timeZ":0,"lat":00.00,"long":-00.00,"duskT":1453220997,"dawnT":1453190795,"tmrs":0,"evns":0,"run":0,"macs":9,"ip":"1.1.1.1","devs":0}
2016-01-19 11:32:43.420 [ERROR] [l.internal.LightwaveRfWifiLink:173 ]- Error converting message: *!{"trans":293,"mac":"00:00:00","time":1453203224,"type":"hub","prod":"lwl","fw":"N2.91Z","uptime":950631,"timeZ":0,"lat":00.00,"long":-00.00,"duskT":1453220997,"dawnT":1453190795,"tmrs":0,"evns":0,"run":0,"macs":9,"ip":"1.1.1.1","devs":0}

Hey @neil_renaud

Just seen the ALPHA10 release which I have now upgraded, thanks.

No problem.

Hey @neil_renaud

Looks like its still broken for me on ALPHA10.

Yeah me too. On alpha10 too.

C

Hi,

Can you post some sample logs that are causing an issue?

Thanks,
Neil

Here you go, a typical bunch of errors. I get a batch like this roughly once an hour it seems:

> 2016-01-20 17:09:17.863 [INFO ] [.l.internal.LightwaveRfBinding] - Update from LightwaveRf ItemName[LW_WifiL_Long], State[xx.xx]
> 2016-01-20 17:09:17.864 [INFO ] [.l.internal.LightwaveRfBinding] - Update from LightwaveRf ItemName[LW_WifiL_Dawn], State[2016-01-20T07:55:10]
> 2016-01-20 17:09:17.865 [INFO ] [.l.internal.LightwaveRfBinding] - Update from LightwaveRf ItemName[LW_WifiL_IP], State[192.168.1.xx]
> 2016-01-20 17:09:17.865 [INFO ] [.l.internal.LightwaveRfBinding] - State was null for LW_WifiL_Ver type VERSION, message org.openhab.binding.lightwaverf.internal.command.LightwaveRfWifiLinkStatusMessage@cee09
> 2016-01-20 17:09:17.866 [INFO ] [.l.internal.LightwaveRfBinding] - Update from LightwaveRf ItemName[LW_WifiL_Lat], State[xx.xx]
> 2016-01-20 17:09:17.866 [INFO ] [.l.internal.LightwaveRfBinding] - Update from LightwaveRf ItemName[LW_WifiL_Dusk], State[2016-01-20T16:29:39]
> 2016-01-20 17:09:17.867 [INFO ] [.l.internal.LightwaveRfBinding] - Update from LightwaveRf ItemName[LW_WifiL_Uptime], State[1062250]
> 2016-01-20 17:09:17.882 [INFO ] [.l.internal.LightwaveRfBinding] - Update from LightwaveRf ItemName[LW_WifiL_Long], State[xx.xx]
> 2016-01-20 17:09:17.884 [INFO ] [.l.internal.LightwaveRfBinding] - Update from LightwaveRf ItemName[LW_WifiL_Dawn], State[2016-01-20T07:55:10]
> 2016-01-20 17:09:17.885 [INFO ] [.l.internal.LightwaveRfBinding] - Update from LightwaveRf ItemName[LW_WifiL_IP], State[192.168.1.xx]
> 2016-01-20 17:09:17.886 [INFO ] [.l.internal.LightwaveRfBinding] - State was null for LW_WifiL_Ver type VERSION, message org.openhab.binding.lightwaverf.internal.command.LightwaveRfWifiLinkStatusMessage@3b19a7
> 2016-01-20 17:09:17.887 [INFO ] [.l.internal.LightwaveRfBinding] - Update from LightwaveRf ItemName[LW_WifiL_Lat], State[xx.xx]
> 2016-01-20 17:09:17.888 [INFO ] [.l.internal.LightwaveRfBinding] - Update from LightwaveRf ItemName[LW_WifiL_Dusk], State[2016-01-20T16:29:39]
> 2016-01-20 17:09:17.888 [INFO ] [.l.internal.LightwaveRfBinding] - Update from LightwaveRf ItemName[LW_WifiL_Uptime], State[1062250]

EDIT: Yeah you’re right, they’re not errors! Oops, sorry…

Hey,

That doesn’t look like any errors? What’s going wrong or not working as expected?

Neil

1 Like

Hey,

I’ve created a build with the energy monitor fix here: https://github.com/foxy82/openhab/releases/tag/1.8.0_alpha11

Neil

Hey @neil_renaud

I am testing Alpha11 build now, thanks.