LightwaveRF + OpenHab2

I too am just starting to use LW with OH2. You are not alone :slight_smile:

Iā€™m using it daily but I currently do it via the rfxcom binding rather than the openhab one (which I wrote). At some point Iā€™ll try to port it but I donā€™t even use openhab2 yet so it isnā€™t high on my todo list.

Iā€™m using Neilā€™s LightwaveRF binding with OH2. It works fine for dimmers and sockets but not for heating. The error message says it canā€™t decode the LWRF message. I suspect this may be because the message no longer contains the "signal " parameter.

I would suggest commenting out the line in the code that tries to parse this part of the LWRF message.

Iā€™m happy to try this but I donā€™t immediately know how to create and edit bindings. If anyone else wants to give that a go, you may weā€™ll get to it before I have time.

Sorry to drag this thread back, but link no longer works. Anyone got the newest version of this binding?

works for me - Iā€™m on 2.2.0-snapshot build #1098
I have org.openhab.binding.lightwaverf-1.11.0-SNAPSHOT.jar in my conf/addons folder.
I have the default lightwave.cfg in my conf/services folder as copied below for reference

The exact steps to upgrade I took were to first upgrade the lightwaverf binding from 1.9 to 1.11, then some weeks later I upgraded opehnab from build 560 to 1098. I didnā€™t get any outage.

From going from lightwaverfbinding 1.9 to 1.11 I notice I occasionally get ā€œError transmit failedā€ on my lightwaverf hub if I switch items manually too quickly, so perhaps the default 2 second delay is insufficient.

What does your log:tail show when you save the new lightwaverf binding .jar into the services folder?

################################### LightwaveRf Binding #####################################
#
# The IP Address of the LightwaveRf Wifi Link you can use the broadcast address (required)
lightwaveRf:ip=255.255.255.255
# The port to monitor for messages you shouldn't need to change this
lightwaveRf:receiveport=9760
# The port to send messages on, it will also be monitored for incoming messages 
# you shouldn't need to change this
lightwaveRf:sendport=9761
# For a new computer you will need to register it with the wifi link to be allowed to send messages
# setting this to true we will send a registration message on startup. You will need to confirm
# registration on the wifi link. There is no harm leaving this as true but you can set to false
# once you have registerd for the first time.
lightwaverf:registeronstartup=true
# Delay between sending messages in ms to avoid swapming Wifi Link
lightwaverf:senddelay=2000
# Timeout for OK Messages in ms, we will retry messages we don't receive an ok for in the timeout
lightwaverf:okTimeout=1000

I have a brand new install of openhab2 running on a mac.
I canā€™t find the newest jar file and I donā€™t have a degree in GitHub.
I found an old copy of the jar file (1.10) nothing happened when I dropped the jar file in so I restarted openhab service. Then I get this:

13:27:26.665 [ERROR] [org.openhab.binding.lightwaverf     ] - FrameworkEvent ERROR - org.openhab.binding.lightwaverf
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.lightwaverf [184]
  Unresolved requirement: Import-Package: org.openhab.core.binding

	at org.eclipse.osgi.container.Module.start(Module.java:434)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]

Ok solved that by running

openhab-runtime-compat1x

in the karaf console. Cool just need to fight with it to get it paired :slight_smile:

I see - yes the last build of openhab1 addons on Cloudbees is blank. I donā€™t know how to retrieve a previous but I have the
1.11 .jar file on github:
https://github.com/beinnlora/openhab/blob/master/org.openhab.binding.lightwaverf-1.11.0-SNAPSHOT.jar
copy to your conf/addons folder ( ensure permissions are correct) and let us know what it says in the log again?

very good

I guess you mean addons :wink:
Finally got it to pair (what a nightmare)
Had to restart openhab2 again
Now I get this in log, however it doesnā€™t seem to be listening, donā€™t see anything when I switch lights etc like usual:

13:58:26.094 [INFO ] [erf.internal.LightwaveRFSenderThread] - Ok message received for 100,!F*p

13:58:26.095 [WARN ] [htwaverf.internal.LightwaveRfBinding] - No item for incoming message[100,?V="N2.94D"
]

eek, well spotted, thanks corrected original post.

The binding doesnā€™t handle every message the Lightwave hub spits out - for example See my log below when I change a Switch item.

When you first install the binding, you have to authorise Openhab as a valid user of your lightwaverf hub - youā€™ll see a message on the the hub and you have to press a button.Did you do this - perhaps force a re-pair via instructions in https://github.com/openhab/openhab1-addons/tree/master/bundles/binding/org.openhab.binding.lightwaverf

14:03:26.367 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'LWRF_OfficeLight' received command ON
14:03:26.371 [INFO ] [smarthome.event.ItemStateChangedEvent] - LWRF_OfficeLight changed from OFF to ON
14:03:26.481 [ERROR] [htwaverf.internal.LightwaveRfWifiLink] - Error converting message: *!{"trans":287,"mac":"xx:xx:xx","time":1512050606,"pkt":"433T","fn":"on","room":7,"dev":1}
14:03:26.514 [ERROR] [htwaverf.internal.LightwaveRfWifiLink] - Error converting message: *!{"trans":287,"mac":"xx:xx:xx","time":1512050606,"pkt":"433T","fn":"on","room":7,"dev":1}
14:03:26.578 [INFO ] [verf.internal.LightwaveRFSenderThread] - Ok message received for 257,!R7D1F1

