LightwaveRF Binding Updated

Update on the above post.
I re-ran the discovery and let it do everything again.
It worked, but same result - the authentication works, the device control works, the refresh rule fails with the same error and adding the log line back in shows that the cURL is returning nothing. Lightwave must have changed something, my money’s on them having added a limit to the number of fixtures you can have in a bulk fixture read.
I’m going to experiment with a lot less fixtures and/or specific types of features to see if I can narrow this down.

Update to the update:
Yes, they’ve changed something. I modified the rule to only pull back the first 12 items (the LinkPlus time, date, LED colour etc) and it works again.
Grrrrrrr…

What about if you separate into 2 rules, half and half? It’s going to use an extra rule thread up so maybe up the default value in the cfg file?

Maybe they have removed one of the gen1 features or something, may just be one line failing the whole thing

I’m working along those lines. I took out everything but the LinkPkus items and it worked. So far I’ve added back in a Gen 2 socket, a Gen 1 plug-in socket and a Gen 1 relay and it’s still working. Next I’ll try some Gen 2 dimmers. If it still works after that then it’s not a particular fixture type, it must be a limit on the total number of fixtures you can pull in one request.
I’ll report back with my findings

May be a little slow on the replies as my kitchen currently looks like this

@delid4ve Hope your kitchen’s coming on OK.
I’ve made quite a bit of progress, still a few loose ends to tie up.
I now have all of my devices and different device types back in the refresh rule and it’s still working ok. To me this suggests they’ve put a limit on the maximum number you can pull in a bulk request. I need to do a few more tests to try to pin down what that limit is.
For the time being, my approach has been to remove from polling everything I’m not really bothered about to keep the number down. So I’m only polling about half the Link Plus stuff and for each device I’m not polling things like LED Colour, Update, Locate, Bulb Setup, Dim Setup etc. My reasoning is that I can easily do those from the LWRF app on the very odd occasion I want to touch them, the business of my OpenHAB is the day-to-day automation and control of the house so for each device I’m just pulling what I need to do that - Switch, Dimmer level, Protection and the power measurements.
I’ve also been through the refresh and switch rules and the item definitions and made a few improvements there. When you get round to revisiting your setup give me a shout as you might want to nick some of what I’ve done.

Cool.
Did you run it from scratch again or just modify existing to get it working.
I’m completely offline atm but im getting there

I kept your rule as-is, which was failing constantly by returning no data, and started by deleting all of the ‘lines’ in the cURL except for half a dozen of the first LinkPlus ones and I stuck a return; after the processing for those first few items so the rule didn’t error. It worked again straight away.
From there I slowly added more items back in a few at a time, trying different types of devices etc until I got back to where I am now with all my kit working - except as I explained in the previous post that I’m no longer polling everything.
The only logical explanation I have right now is a limit on the number of items which I’m going to test further. If that limit is real and it proves a problem in the future (I still have more devices to add around the house yet) I have an idea to split the polling and have two refresh rules, one polling frequently that just retrieves the device switch and DimLevels, and a second one running say every 30 seconds to pull the power readings and other less time-critical stuff.

Quick update - I added an LWRF Energy Monitor and have got OpenHAB working with that now also

Good stuff.
Should be back around again soon. Been a lot of heavy graft getting everything done and works gone crazy

Hi All

Haven’t been round since I posted on this thread nice to see so many people working on the integration of Lightwaverf to OpenHAB. :slightly_smiling_face:

Just some info, I have been using LightwaveRF for over 4 years originally gen1 however since they have introduced gen2 i decided to upgrade the switches to the new ones and has not proven to be the smartest thing… So far three switches have had problems with internal burning / smouldering. By the way all the switches are in different locations. LightwaveRF don’t care about the issues and blame installation or bulbs.

Bottom line is watch out with there Gen2 units since there are others that report these issues…

I am a new user to Openhab2 and have just bought some LightwaveRF Gen 2 bits

