I've hurt my brain coming up with a solution for this one.
What I would like to do, is when I press an off switch twice withing 5 seconds, a scene is activated that turns off all the lights.
Is there a way to do this?
Double off tap
Moderator: leecollings
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Double off tap
Should be doable with a script.MatthijsD wrote:I've hurt my brain coming up with a solution for this one.
What I would like to do, is when I press an off switch twice withing 5 seconds, a scene is activated that turns off all the lights.
Is there a way to do this?
Verstuurd vanaf mijn ONEPLUS A6003 met Tapatalk
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Double off tap
Would not know a solution with Blockly but with dzVents it could look like:
Code: Select all
-- doubleTap
local switchName = "dblTapSwitch" -- Name of your triggerSwitch
local sceneName = "dblTapScene" -- Name of the Scene that will be triggered by double tap switch Off
return {
on = { devices = { switchName }},
-- logging = { level = domoticz.LOG_DEBUG ,
-- marker = "doubleTap"},
data = { lastState = { initial = "Off" }},
execute = function(dz, item )
if item.state == "Off" and dz.data.lastState == "Off" and item.lastUpdate.secondsAgo < 6 then
dz.scenes(sceneName).switchOn()
end
dz.data.lastState = item.state
end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Who is online
Users browsing this forum: No registered users and 1 guest