Push button dzvents script goes double when turning off
Posted: Friday 11 January 2019 22:44
I have a zwave button which i have added to domoticz.
In another page i found a script to toggle another light when pushing the button.
This works but everything I switch using Dzvents scripts (i tried other scripts that use if and else to check if the light is on) when turning the light or wall plug of it switches double. This causes the light to turn of but it's still on in domoticz because domoticz receives the command 2 times.
The light itself cannot respond that fast so the light itself is off, but the in domoticz it is still on. The next time i press the button nothing happens because the light in domoticz will be switches off so i have to press 2 times to switch the light on.
2019-01-11 21:42:50.374 (Z-Wave) Light/Switch (Stalamp Woonkamer)
2019-01-11 21:42:50.429 (Z-Wave) Light/Switch (Stalamp Woonkamer)
2019-01-11 21:42:50.720 (P1 Smart Meter) P1 Smart Meter (Stroom)
2019-01-11 21:42:50.721 (P1 Smart Meter) General/Voltage (Voltage L1)
2019-01-11 21:42:50.237 Status: dzVents: Info: Handling events for: "Knop", value: "On"
2019-01-11 21:42:50.237 Status: dzVents: Info: ------ Start internal script: test: Device: "Knop (Z-Wave)", Index: 947
2019-01-11 21:42:50.238 Status: dzVents: Info: ------ Finished test
2019-01-11 21:42:50.328 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
It's for the " Stalamp Woonkamer".
Does anybody has this same problem or can help me with this?
Regards.
In another page i found a script to toggle another light when pushing the button.
Code: Select all
return {
on = { devices = { "XButton" }}, -- Name of your button
execute = function(dz, item )
if item.state == "Click" then
dz.devices("Yeelight").toggleSwitch() -- Name of your Yeelight
end
end
}
The light itself cannot respond that fast so the light itself is off, but the in domoticz it is still on. The next time i press the button nothing happens because the light in domoticz will be switches off so i have to press 2 times to switch the light on.
2019-01-11 21:42:50.374 (Z-Wave) Light/Switch (Stalamp Woonkamer)
2019-01-11 21:42:50.429 (Z-Wave) Light/Switch (Stalamp Woonkamer)
2019-01-11 21:42:50.720 (P1 Smart Meter) P1 Smart Meter (Stroom)
2019-01-11 21:42:50.721 (P1 Smart Meter) General/Voltage (Voltage L1)
2019-01-11 21:42:50.237 Status: dzVents: Info: Handling events for: "Knop", value: "On"
2019-01-11 21:42:50.237 Status: dzVents: Info: ------ Start internal script: test: Device: "Knop (Z-Wave)", Index: 947
2019-01-11 21:42:50.238 Status: dzVents: Info: ------ Finished test
2019-01-11 21:42:50.328 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
It's for the " Stalamp Woonkamer".
Does anybody has this same problem or can help me with this?
Regards.