dzVents script works, but LED lights are not turned on
Posted: Thursday 29 November 2018 11:31
Hello,
I have the dzVents code
This is actually working, BUT, the light switch is not turned on. In Domoticz I see the switch (light bulb) is turned on, but I don't see and hear the switch (and the LED lights are not turned on).
The moment I manually turn on the LED lights (by clicking in Domoticz on the switch), the LED lights do turn on!!!
Below is the log of the part when the PIR is activated.
2018-11-29 10:56:24.922 Status: dzVents: Info: Handling events for: "PIR", value: "On"
2018-11-29 10:56:24.922 Status: dzVents: Info: ------ Start internal script: Kippenhok: Device: "PIR (RFLink)", Index: 64
2018-11-29 10:56:24.924 Status: dzVents: Info: ------ Finished Kippenhok
2018-11-29 10:56:24.980 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2018-11-29 10:56:25.013 Status: RFLink Sending: 10;NewKaku;3e540e6;2;ON;
2018-11-29 10:56:34.971 Status: dzVents: Info: Handling events for: "PIR", value: "Off"
2018-11-29 10:56:34.971 Status: dzVents: Info: ------ Start internal script: Kippenhok: Device: "PIR (RFLink)", Index: 64
2018-11-29 10:56:34.971 Status: dzVents: Info: ------ Finished Kippenhok
2018-11-29 10:57:24.989 Status: RFLink Sending: 10;NewKaku;3e540e6;2;OFF;
When I look at the log. It all seems fine, but the LED lights aren't switched on.
Below I have the log of manually switching on the lights
2018-11-29 11:24:30.357 Status: User: Admin initiated a switch command (34/Paardenstal/On)
2018-11-29 11:24:30.358 Status: RFLink Sending: 10;NewKaku;3e540e6;2;ON;
2018-11-29 11:24:45.373 Status: User: Admin initiated a switch command (34/Paardenstal/Off)
2018-11-29 11:24:45.374 Status: RFLink Sending: 10;NewKaku;3e540e6;2;OFF;
Now the LED are turned on and off.
I tried a lot of things.
In the dzVents script I replaced the switch on/of by calling the Domotiz REST API. When I manually call the http "get" the LED lights are turned on, but the moment the script does it, it isn't (meaning in Domoticz they are, but in real live the LED's aren't).
To switch the the lights, I use RF-Link. I have over 15 lights controled by Domoticz and RF-Link with no problem. Blockly scripts or scheduled on/of, all with no problems.
who can help me.
Edwin
I have the dzVents code
Code: Select all
return {
on = {
devices = {
'PIR'
}
},
execute = function(domoticz, devices)
if (devices.state == 'On') then
domoticz.devices(34).switchOn().checkFirst().forMin(1)
domoticz.devices(34).switchOff().checkFirst().afterMin(1)
end
end
}
The moment I manually turn on the LED lights (by clicking in Domoticz on the switch), the LED lights do turn on!!!
Below is the log of the part when the PIR is activated.
2018-11-29 10:56:24.922 Status: dzVents: Info: Handling events for: "PIR", value: "On"
2018-11-29 10:56:24.922 Status: dzVents: Info: ------ Start internal script: Kippenhok: Device: "PIR (RFLink)", Index: 64
2018-11-29 10:56:24.924 Status: dzVents: Info: ------ Finished Kippenhok
2018-11-29 10:56:24.980 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2018-11-29 10:56:25.013 Status: RFLink Sending: 10;NewKaku;3e540e6;2;ON;
2018-11-29 10:56:34.971 Status: dzVents: Info: Handling events for: "PIR", value: "Off"
2018-11-29 10:56:34.971 Status: dzVents: Info: ------ Start internal script: Kippenhok: Device: "PIR (RFLink)", Index: 64
2018-11-29 10:56:34.971 Status: dzVents: Info: ------ Finished Kippenhok
2018-11-29 10:57:24.989 Status: RFLink Sending: 10;NewKaku;3e540e6;2;OFF;
When I look at the log. It all seems fine, but the LED lights aren't switched on.
Below I have the log of manually switching on the lights
2018-11-29 11:24:30.357 Status: User: Admin initiated a switch command (34/Paardenstal/On)
2018-11-29 11:24:30.358 Status: RFLink Sending: 10;NewKaku;3e540e6;2;ON;
2018-11-29 11:24:45.373 Status: User: Admin initiated a switch command (34/Paardenstal/Off)
2018-11-29 11:24:45.374 Status: RFLink Sending: 10;NewKaku;3e540e6;2;OFF;
Now the LED are turned on and off.
I tried a lot of things.
In the dzVents script I replaced the switch on/of by calling the Domotiz REST API. When I manually call the http "get" the LED lights are turned on, but the moment the script does it, it isn't (meaning in Domoticz they are, but in real live the LED's aren't).
To switch the the lights, I use RF-Link. I have over 15 lights controled by Domoticz and RF-Link with no problem. Blockly scripts or scheduled on/of, all with no problems.
who can help me.
Edwin