Page 1 of 1
runIn function dzVents
Posted: Wednesday 22 October 2025 21:45
by Piacco
I write my scripts with the help of AI. The AI suggested using the dz.runIn function. I searched the Domoticz wiki, but I couldn’t find any information about this function. Is this an actual function in dzVents, or is it a non-existent function?
I'am using Domoticz 2025.1 dzVents Version: 3.1.8
--[[
------------------------------------------------------
--

Wait briefly to determine the final click count
------------------------------------------------------
dz.runIn(MAX_CLICK_INTERVAL + 0.5, function(dz2)
local clicks = dz2.data.clickCount
dz2.data.clickCount = 0
Re: runIn function dzVents
Posted: Wednesday 22 October 2025 21:54
by waltervl
Never heard about this function. AI is perfect in inventing non existing truths.
Re: runIn function dzVents
Posted: Wednesday 22 October 2025 22:08
by Piacco
"Okay, thanks. I mentioned it to the AI.
- Spoiler: show
- AI is perfect at inventing things that don’t exist.
And now it’s saying that it’s a non-existent function.
"But my problem is still there. I need a function so that when I switch on my lamp, it automatically turns off after 60 seconds. If I press the switch three times in 5 seconds, it should stay on continuously."
Re: runIn function dzVents [Solved]
Posted: Wednesday 22 October 2025 22:21
by waltervl
Switching off after 60 seconds can be done with
Code: Select all
domoticz.devices('mydevice').switchOff.afterSeconds(60)
Or
Code: Select all
domoticz.devices('mydevice').switchOn.forSeconds(60)
Domoticz cannot easily detect clicking a switch 3 times in x seconds. But some zigbee/zwave switches have multiple functions like double click, long click etc.
Edit. Could be a typing error here. Please check precise notation on the dzvents wiki (also a better guide than AI for this).
Re: runIn function dzVents
Posted: Wednesday 22 October 2025 22:47
by Piacco
Thanks for your answer, my cheap Zigbee device only has one function

. I guess I’ll have to spend more money to get a better one.
Re: runIn function dzVents
Posted: Wednesday 22 October 2025 23:54
by waltervl
Are you sure, most of my cheap zigbee switches have that function. What switch do you have? Do you use zigbee2mqtt or zigbee4domoticz?
Re: runIn function dzVents
Posted: Thursday 23 October 2025 21:31
by Piacco
I've this device, Girier Model JR-ZDS01
https://www.zigbee2mqtt.io/devices/JR-Z ... r-jr-zds01, together with Zigbee2MQTT running inside a Docker container.
Re: runIn function dzVents
Posted: Friday 24 October 2025 16:19
by waltervl