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.