How to wait a bit after device creation?

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

Moderator: leecollings

Post Reply
Sarcas
Posts: 86
Joined: Wednesday 11 October 2017 8:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1ß
Location: Friesland
Contact:

How to wait a bit after device creation?

Post by Sarcas »

I’m working on a dzVents script that creates on/of devices from scenes found on my Hue bridge. I know the standard Hue plugin does something like that but it is a bit outdated in that aspect.

I’m not a real coder, so it is a lot of trial and error. So far the first parts work; the script creates on/of devices with the hue scene names if they do not exist yet, so I am sure the removal or changed name will be no problem.

I do have a problem with adding the on/of actions. Unfortunately I can’t add this at the moment of creation, so I have to create first, and then add actions. Problem is that Domoticz isn’t ready for that yet, it can’t find the new device, it is still doing its thing. On the next run of the script it is fine. So I need to somehow wait a bit until Domoticz is ready to accept the add-on-action api call. I am unsure how to proceed. Any suggestions?

Thanks!
--

Domoticz on rPi4 - RFXCOM RFXtrx433 USB - ZW090 Z-Stick Gen5 EU - IKEA Tradfri - Philips HUE - YouLess meter - SolarEdge
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest