I have this seemingly fairly simple automation that i can’t get to run it’s actions. I tried while and until, both with on and off states for the group but it is not working. It’s triggering, but not announcing anything.
The flood group is definitely going to on or off, depending on the flood sensors being triggered. I do use a 433 sensor, but that shouldn’t matter. Might be few seconds to detect, but on is on, off is off one would think.
What have i missed here?
- id: '1642836191931'
alias: Water leak Announce In Progress
description: Announce water leak is in progress while the flood sensor group is
turned on
trigger:
- platform: state
entity_id: group.flood_sensors_group
to: 'on'
condition: []
action:
- repeat:
while:
- condition: state
entity_id: group.flood_sensors_group
state: 'on'
sequence:
- service: notify.alexa_media_everywhere
data:
message: Water Leak In Progress
data:
type: announce
method: all
mode: single
have you checked the trace of the automation within GUI?
Are you sure the loop is never executed?
I am asking this, because as far as I know, you cannot sent an announcement to the everywhere group via alexa_media …so it might be not the loop which is not execute but the service call
My workaround here to perform announcements via alexa was a “spoken command”:
- service: media_player.play_media
data_template:
entity_id: media_player.this_device
media_content_id: "kündige an, dass {{ text }}"
media_content_type: custom
Yes. So the service call was fine, what i did was add a 10-15 delay after the service call. I was thinking in this direction as well, as a debug would take a long time to load as it must have been stuck in a very tight loop.