LightwaveRF - New LightwaveRF Binding

What parameters do we use to change this in the things file?

Done as @delid4ve recommended. Shut down, cleared the user and cache by manually deleting them then rebooted. Pretty much the same, only the Energy Monitor is polling consistently. Gathered some more info:

Things:
Definitely only have each thing listed once under Things in Paper UI. Here’s a list (copied out of Paper UI)

Bedroom Light Generation 2 1 Way Dimmer lightwaverf:d21:77328298:28:1#switch
C2 Generation 1 Single Socket lightwaverf:s11:77328298:45:1#switch
C3 Generation 1 Single Socket lightwaverf:s11:77328298:46:1#switch
Chloes Light Generation 2 1 Way Dimmer lightwaverf:d21:77328298:37:1#switch
Christmas Lights Generation 1 Single Socket lightwaverf:s11:77328298:44:1#switch
Craft Room Light Generation 2 1 Way Dimmer lightwaverf:d21:77328298:47:1#switch
Energy Monitor Generation 1 Energy Monitor lightwaverf:e11:77328298:36:1#power
Garden Lights Generation 1 Single Socket lightwaverf:s11:77328298:34:1#switch
Gracies Light Generation 2 1 Way Dimmer lightwaverf:d21:77328298:38:1#switch
Gracies Star Generation 1 Single Socket lightwaverf:s11:77328298:31:1#switch
Green Lamp Generation 1 Single Socket lightwaverf:s11:77328298:11:1#switch
Greenhouse Light Generation 1 Single Socket lightwaverf:s11:77328298:32:1#switch
Hall Generation 2 2 Way Dimmer lightwaverf:d22:77328298:26:1#switch lightwaverf:d22:77328298:26:2#switch
Kettle Generation 1 Single Socket lightwaverf:s11:77328298:39:1#switch
Kitchen Lights Generation 2 2 Way Dimmer lightwaverf:d22:77328298:42:1#switch lightwaverf:d22:77328298:42:2#switch
Landing Generation 2 2 Way Dimmer lightwaverf:d22:77328298:27:1#switch lightwaverf:d22:77328298:27:2#switch
Lava Lamp Generation 1 Single Socket lightwaverf:s11:77328298:14:1#switch
LinkPlus Hub Lightwave Hub lightwaverf:h21:77328298:1:1#currentTime
Living Room Generation 2 3 Way Dimmer lightwaverf:d23:77328298:41:1#switch lightwaverf:d23:77328298:41:2#switch lightwaverf:d23:77328298:41:3#switch
Living Room Socket Generation 2 Double Socket lightwaverf:s22:77328298:4:1#switch lightwaverf:s22:77328298:4:2#switch
Morning Room Light Generation 2 1 Way Dimmer lightwaverf:d21:77328298:29:1#switch
Outside Lights Generation 1 Single Socket lightwaverf:s11:77328298:23:1#switch
Printer Generation 1 Single Socket lightwaverf:s11:77328298:35:1#switch
Pump Generation 1 Single Socket lightwaverf:s11:77328298:33:1#switch
Reading Lamp Generation 1 Single Socket lightwaverf:s11:77328298:30:1#switch
Side Lights Generation 1 Single Socket lightwaverf:s11:77328298:43:1#switch
Twigs Generation 1 Single Socket lightwaverf:s11:77328298:24:1#switch
Window Lights Generation 1 Single Socket lightwaverf:s11:77328298:25:1#switch

I notice that my device numbers aren’t a nice simple list starting at 1 and going up in a contiguous block. If they were, it would be a nice simple list from 1 to 29, but it isn’t. They’ve always been like this, even back in the days of the script. If I do a manual structure dump from LWRF that’s the way the numbers come back. Could be because I was an early adopter and added a number of thigs then deleted them back in the day. I wonder if that could be upsetting things?
I notice also that the thing that polls the most reliably is the Energy Monitor which also happens to be the thing with number 1

LightwaveRF Account Thing:
Looking under here (still in Paper UI) I still see the things duplicated several times even after the clear and restart.

Items:
Definitely only one physical items file, and each item is referenced only once, no duplicates. This is my original ‘script’ items file - so I could keep the same item names - just with the correct channel= dexctiptor tacked onto the end of each one. Here’s a sample from something that doesn’t poll:

