Line 410:
if(Features_Writable == “true” &&
Needs to be
else if(Features_Writable == “true” &&
otherwise the targetemperature rule gets caught again by one of the later if’s
Line 410:
if(Features_Writable == “true” &&
Needs to be
else if(Features_Writable == “true” &&
otherwise the targetemperature rule gets caught again by one of the later if’s
@xela Try this one.
Fixed Auth Rule error (else argument missing {}
Modified Groups slightly
Fixed if to else if
Lw_Base_v2-7_2020-01-14.rules.txt (38.7 KB)
Looking good so far, will abuse it a bit more this evening and let you know if I find anything
Can you include “productCode”: “L22MK2”, in the dimmer group, this is the Smart 2 gang dimmers, I would assume there is L23MK2 and L24MK2 but I don’t own any of those ![]()
@xela I got the product codes off of Lws website, wish they would document everything correctly as im pissing in the wind a little with things like that. I had added the L21MK2 as it was in @Fixer json he sent me, have just added the others for you, hopefully i didnt break anything else ![]()
Lw_Base_v2-7-1_2020-01-14.rules.txt (38.8 KB)
@Greigc my habpanel at present (scales to tablet) but far from finished (only used when out of house remotely, haven’t got round to wall mounts yet)
Initial tests look ok, I still have issues with Auth occasionally, I don’t know if it’s where I’m setting up again from scratch, but there’s something it just doesn’t like.
you’ll get loads of errors if its already in the system running when you press setup or update.
once its done though the errors shouldn’t reoccur. (other than Api limit reached if your going too quick for lightwaves ridiculously low limit)
I was still seeing
5:31:08.630 [INFO ] [smarthome.event.ItemStateChangedEvent] - LwGet_Run changed from ON to OFF
15:31:14.621 [ERROR] [nhab.binding.exec.handler.ExecHandler] - An exception occurred while formatting the command line with the current time and input values : ‘Format specifier ‘%2$s’’
15:31:14.624 [INFO ] [smarthome.event.ItemStateChangedEvent] - LwGet_Run changed from OFF to ON
15:31:14.634 [INFO ] [smarthome.event.ItemStateChangedEvent] - LwGet_Run changed from ON to OFF
15:31:20.626 [ERROR] [nhab.binding.exec.handler.ExecHandler] - An exception occurred while formatting the command line with the current time and input values : ‘Format specifier ‘%2$s’’
15:31:20.632 [INFO ] [smarthome.event.ItemStateChangedEvent] - LwGet_Run changed from OFF to ON
15:31:20.633 [INFO ] [smarthome.event.ItemStateChangedEvent] - LwGet_Run changed from ON to OFF
15:31:26.629 [ERROR] [nhab.binding.exec.handler.ExecHandler] - An exception occurred while formatting the command line with the current time and input values : ‘Format specifier ‘%2$s’’
15:31:26.640 [INFO ] [smarthome.event.ItemStateChangedEvent] - LwGet_Run changed from OFF to ON
15:31:26.651 [INFO ] [smarthome.event.ItemStateChangedEvent] - LwGet_Run changed from ON to OFF
15:31:32.632 [ERROR] [nhab.binding.exec.handler.ExecHandler] - An exception occurred while formatting the command line with the current time and input values : ‘Format specifier ‘%2$s’’
15:31:32.660 [INFO ] [smarthome.event.ItemStateChangedEvent] - LwGet_Run changed from OFF to ON
15:31:32.663 [INFO ] [smarthome.event.ItemStateChangedEvent] - LwGet_Run changed from ON to OFF
15:31:38.636 [ERROR] [nhab.binding.exec.handler.ExecHandler] - An exception occurred while formatting the command line with the current time and input values : ‘Format specifier ‘%2$s’’
15:31:38.682 [INFO ] [smarthome.event.ItemStateChangedEvent] - LwGet_Run changed from OFF to ON
15:31:38.686 [INFO ] [smarthome.event.ItemStateChangedEvent] - LwGet_Run changed from ON to OFF
15:31:44.638 [ERROR] [nhab.binding.exec.handler.ExecHandler] - An exception occurred while formatting the command line with the current time and input values : ‘Format specifier ‘%2$s’’
15:31:44.643 [INFO ] [smarthome.event.ItemStateChangedEvent] - LwGet_Run changed from OFF to ON
15:31:44.645 [INFO ] [smarthome.event.ItemStateChangedEvent] - LwGet_Run changed from ON to OFF
15:31:50.641 [ERROR] [nhab.binding.exec.handler.ExecHandler] - An exception occurred while formatting the command line with the current time and in
In the logs, which I believe is because the token isn’t getting correctly passed to the Lw_Get script, even though the refresh and access tokens seem to get updated. If I replace it with my code that doesn’t check LwAuth_Inp.state matches Authentication, but just sets it again and switches on it, the issue resolves.
However, the same code you put in there earlier today did work, so there is something intermittent somewhere!
Also, I need to hit it some more, but I don’t think there is a limit in terms of how many times a minute you can hit it, or how many features you can request, however, I think their API has a run timeout on it, and if the request takes longer than x seconds it just kills it and returns structure not found.
It defo has a limit to how much you can hit it as when im testing in postman it gives me the dreaded {structure not found}, and im sure when i made v1 and I was querying each feature individually i told me to F-off (100 features every 5 seconds it did not like at all), then i found the batch read.
We will find out soon as I am now all set up IDE wise and have just started writing the binding (will start by querying each feature individually to see if i get told to get lost by LW’s servers)
I was getting the format specifier error at times, i think its where you hit the api limits, then request a token, gets a bad request, then updates the get features and because its wrong it throws that error.
@xela Also I noticed your missing the -s parameter from your auth - this removes the response stats which messes with the json response
Just a little update..
I’m well on my way to creating the binding and hopefully will have something for you to all test by the end of next week.
@Delid4ve Well done sir. Once you get somewhere would you share the code with me? I’d like to see how it’s done
@Fixer of course, once I’ve got it semi working ill put it on git anyhow.
Need a ‘JAVA For Dummies’ Book right now ![]()
Still getting my head around the language.
@Delid4ve Have a look at
https://www.w3schools.com/ I’ve found it good for Perl, Python and PHP.
Never managed to get my head round Java though, just seems so needlessly complex - why do it in five lines of code when fifteen will do lol
@delid4ve fantastic work mate well done
Looking good!
Let us know when you want some help with the testing
Wow, great work
@Fixer not far off, maybe even tomorrow as got a free night tonight
Still a long way to go tho