LightwaveRF - New LightwaveRF Binding

I have just uploaded a new version to Git.
Its a major change on how the polling is carried out.

@BenDWire should fix your issue.

You can set the brightness either by going to the outer edge on Colorpicker or reducing the brightness using HSB sliders. (lightwave restrictions here so temperature on colourpicker doesnt do anything)

This is now fixed

New Binding Version Available - Version 1.1.1

Various bug Fixes.

Account Parameter: electricityCost
set this to a whole number (pence) in order to use the new channels:
energyCost
powerCost

Channel energyReset
use this to reset the current energy usage, IE in rules to reset every month after logging a historical value

Channel voltageReset (Use with caution)
Occasionally the lightwave value is messed up and the only way to reset is to remove and readd the device in the app. This allows you to reset this value.
To use:
Turn the socket off
Flick the reset switch on then off
Power cycle the device using the reset channel switch.
The voltage should now be reset.

UPDATE
Version 1.1.2 added
Fixed update bug for linkplus

I had a go with 1.1.1 and the logs showed the account connected but never got anything back:

2020-02-21 16:11:30.399 [DEBUG] [rf.internal.handler.LWAccountHandler] - Checking Lightwave connection
2020-02-21 16:11:30.401 [DEBUG] [rf.internal.handler.LWAccountHandler] - Connection to Lightwave in tact
2020-02-21 16:11:34.302 [DEBUG] [rf.internal.handler.LWAccountHandler] - Initiate Polling
2020-02-21 16:11:34.304 [WARN ] [rf.internal.handler.LWAccountHandler] - Channel List For Updating Is Empty, rescheduling
2020-02-21 16:11:35.771 [DEBUG] [rf.internal.handler.LWAccountHandler] - Initiate Polling
2020-02-21 16:11:35.774 [WARN ] [rf.internal.handler.LWAccountHandler] - Channel List For Updating Is Empty, rescheduling

Then I tried 1.1.2 and the account is stuck on Initializing, and is throwing many more errors:

2020-02-21 17:12:59.741 [DEBUG] [rf.internal.handler.LWAccountHandler] - Initializing Lightwave account handler.
2020-02-21 17:12:59.755 [WARN ] [.lightwaverf.internal.UpdateListener] - Start Lightwave Login Process
2020-02-21 17:12:59.758 [WARN ] [.lightwaverf.internal.UpdateListener] - Get new token
2020-02-21 17:12:59.707 [hingStatusInfoChangedEvent] - 'lightwaverf:lightwaverfaccount:9243d05c' changed from UNINITIALIZED to INITIALIZING
2020-02-21 17:13:00.686 [DEBUG] [.lightwaverf.internal.UpdateListener] - token: <redacted>
2020-02-21 17:13:00.689 [WARN ] [.lightwaverf.internal.UpdateListener] - Connected to lightwave
2020-02-21 17:13:06.862 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 
java.lang.NullPointerException: null
	at org.openhab.binding.lightwaverf.internal.handler.LWAccountHandler.getDevices(LWAccountHandler.java:152) ~[?:?]
	at org.openhab.binding.lightwaverf.internal.handler.LWAccountHandler.initialConnect(LWAccountHandler.java:114) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_222]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_222]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[?:1.8.0_222]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[?:1.8.0_222]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_222]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_222]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]
2020-02-21 17:14:00.698 [DEBUG] [rf.internal.handler.LWAccountHandler] - Start periodic connection check
2020-02-21 17:14:00.706 [DEBUG] [rf.internal.handler.LWAccountHandler] - Checking Lightwave connection
2020-02-21 17:14:00.712 [DEBUG] [rf.internal.handler.LWAccountHandler] - Connection to Lightwave in tact

I hope that helps …

While I’m writing, can I add the Gen1 hub as a Thing? Is it a h21 device? (I tried on 1.1.1 but didn’t seem to get me anywhere!)

Ben

@BenDWire try this…
removed
i havnt integrated the gen 1 hub yet as didnt have the data. run discovery, add the hub (will be unknown device). then go to the thing and check the properties, it will list all the channels it supports. if you send me this i can add it to the binding

I’m trying to update this - I have removed it all and added the jar file to my addons folder but openhabs not picking it up at all???

After updating to 1.1.3 it took 2 reboots before the account went online, but I’m stumbling at the “Run Discovery” step. As the logs show below, I think OpenHAB is tryng to discover in the background and failing. I then ran “smarthome:discovery start lightwaverf” in the console which threw the error on the last line.

Noob question - Am I doing the “Run DIscovery” correctly? I tried appending .discovery to the command, and also using “LightwaveRF” in case it’s case sensitive, but got nowhere.

If you can give me a few pointers as to what I’m doing wrong I’ll try again.

Thanks again for trying to get this working!

2020-02-22 01:35:43.984 [DEBUG] [rf.internal.handler.LWAccountHandler] - Initiate Polling
2020-02-22 01:35:43.986 [WARN ] [rf.internal.handler.LWAccountHandler] - Channel List For Updating Is Empty, rescheduling
2020-02-22 01:35:52.865 [DEBUG] [rf.internal.handler.LWAccountHandler] - Checking Lightwave connection
2020-02-22 01:35:52.867 [DEBUG] [rf.internal.handler.LWAccountHandler] - Connection to Lightwave in tact
2020-02-22 01:35:53.988 [DEBUG] [rf.internal.handler.LWAccountHandler] - Initiate Polling
2020-02-22 01:35:53.991 [WARN ] [rf.internal.handler.LWAccountHandler] - Channel List For Updating Is Empty, rescheduling
2020-02-22 01:35:58.957 [WARN ] [nternal.DiscoveryServiceRegistryImpl] - No discovery service for binding id 'lightwaverf' found!