I managed to get the Lightwave_Setup.rules to work but I am running this in Docker so I had to change the paths - all was looking good and I got the newly added Gen2 double socket in and controlled.

I then wired a Gen2 lightswitch and added that to the hub and then the Lightwave_Setup.rules now throws an error “File name too long”

Its happening on this part:
var Exec6 = executeCommandLine(“sh@@-c@@echo “” + Items + “\r” >> /openhab/conf/items/LightWave_Items_Devices.items”,5000)

Any ideas?

I have managed to copy most of the script and get it working in NodeRed but I would prefer if it could go into OpenHab.

Thank you

Hi dominic
delid4ve is the expert. I can try to help too but it will be next week before I have any real time to look at it.

In the meantime, did you run the discovery script again after adding the light? You need to redo it whenever you add new devices.

1 Like

Been a while since I’ve looked at any of my lightwave setup files as I haven’t changed anything.

Did you delete all the files it created and start again from fresh?

I’ll be able to have a little look at my files tomorrow as I’m in the process of getting my IntesisBox working the same sort of way to control my air con

1 Like

Could you post the log from when you run the setup (remove any tokens first)

1 Like

Hi Dave,

I have sent you a message just in case I left something in the log that should not be public :slight_smile:

From what I can see in the logs your script does find all my devices and list them correctly but is having trouble writing the LightWave_Rules_Device_Switch.rules and LightWave_Items_Devices.items.

If I run the script several times it will write some data to those files but OpenHab will complain about the data format and “Ignore”

i.e. [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘LightWave_Items_Devices.items’ has errors, therefore ignoring it: [11,23]: mismatched input ‘:’ expecting ‘=’
[11,24]: missing ‘}’ at ‘MyGroup’
[11,31]: extraneous input ‘,’ expecting RULE_ID

I don’t know if this is simply because I am running everything in Docker? but I updated the paths to point at /openhab/conf/ which is the volume it can write to and I can see the script creating/deleting the files.

I’ve sent you pm however I’m seeing terminal stats through the log, did you use the latest files I posted or the first one you came across…

I am sure I downloaded all the files in this thread and replaced the Lightwave_Setup.rules.txt for the latest one…

But I am now about to double check :slight_smile:

OK… A bit of a Muppet moment. I did use the previous file but the results are the same

1005454100545400238160–:--:----:–:----:–:--23816: File name too long
sh: 6: 297981d6b-4-3157338566+1,type:date,writable:false},{featureId:5da1d1471003e54297981d6b-5-3157338566+1,type:monthArray,writable:false},{featureId:5da1d1471003e54297981d6b-…







47-3157338566+1,type:bulbSetup,writable:true}]}],product:L21MK2,device:dimmer,desc:SmartDimmer,type:lwrfTwoWay_v2,cat:Lighting,gen:2},{deviceId:5da1d1471003e54297981d6b-1-3157338566+1,name:LinkPlus,productCode:L2,featureSets:[{featureSetId:5da1d1471003e54297981d6b-5da1d1481003e54297981d74,name:LinkPlus,features:[{featureId:5da1d1471003e54297981d6b-1-3157338566+1,type:currentTime,writable:false},{featureId:5da1d1471003e54297981d6b-2-3157338566+1,type:buttonPress,writable:false},{featureId:5da1d1471003e54297981d6b-3-3157338566+1,type:time,writable:false},{featureId:5da1d1471003e54
1005454100545400238160–:--:----:–:----:–:--23816: File name too long

All the “File name too long” results in empty files

Looking at what you pm’d me That’s an old file use this one: (delete everything and start from scratch.

Then send me the log from when it initially runs and the files generated.
Have you double checked openhab has full permissions on them folders?

So just the Lightwave_Setup_2019-05-11_1141.rules and the LightWave_Setup.items

or

Lightwave_Setup_2019-05-11_1141.rules and Lightwave_Setup.rules and the LightWave_Setup.items