Switch Lightwave_Internet_switch “Internet” (GroupGroundSockets, GF_LivingRoom) { channel=“lightwaverf:s22:77328298:4:1#switch” }
Switch Lightwave_Internet_outletInUse_Value “Internet outletInUse [%s] (Read Only)” <poweroutlet_uk> { channel=“lightwaverf:s22:77328298:4:1#outletInUse” }
String Lightwave_Internet_outletInUse “Internet outletInUse [%s] (Read Only)” <poweroutlet_uk> (GF_LivingRoom)
Switch Lightwave_Internet_protection “Internet protection” (GroupGroundSocketsOther, GF_LivingRoom) { channel=“lightwaverf:s22:77328298:4:1#protection” }
Switch Lightwave_Internet_identify “Internet identify” (GroupGroundSocketsOther, GF_LivingRoom) { channel=“lightwaverf:s22:77328298:4:1#identify” }
Color Lightwave_Internet_rgbColor “Internet rgbColor” (GroupGroundSocketsOther, GF_LivingRoom) { channel=“lightwaverf:s22:77328298:4:1#rgbColor” }
Number Lightwave_Internet_power “Internet power [%.1f W] (Read Only)” (GroupGroundSocketsPower, GF_LivingRoom) { channel=“lightwaverf:s22:77328298:4:1#power” }
Number Lightwave_Internet_energy “Internet energy [%.2f kWh] (Read Only)” (GroupGroundSocketsEnergy, GF_LivingRoom) { channel=“lightwaverf:s22:77328298:4:1#energy” }
Number Lightwave_Internet_voltage “Internet voltage [%.1f V] (Read Only)” (GF_LivingRoom) { channel=“lightwaverf:s22:77328298:4:1#voltage” }
Number Lightwave_Internet_current “Internet current [%.1f A] (Read Only)” (GF_LivingRoom)
Number Lightwave_Internet_Power_Cost “Internet Power Cost [%.3f £/Hour]” (GroupGroundSocketsPowerCost, GF_LivingRoom)
Number Lightwave_Internet_Energy_Cost “Internet Energy Cost [£ %.2f to date]” (GroupGroundSocketsEnergyCost, GF_LivingRoom)

And a sample from something that does:

String Lightwave_LinkPlus_currentTime "LinkPlus currentTime "
String Lightwave_LinkPlus_buttonPress “LinkPlus buttonPress(Read Only)” { channel=“lightwaverf:h21:77328298:1:1#buttonPress” }
//String Lightwave_LinkPlus_time “LinkPlus time(Read Only)”
//String Lightwave_LinkPlus_date “LinkPlus date(Read Only)”
//String Lightwave_LinkPlus_monthArray “LinkPlus monthArray(Read Only)”
//String Lightwave_LinkPlus_weekdayArray “LinkPlus weekdayArray(Read Only)”
String Lightwave_LinkPlus_timeZone_Value "LinkPlus timeZone Value " { channel=“lightwaverf:h21:77328298:1:1#timeZone” }
String Lightwave_LinkPlus_timeZone "LinkPlus timeZone " // Display nalue translated by rule into GMT or BST
//String Lightwave_LinkPlus_locationLongitude "LinkPlus locationLongitude "
//String Lightwave_LinkPlus_locationLatitude "LinkPlus locationLatitude "
String Lightwave_LinkPlus_duskTime "LinkPlus duskTime " { channel=“lightwaverf:h21:77328298:1:1#duskTime” }
String Lightwave_LinkPlus_dawnTime "LinkPlus dawnTime " { channel=“lightwaverf:h21:77328298:1:1#dawnTime” }
Number Lightwave_LinkPlus_rgbColor "LinkPlus rgbColor " { channel=“lightwaverf:h21:77328298:1:1#rgbColor” }
//String Lightwave_LinkPlus_day “LinkPlus day(Read Only)”
//String Lightwave_LinkPlus_month “LinkPlus month(Read Only)”
//String Lightwave_LinkPlus_year “LinkPlus year(Read Only)”
//String Lightwave_LinkPlus_weekday “LinkPlus weekday(Read Only)”
Switch Lightwave_LinkPlus_identify “LinkPlus identify” (GroupGroundSocketsOther) { channel=“lightwaverf:h21:77328298:1:1#identify” }

Do you think it would be worth me creating a physical Things file using the thing details I’ve captured above? Then delete all of them from the inbox and let it repopulate from the file - no discovery. How would I structure it given my odd device numbers?

[username="example@hotmail.co.uk",password="xxxxxx",pollingInterval=5,pollingGroupSize=20

It doesnt matter, it only picks up each sdId (which is the number between the two hyphens in the full deviceId) had to keep it simple for text based. It will only discover 1 of each of these, which is why i believe there to be some form glith with your ‘managed things’.

This is mine so you can adopt, have changed some deviceIds so you can see.

Bridge lightwaverf:lightwaverfaccount:benfleet "Lightwave Account" @ "Cupboard" [ username="example@hotmail.co.uk", password="xxxxxxx",pollingInterval=5,pollingGroupSize=30] {

h21 	LightwaveHub	"Link Plus" @ "Cupboard"                        [ sdId="1" ]
s22 	KitchenSocket1 	"Kitchen Alexa & Toaster" @ "Kitchen"		    [ sdId="31" ]
s22 	KitchenSocket2 	"Kitchen Spare & Kettle" @ "Kitchen"		    [ sdId="26" ]
s22 	KitchenSocket3 	"Kitchen TV & TV Light" @ "Kitchen"		        [ sdId="4" ]
s22 	KitchenSocket4 	"Kitchen Breakfast Bar" @ "Kitchen"		        [ sdId="5" ]
s22 	GeorgesSocket1 	"George TV & Lamp" @ "George"			        [ sdId="11" ]
s22 	KitchenSocket5 	"Kitchen Microwave & Cupboard" @ "Kitchen"	    [ sdId="12" ]
s22 	LoungeSocket1 	"Lounge Chair" @ "Lounge"			            [ sdId="13" ]
s22 	LoungeSocket2 	"Lounge Stereo & Nintendo Switch" @ "Lounge"	[ sdId="14" ]
s22 	LoungeSocket3 	"Lounge Network Switch & TV" @ "Lounge"		    [ sdId="15" ]
	
}

bear in mind your bridge and device names so you dont have to change all your item channels:
ie:
KitchenSocket1 from the device thing and benfleet from account thing are in the channel:

{ channel="lightwaverf:s22:benfleet:KitchenSocket1:2#switch" }

Also, you could try deleting your account thing and 1 of the things that shows up as duplicate.
Then check that they are definitely not there.
Re-add your account thing and then check its properties.
Then readd the single device thing you deleted.

When I alter it to (anything less than 20 on the pollingGroupSize)

,pollingInterval=5,pollingGroupSize=5

I get the following and it all goes to BRIDGE_UNINITIALIZED

java.lang.IllegalArgumentException: fromIndex(5) > toIndex(0)
        at java.util.ArrayList.subListRangeCheck(ArrayList.java:1014) ~[?:1.8.0_232]
        at java.util.ArrayList.subList(ArrayList.java:1004) ~[?:1.8.0_232]
        at org.openhab.binding.lightwaverf.internal.handler.LWAccountHandler.pollingSize(LWAccountHandler.java:205) ~[?:?]
        at org.openhab.binding.lightwaverf.internal.handler.LWAccountHandler.startRefresh(LWAccountHandler.java:280) ~[?:?]
        at org.openhab.binding.lightwaverf.internal.handler.LWAccountHandler.initialize(LWAccountHandler.java:87) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_232]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_232]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_232]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_232]
        at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
        at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_232]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]
2020-02-14 15:57:18.932 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing 'lightwaverf:lightwaverfaccount:alex': fromIndex(5) > toIndex(0)
java.lang.IllegalArgumentException: fromIndex(5) > toIndex(0)
        at java.util.ArrayList.subListRangeCheck(ArrayList.java:1014) ~[?:1.8.0_232]
        at java.util.ArrayList.subList(ArrayList.java:1004) ~[?:1.8.0_232]
        at org.openhab.binding.lightwaverf.internal.handler.LWAccountHandler.pollingSize(LWAccountHandler.java:205) ~[?:?]
        at org.openhab.binding.lightwaverf.internal.handler.LWAccountHandler.startRefresh(LWAccountHandler.java:280) ~[?:?]
        at org.openhab.binding.lightwaverf.internal.handler.LWAccountHandler.initialize(LWAccountHandler.java:87) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_232]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_232]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_232]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_232]
        at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
        at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_232]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]

@xela - Ive just checked.
Its something to do with the initialization, doesnt matter what the number is, its the fact its been changed.
Will try and have a look later.

That’s not what I was seeing, if I changed it to anything less than 20 it failed, anything greater than it went to unitialized but went online after.

I’m playing with dimSetup at the moment, but will provide some more details once I’ve finished breaking that :slight_smile:

I think i have found the issue.
ill get rid of it shortly, was this a stress test only… as i don’t think you really want to set it that low… 20-40 is ideal

Yes, I do some testing at work, so attempt to break things deliberately :slight_smile:

Ok, I’ve done some investigation on dimSetup, as predicted, it’s related to Calibration.

When already calibrated, it seems to have a value of 113868800

You seem to be able to set this to any value above 0 and it doesn’t seem to do anything

If you set it to 0, then it force a recalibration.

I’m not sure how you would code this, I assume maybe a fake switch that sets it to 0 if turned on?

EDIT: doesn’t always seem to be 113868800, one I’ve not played with is 136839168, another is 134955008, I assume it’s something to do with the result of the calibration, but changing it manually seems to have no impact on the dimmability of the bulbs

bulbSetup is a number based upon the settings in the app for the switch, from what I can tell it’s loosely calculated on the following:

  • Total number of lamps controlled by switch
  • The wattage of each lamp controlled by the switch

image

Not sure it’s of much use in OpenHAB at present?

EDIT: forgot to add, the app states these figures ‘help us calibrate the energy monitoring capabilities of this device’

Running 1.0.8 anyone else have an issue where if you change the dimlevel the slider returns to 100 but the light is at the new selected level?

I’m having issues adjusting Brightness on sockets led, also running 1.0.8, slider returns to 100 and nothing changes

Can I ask a very basic question? It looks as if this new binding uses the lightwaverf cloud server to do all the heavy lifting, so if I only want to use my Gen1 hub as a local controller then is this new binding overkill? It seems the original binding is exactly what I want, but as I’m trying to only use OH2 bindings then that’s not an option for me. Does anyone have a view on this?

(I do have a stop-gap solution using netcat commands that seems to work for me, but it’s a hard-coded bodge!)

This indeed uses the cloud servers as any gen2 stuff is only controllable this way. Although integration is available for gen1 equipment using the cloud.

You would have to carry on using the v1 binding if it’s just gen1 equipment you have and want local control.

@BenDWire
Could you do me a favour.
Add the binding
Add your account
Discover devices and add them.
Go to each device in paperui (different types) and send me what it lists under properties
I’m only concerned for gen1 hub and everything else gen1 not (single socket/energy monitor/thermostat)

I can’t promise anything but I’ll take a look at a possible gen1/gen2 split time keep gen1 hubs local

Thanks Dave - I suspected that was the case. My experience with the hardware has been less than favourable anyway, with a few sockets going faulty despite having very little load applied, so I may well cut my losses and switch to a WiFi solution instead.

I’ve had my gen2 sockets in for about 2 years now (1st batch), and touch wood I’ve not had a blip yet

Sorry - our replies crossed!
My biggest problem is that I use a PiHole to block all my local IoT stuff from leaking out into the cloud. I did disable it and try to use the binding with no success. I’ll give it another go and report back.

OK, so I deleted my configuration files from my previous attempts (.things & .items) and added the 1.0.8 binding once again. I added my (correct!) account details but ended up with UNINITIALIZED - HANDLER_INITIALIZING_ERROR for the LightwaveRF Account Thing. According to the log, I am “connected to lightwave” but when the List Generation was started it threw an error while calling ThingHandler.initialise(). Debug log shown below.

12:06:29.037 [WARN ] [g.lightwaverf.internal.UpdateListener] - Connected to lightwave
12:06:29.044 [DEBUG] [erf.internal.handler.LWAccountHandler] - Started List Generation
12:06:29.350 [ERROR] [rnal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.initialize()' on 'org.openhab.binding.lightwaverf.internal.handler.LWAccountHandler@8fac75': null
java.lang.NullPointerException: null
	at org.openhab.binding.lightwaverf.internal.handler.LWAccountHandler.createLists(LWAccountHandler.java:112) ~[?:?]
	at org.openhab.binding.lightwaverf.internal.handler.LWAccountHandler.initialize(LWAccountHandler.java:83) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_222]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_222]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_222]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_222]
	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?: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]
12:06:29.371 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'lightwaverf:lightwaverfaccount:c3e53c09' changed from INITIALIZING to UNINITIALIZED (HANDLER_INITIALIZING_ERROR)
12:06:29.372 [ERROR] [.core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing 'lightwaverf:lightwaverfaccount:c3e53c09': null
java.lang.NullPointerException: null
	at org.openhab.binding.lightwaverf.internal.handler.LWAccountHandler.createLists(LWAccountHandler.java:112) ~[?:?]
	at org.openhab.binding.lightwaverf.internal.handler.LWAccountHandler.initialize(LWAccountHandler.java:83) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_222]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_222]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_222]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_222]
	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?: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]

I ought to add that my Gen1 hub firmware version is U2.94D, just in case that matters, and I’m running OpenHAB 2.5.1