Yep, did that, thats why I get ā€œOk message received for 100,!F*pā€
I had all this set up no problem on a raspberry pi previously (but it died).
For sure I used to get logs when I switched items from the iPhone app. Now I see nothing. Maybe the binding 1.11 broke it? Iā€™ll try rolling back to 1.10.
edit nope still no luckā€¦
edit2 Hmm I added some stuff to .items file, and edited sitemap and it works! Perhaps I just imagined that I used to see commands in the logā€¦

1 Like

Iā€™ve done everything above. I get the ā€œOK message received for 100,!F*pā€ but then later in the logs I get:

2017-12-18 20:30:02.767 [ERROR] [erf.internal.LightwaveRFSenderThread] - Error waiting on queue

LightwaveRf binding isnā€™t shown in Bindings.

Full log details:

[twaverf.internal.LightwaveRfWifiLink] - Starting LightwaveRfWifiLink Connection
2017-12-18 20:29:09.993 [WARN ] [htwaverf.internal.LightwaveRfBinding] - No item for incoming message[100,?V="N2.94D"
]
2017-12-18 20:29:10.012 [INFO ] [erf.internal.LightwaveRFSenderThread] - Ok message received for 100,!F*p
2017-12-18 20:29:52.564 [INFO ] [basic.internal.servlet.WebAppServlet] - Stopped Basic UI
2017-12-18 20:30:02.764 [INFO ] [twaverf.internal.LightwaveRfWifiLink] - Stopping LightwaveRfWifiLink Connection
2017-12-18 20:30:02.764 [INFO ] [erf.internal.LightwaveRFSenderThread] - Message not added to queue as we are shutting down Message[{}]
2017-12-18 20:30:02.765 [INFO ] [twaverf.internal.LightwaveRfWifiLink] - LightwaveRfWifiLink Connection Stopped
2017-12-18 20:30:02.767 [ERROR] [erf.internal.LightwaveRFSenderThread] - Error waiting on queue
java.lang.InterruptedException
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2014)[:1.8.0_152]
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2048)[:1.8.0_152]
	at java.util.concurrent.LinkedBlockingDeque.takeFirst(LinkedBlockingDeque.java:492)[:1.8.0_152]
	at java.util.concurrent.LinkedBlockingDeque.take(LinkedBlockingDeque.java:680)[:1.8.0_152]
	at org.openhab.binding.lightwaverf.internal.LightwaveRFSenderThread.run(LightwaveRFSenderThread.java:111)[182:org.openhab.binding.lightwaverf:1.11.0.201711160210]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_152]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[:1.8.0_152]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[:1.8.0_152]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[:1.8.0_152]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[:1.8.0_152]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)[:1.8.0_152]
	at java.lang.Thread.run(Thread.java:748)[:1.8.0_152]

Any clues?

Uh, itā€™s possible Iā€™m being really dumb here.

Just realised that thereā€™s a 42s delay between the log entry for receiving the OK message from the Lightwave Link, and a message saying ā€œStopped Basic UIā€, which might well be me exiting because I couldnā€™t see anything!

Given that the Lightwave binding is an OpenHab1 binding, should I expect to see the Binding listed at all in the UI?

OK, all sorted ā€¦ as an OpenHAB newbie, I was mistakenly expecting to see the Lightwave binding listed in the Paper UI.

Iā€™ve now got a sitemap and a .items file configured, and LightWave is working just fine.

I have the binding working fine (and have done since v1) - but has anyone coded something neater on status logging?

Would love to get rid of these:

2018-01-17 20:51:46.601 [ERROR] [twaverf.internal.LightwaveRfWifiLink] - Error converting message: *!{"trans":14271,"mac":"03:3E:6E","time":1516222305,"pkt":"433T","fn":"dim","param":8,"room":2,"dev":2}

yes i have variations of these

2018-01-28 17:51:20.073 [ERROR] [twaverf.internal.LightwaveRfWifiLink] - Error converting message: *!{ā€œtransā€:512,ā€œmacā€:ā€œ20:53:59ā€,ā€œtimeā€:1517161879,ā€œpktā€:ā€œ868Rā€,ā€œfnā€:ā€œstatusPushā€,ā€œprodā€:ā€œvalveā€,ā€œserialā€:ā€œ365702ā€,ā€œtypeā€:ā€œtempā€,ā€œbattā€:3.12,ā€œverā€:56,ā€œstateā€:ā€œboostā€,ā€œcTempā€:24.2,ā€œcTargā€:26.0,ā€œoutputā€:100,ā€œnTargā€:20.0,ā€œnSlotā€:ā€œ18:15ā€,ā€œprofā€:7}

I have the most recent openHAB LightwaveRf Binding (28-Jan-2018 03:09:52) 1.12.0 SNAPSHOT

some more example working items/sitemaps for lightwaverf hardware would be appreciated

I think the problem might be that the binding expects to find a field called ā€œsignalā€, which has now been removed from the message by Lightwave in a recent (ish) firmware release.

I have tried to edit the source code but I canā€™t work out how to submit the edited version for build.

also i dont understand the building of the system to make slight alterations for testing, the code looks understandable

Hi Dave, Iā€™m brand new to openHab but noticed your post from last year we Lightwaverf. I have several V1 LWrf devices (sockets, relays etc) and would like to get them integrated. But it looks like the LWrf bi ding is defunct as it doesnā€™t show up in the bindings on paperui. I see youā€™ve achieved a working system so would you be able to share how? Iā€™m running openHab on a Pi 2. Any help would be gratefully received !!

Mark