runIn function dzVents  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
Piacco
Posts: 81
Joined: Friday 14 November 2014 9:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

runIn function dzVents

Post 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
User avatar
waltervl
Posts: 6676
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: runIn function dzVents

Post by waltervl »

Never heard about this function. AI is perfect in inventing non existing truths.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Piacco
Posts: 81
Joined: Friday 14 November 2014 9:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: runIn function dzVents

Post 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. :D

"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."
User avatar
waltervl
Posts: 6676
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: runIn function dzVents  [Solved]

Post 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).
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Piacco
Posts: 81
Joined: Friday 14 November 2014 9:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: runIn function dzVents

Post 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.
User avatar
waltervl
Posts: 6676
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: runIn function dzVents

Post 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?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Piacco
Posts: 81
Joined: Friday 14 November 2014 9:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: runIn function dzVents

Post 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.
User avatar
waltervl
Posts: 6676
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: runIn function dzVents

Post by waltervl »

Perhaps check zigbee2MQTT settings: https://community.home-assistant.io/t/u ... /821709/12
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest