Page 1 of 1

LightwaveRF Blockly to check status

Posted: Friday 04 August 2017 21:13
by EdddieN
Hi,

I have several LightwaveRF sockets, they are great looking, except that there's no way to know their status and when there's a power cut... the revert to default off.

I have been trying to create a simple script to check the last status so it can revert back with a user variable, something like this:

Habitat_status (integer) = 0 <- this is what I call the lamp and 0 = off

Then whenever the switch is triggered via domoticz, it updates the variable to 0 or 1 for off and on. Then I have a time blockly like this:
Screen Shot 2017-08-04 at 20.12.20.png
Screen Shot 2017-08-04 at 20.12.20.png (31.82 KiB) Viewed 756 times
But nothing seems to happen every minute, no trace of it on the log file.

Am I missing anything obvious? Also, has anyone overcome this luck of feedback status from the LIghtwaveRF switches with a clever trick? ;)

Re: LightwaveRF Blockly to check status

Posted: Saturday 05 August 2017 1:50
by sion
I think this will only run when either the switch, or the variable changes state.
If you have a power cut, the switch will physically change state, but domoticz won't know about it.

You could make this a Lua script, get it to run every x mins.

Or, you could create a virtual switch, that would some how know when the system has just come back from a power cut, and would turn on for a few seconds after rebooting. If you include
If this switch = on at the start of your bloky then it will run when this switch is on.

I don't know, but would guess it would be possible to turn a switch on for x seconds after the system has booted?

Re: LightwaveRF Blockly to check status

Posted: Saturday 05 August 2017 12:40
by EdddieN
Thanks, yes I guess I would need to find out when the RPI has just booted for first time to trigger the event. Sounds like it is going to be a bash script this time...