I paste the code of my automation. It works. I only wish that the message I read to my minigoogle of the house was continuous. I would like this message to occur every 20 seconds until I deactivate it or until the sensor has resumed its initial state.
Can someone help me write the missing part ??
ok. Thank you for your answer. I just want to clarify:
the code I’ve pasted is ok. It works. I have no problems on that piece of code I’ve pasted.
I just want to know what to use to be able to repeat the message indefinitely or until the initial conditions return to the initial state.
Hello
unfortunately this function you suggested does not work for me.
Can you give me an example of how to recall the loop from a script as you suggested above?
how the script should be composed, can you do an example? grzie
This script will wait 15 seconds (change it if you want it to wait a different amount of time), then if the binary_sensor is still on it will re-trigger the automation. Once the binary_sensor changes to off the script will stop re-triggering the automation.
A slightly different way would be to use two scripts. You’d change the automation action to call the first script instead of calling tts.google_say. Then the first script would do that, then call the second script. The second script would be the same as the script shown above.