I have a water leak sensor setup to inform me over my speakers if moisture is detected. I would like to have that automation run until the sensor doesn’t sense anymore moisure. I have tried the repeat option in the “building block” option,but I must be missing something. Help is appreciated.
Please share the automation you tried so we can see what is going on.
One common issue in this kind of automation is users neglecting to add a delay in the repeat sequence.
You may also want to take a look a the Alert integration and Alert2 custom integration.
Agree, seeing your code / more precisely what you’re trying to accomplish would be helpful.
I personally use a handful of different kinds of loops in automations, here’s a repeat until loop: Script Syntax - Home Assistant
As drew mentioned, using a delay in the actions section of the loops is helpful.
Trigger: Moisture detected sensor (MDS) == ON
Action:
Repeat Until MDS == OFF
- Notify/Announcement
- Delay for xx time (ie. 1 minute)
This kind of structure will trigger when MDS == ON, then notify/make announcement, then WAIT for xx time and then repeat. It will repeat this loop UNTIL MDS == OFF
Realize this is theoretical, so actual sensors / code could help us give a more exacting solution.
Ill check out alert2