How to wait a bit after device creation?
Posted: Tuesday 15 February 2022 13:45
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!
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!