Hi guy, i have repeat loop until and i want to add to self stop after a number of time.
it just does the toggle one time, any idea why my script aint work?
i got this error while i try to put it in the actions bloc :
Message malformed: expected a dictionary for dictionary value @ data[‘actions’][0][‘variables’]
Use “repeat count”. The combination of the 5 second delay and 4 iterations provides you with a 20 second “self stop” (with less code than “repeat until”).
Hi, no I can’t, I want to use it in another script with a multiple condition in a until loop.
In fact, if the humidity of x >= 50% or if the automatization work for more than 2h that mean water is running out so I don’t want to use my switch by doing on and off cycle when I don’t have any more water.
I was testing the function on this script because I don’t want to wait 2h to know if it is working or not.
Here is the script maybe that can help you have an idea what to do for my exact situation.
It’s inadvisable to create an automation that spends a long time executing its actions.
If Home Assistant restarts while an automation is busy executing its actions, the automation is immediately terminated (any remaining actions are not executed)
For example, let’s say we have an automation that opens a valve, waits for time to pass (minutes or hours), then closes the valve. If the automation is terminated while it is busy (waiting for time to pass), the valve will be left open. On restart, Home Assistant doesn’t resume any automations that were terminated, so the valve remains open.
To ensure an automation is robust and able to handle failures in a safe manner, it should spend very little time executing its actions. Creating such a failure-resistant automation becomes more challenging because it must become more event-based (for example, detecting wherever Home Assistant is restarted) and rely on timer entities, which can be resumed after a restart, instead of delay statements within a repeat.
FWIW, I had created an automation to control my irrigation system and if took just one failure (and the valve was left open for several hours) to make me redesign it to be more fail-safe.
Thank you for the advice, but my humidifier has a self-cut when it empty… because it was a humidifier do(stop when it is empty…), what it doesn’t do it manage the absolute humidity. So i have done a template for this purpose based on my room temperature.
What i don’t want is, when my humidifier is off because it runs out of water, i don’t want my smart switch nonstop to toggle for no reason.
And because my humidifier always reaches my humidity in a certain time, i want it to self stop if it reaches the humidity or after a delay.