So I couldn’t get this to work, probably because I edit automations and scripts in the UI rather than use yaml and the UI always screwed it up.
So I used some of the code from this post and found a solution that is simpler for me and is UI based. In case anyone wants to also use the UI here is how I set it up:
- Create a new script in the UI.
- Give it a name
- choose Mode “restart”
- In sequence choose “repeat”
- as typ choose “while”
- as while condition choose “template”
- enter this as template value and replace YOUR_DEVICE:
{{ states('sensor.YOUR_DEVICE_next_timer') not in ['None', 'unknown', 'unavailable'] and as_timestamp(states('sensor.YOUR_DEVICE_next_timer')) < as_timestamp(now()) }}
- as action add “call service”
- as service choose “notify.alexa_media”
- as service data enter this replacing your alexa devices to announce the end of the timer:
target:
- media_player.DEVICE1
- media_player.DEVICE2
data:
type: announce
message: The Timer in the kitchen is up!
- add another action and choose type “delay”
- enter the value you want the announcement to repeat. I chose 10 seconds
- save the script and remeber the name for the automation
-
Go to Blueprints and import the Automation blueprint “Do something when Alexa timer expired” by entering this address:
Do something when Alexa Timer has expired -
Once blueprint is imported create a new automation from it:
- As Alexa Device chose your “sensor.YOUR_DEVICE_next_timer”
- as action do “Call Service” and in service chose your script from step one.
That’s it. The announcement will now be repeated until the timer is cancled.
And in case people don’t know this yet: You can start and cancel Alexa Timers from other Alexas. So say you have this set up to announce a timer from the kitchen. You are in the living room and want to set up or cancle a timer that’s announced everywhere you can just say: “Alexa, start a 1 minute timer on Kitchen” or “Alexa stop the timer in the kitchen”
Hope this helps some people