@BenDWire apologies, seems there is a build problem in vscode that caused me to break discovery.
fixed here:

org.openhab.binding.lightwaverf-2.5.2-SNAPSHOT_1.1.4.jar.txt (60.0 KB)

It may be a cache issue you having to restart where the binding has had major change.

@Greigc try clearing the cache and restarting

I have deleted everything to do with lightwave, added the jar file to the addons folder. the binding never appears under bindings? removed cache and tmp folders and restarted.

@Greigc When you say under bindings you mean here:

And you got the latest version from git or couple of posts above? And if above you removed .txt extension yes…

This is what i have and your latest snapshot is in the “addons” folder as “org.openhab.binding.lightwaverf-2.5.2-SNAPSHOT_1.1.4.jar”

@Greigc turn on debug logging, remove and re-add and check the logs. Should show up.

And your putting here:
usr/share/openhab2/addons

With 1.1.4 discovery is now working, but it still doesn’t find any channels:

2020-02-22 10:25:02.298 [DEBUG] [htwaverf.internal.LWDiscoveryService] - Start Discovery
2020-02-22 10:25:10.013 [DEBUG] [rf.internal.handler.LWAccountHandler] - Initiate Polling
2020-02-22 10:25:10.016 [WARN ] [rf.internal.handler.LWAccountHandler] - Channel List For Updating Is Empty, rescheduling
2020-02-22 10:25:19.552 [DEBUG] [rf.internal.handler.LWAccountHandler] - Checking Lightwave connection
2020-02-22 10:25:19.554 [DEBUG] [rf.internal.handler.LWAccountHandler] - Connection to Lightwave in tact
2020-02-22 10:25:20.018 [DEBUG] [rf.internal.handler.LWAccountHandler] - Initiate Polling
2020-02-22 10:25:20.020 [WARN ] [rf.internal.handler.LWAccountHandler] - Channel List For Updating Is Empty, rescheduling

My OH2 is running on a Pi which is sitting next to the Hub, both connected via a switch. I can use netcat to send a string to the hub which then responds as expected. I use its IP address rather than a name - does your binding need anything specific?
That said, I can use the WebApp (https://manager.lightwaverf.com/) to turn devices on and off, so I can’t think I’ve done anything obviously wrong.
Ben

It won’t find any channels as it’s not integrated, that’s why I need the properties from the thing to integrate it. If you send me this over I’ll add it in tonight.

Available Channels:

got this in the logs:

2020-02-22 14:41:07.852 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/openhab/addons/org.openhab.binding.lightwaverf-2.5.2-SNAPSHOT_1.1.4.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.lightwaverf [218]
Unresolved requirement: Import-Package: com.google.gson.annotations; version="[2.8.0,3.0.0)"
-> Export-Package: com.google.gson.annotations; bundle-symbolic-name=“com.google.gson”; bundle-version=“2.8.6”; version=“2.8.6”
com.google.gson [219]
Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=9.0))"
Unresolved requirement: Import-Package: com.google.gson; version="[2.8.0,3.0.0)"
-> Export-Package: com.google.gson; bundle-symbolic-name=“com.google.gson”; bundle-version=“2.8.6”; version=“2.8.6”; uses:=“com.google.gson.reflect,com.google.gson.stream”

I have gotten it to this:
Error executing command: Error executing command on bundles:
Error starting bundle 226: Could not resolve module: org.openhab.binding.lightwaverf [226]
Unresolved requirement: Import-Package: com.google.gson.annotations; version="[2.8.0,3.0.0)"

Now im truly stuck as i cannot find the jar for annotations anywhere.

Please bear in mind that I’m very new to OpenHAB, so I don’t fully understand the terminology here! I think I’m in a catch 22 situation, as although I have added the LightwaveRF account, it doesn’t discover any ‘Things’. I can add a hub (devicetype 21) but of course the properties just list the h21 properties - not what we want.
How can I add a Thing that isn’t supported by the binding (i.e. the Gen1 Hub)?
I’m afraid I need a bit of hand-holding at this point as I’m going round in circles! If there are commands to type in the console please let me know and I’ll get the results back this evening.

Ok the binding is added after adding some dependencies.

I can add my heating, hub and energy but when i come to add my lights (gen 1) they are listed as “Unknown Device” and when i try and add them i get “error 409 - conflict” in the right hand corner popping up and they don’t add?

Did you edit “Configuration>Things>Edit>Lightwaverf Account” and add your account details (username and password) to it so it can discover your devices?

Thanks Greig. Yes my account details are in OK, and the logs say that the “connection to Lightwave is in tact” (sic) so I assume all is well. It’s showing as online, but doesn’t find anything during discovery.

[ In a twist of fate I bought 4 wi-fi sockets today and have flashed them with Tasmota, so there may well be a Gen1 hub and a few plug-in sockets on eBay in the near future! ]

Do you have config files in addition to using Paper UI? I see that error when my .things file conflicts with the values entered in the UI. I usually delete the config file and rewrite it once everything is working.