Hi and thanks for the script. I use it every morning for an automation that asks in each room if i want to open the garage. Sometimes it stops after hitting the third echo device, sometimes it works for all of them… it’s really random and i did not figure it out. It stops because of timeout error. Do you know why? I tried to enable “Continue on timeout” but nothing changed.
I don’t know how to create a group of media players starting with group, mine starts with media_player:
sequence:
- alias: >-
Repeat the actionable notification on every speaker in the group until
there's a response or the group members end
repeat:
for_each: "{{expand(speakers_group)|map(attribute='entity_id') | list }}"
sequence:
- service: "{{service}}"
data:
text: "{{text}}"
event_id: "{{event_id}}"
alexa_device: "{{repeat.item}}"
enabled: true
- wait_for_trigger:
- platform: event
event_type: alexa_actionable_notification
event_data:
event_id: "{{event_id}}"
event_response_type: ResponseNone
timeout:
hours: 0
minutes: 0
seconds: 30
milliseconds: 0
continue_on_timeout: false
enabled: true
Here is also a trace of the running script:
{
"trace": {
"last_step": "sequence/0/repeat/sequence/1",
"run_id": "f55f3ce2756abd5e7194d6f095b8ad87",
"state": "stopped",
"script_execution": "aborted",
"timestamp": {
"start": "2024-03-05T06:30:00.261947+00:00",
"finish": "2024-03-05T06:31:04.656560+00:00"
},
"domain": "script",
"item_id": "multiple_alexa_actionable_notification",
"trace": {
"sequence/0": [
{
"path": "sequence/0",
"timestamp": "2024-03-05T06:30:00.269282+00:00",
"changed_variables": {
"this": {
"entity_id": "script.multiple_alexa_actionable_notification",
"state": "off",
"attributes": {
"last_triggered": "2024-03-04T06:50:39.509226+00:00",
"mode": "single",
"current": 0,
"friendly_name": "multiple_alexa_actionable_notification"
},
"last_changed": "2024-03-04T06:51:39.777010+00:00",
"last_updated": "2024-03-04T06:51:39.777010+00:00",
"context": {
"id": "01HR43PYW1PVSK3DA5SFJYQ0QF",
"parent_id": null,
"user_id": null
}
},
"text": "Sono le 7:30, apro il garage?",
"event_id": "alexa_garage_mattina",
"speakers_group": "media_player.all_home_alexa",
"service": "script.activate_alexa_actionable_notification",
"context": {
"id": "01HR6MW0ST8TRSVD7JTFYVT08H",
"parent_id": null,
"user_id": null
},
"repeat": {
"first": false,
"index": 3,
"last": false,
"item": "media_player.echo_bagno"
},
"wait": {
"remaining": 0,
"trigger": null
}
},
"error": "TimeoutError"
}
],
"sequence/0/repeat/sequence/0": [
{
"path": "sequence/0/repeat/sequence/0",
"timestamp": "2024-03-05T06:30:00.274345+00:00",
"child_id": {
"domain": "script",
"item_id": "activate_alexa_actionable_notification",
"run_id": "1cb7f01d88a5cac0bd1e27e5547febf1"
},
"changed_variables": {
"repeat": {
"first": true,
"index": 1,
"last": false,
"item": "media_player.echo_cameretta"
}
},
"result": {
"params": {
"domain": "script",
"service": "activate_alexa_actionable_notification",
"service_data": {
"text": "Sono le 7:30, apro il garage?",
"event_id": "alexa_garage_mattina",
"alexa_device": "media_player.echo_cameretta"
},
"target": {}
},
"running_script": true
}
},
{
"path": "sequence/0/repeat/sequence/0",
"timestamp": "2024-03-05T06:30:17.593786+00:00",
"child_id": {
"domain": "script",
"item_id": "activate_alexa_actionable_notification",
"run_id": "8d815c925f7bff5c6f62ba0d5d66e948"
},
"changed_variables": {
"repeat": {
"first": false,
"index": 2,
"last": false,
"item": "media_player.echo_soggiorno"
},
"wait": {
"remaining": 12.72329361597076,
"trigger": {
"id": "0",
"idx": "0",
"alias": null,
"platform": "event",
"event": {
"event_type": "alexa_actionable_notification",
"data": {
"event_id": "alexa_garage_mattina",
"event_response": "ResponseNone",
"event_response_type": "ResponseNone"
},
"origin": "REMOTE",
"time_fired": "2024-03-05T06:30:17.587024+00:00",
"context": {
"id": "01HR6MWHQJKHXGQ31719Q26HW2",
"parent_id": null,
"user_id": "f6062591ef294ac2a45b617348075650"
}
},
"description": "event 'alexa_actionable_notification'"
}
}
},
"result": {
"params": {
"domain": "script",
"service": "activate_alexa_actionable_notification",
"service_data": {
"text": "Sono le 7:30, apro il garage?",
"event_id": "alexa_garage_mattina",
"alexa_device": "media_player.echo_soggiorno"
},
"target": {}
},
"running_script": true
}
},
{
"path": "sequence/0/repeat/sequence/0",
"timestamp": "2024-03-05T06:30:34.575665+00:00",
"child_id": {
"domain": "script",
"item_id": "activate_alexa_actionable_notification",
"run_id": "b10bc4f9838f64e2046894fbc601c475"
},
"changed_variables": {
"repeat": {
"first": false,
"index": 3,
"last": false,
"item": "media_player.echo_bagno"
},
"wait": {
"remaining": 13.054631958017126,
"trigger": {
"id": "0",
"idx": "0",
"alias": null,
"platform": "event",
"event": {
"event_type": "alexa_actionable_notification",
"data": {
"event_id": "alexa_garage_mattina",
"event_response": "ResponseNone",
"event_response_type": "ResponseNone"
},
"origin": "REMOTE",
"time_fired": "2024-03-05T06:30:34.546636+00:00",
"context": {
"id": "01HR6MX29J8W21YDQKFR9FAV8K",
"parent_id": null,
"user_id": "f6062591ef294ac2a45b617348075650"
}
},
"description": "event 'alexa_actionable_notification'"
}
}
},
"result": {
"params": {
"domain": "script",
"service": "activate_alexa_actionable_notification",
"service_data": {
"text": "Sono le 7:30, apro il garage?",
"event_id": "alexa_garage_mattina",
"alexa_device": "media_player.echo_bagno"
},
"target": {}
},
"running_script": true
}
}
],
"sequence/0/repeat/sequence/1": [
{
"path": "sequence/0/repeat/sequence/1",
"timestamp": "2024-03-05T06:30:00.311923+00:00",
"changed_variables": {
"wait": {
"remaining": 12.72329361597076,
"trigger": {
"id": "0",
"idx": "0",
"alias": null,
"platform": "event",
"event": {
"event_type": "alexa_actionable_notification",
"data": {
"event_id": "alexa_garage_mattina",
"event_response": "ResponseNone",
"event_response_type": "ResponseNone"
},
"origin": "REMOTE",
"time_fired": "2024-03-05T06:30:17.587024+00:00",
"context": {
"id": "01HR6MWHQJKHXGQ31719Q26HW2",
"parent_id": null,
"user_id": "f6062591ef294ac2a45b617348075650"
}
},
"description": "event 'alexa_actionable_notification'"
}
}
},
"result": {
"wait": {
"remaining": 12.72329361597076,
"trigger": {
"id": "0",
"idx": "0",
"alias": null,
"platform": "event",
"event": {
"event_type": "alexa_actionable_notification",
"data": {
"event_id": "alexa_garage_mattina",
"event_response": "ResponseNone",
"event_response_type": "ResponseNone"
},
"origin": "REMOTE",
"time_fired": "2024-03-05T06:30:17.587024+00:00",
"context": {
"id": "01HR6MWHQJKHXGQ31719Q26HW2",
"parent_id": null,
"user_id": "f6062591ef294ac2a45b617348075650"
}
},
"description": "event 'alexa_actionable_notification'"
}
}
}
},
{
"path": "sequence/0/repeat/sequence/1",
"timestamp": "2024-03-05T06:30:17.624237+00:00",
"changed_variables": {
"wait": {
"remaining": 13.054631958017126,
"trigger": {
"id": "0",
"idx": "0",
"alias": null,
"platform": "event",
"event": {
"event_type": "alexa_actionable_notification",
"data": {
"event_id": "alexa_garage_mattina",
"event_response": "ResponseNone",
"event_response_type": "ResponseNone"
},
"origin": "REMOTE",
"time_fired": "2024-03-05T06:30:34.546636+00:00",
"context": {
"id": "01HR6MX29J8W21YDQKFR9FAV8K",
"parent_id": null,
"user_id": "f6062591ef294ac2a45b617348075650"
}
},
"description": "event 'alexa_actionable_notification'"
}
}
},
"result": {
"wait": {
"remaining": 13.054631958017126,
"trigger": {
"id": "0",
"idx": "0",
"alias": null,
"platform": "event",
"event": {
"event_type": "alexa_actionable_notification",
"data": {
"event_id": "alexa_garage_mattina",
"event_response": "ResponseNone",
"event_response_type": "ResponseNone"
},
"origin": "REMOTE",
"time_fired": "2024-03-05T06:30:34.546636+00:00",
"context": {
"id": "01HR6MX29J8W21YDQKFR9FAV8K",
"parent_id": null,
"user_id": "f6062591ef294ac2a45b617348075650"
}
},
"description": "event 'alexa_actionable_notification'"
}
}
}
},
{
"path": "sequence/0/repeat/sequence/1",
"timestamp": "2024-03-05T06:30:34.642253+00:00",
"changed_variables": {
"wait": {
"remaining": 0,
"trigger": null
}
},
"error": "TimeoutError",
"result": {
"wait": {
"remaining": 0,
"trigger": null
},
"timeout": true
}
}
]
},
"config": {
"sequence": [
{
"alias": "Repeat the actionable notification on every speaker in the group until there's a response or the group members end",
"repeat": {
"for_each": "{{expand(speakers_group)|map(attribute='entity_id') | list }}",
"sequence": [
{
"service": "{{service}}",
"data": {
"text": "{{text}}",
"event_id": "{{event_id}}",
"alexa_device": "{{repeat.item}}"
},
"enabled": true
},
{
"wait_for_trigger": [
{
"platform": "event",
"event_type": "alexa_actionable_notification",
"event_data": {
"event_id": "{{event_id}}",
"event_response_type": "ResponseNone"
}
}
],
"timeout": {
"hours": 0,
"minutes": 0,
"seconds": 30,
"milliseconds": 0
},
"continue_on_timeout": false,
"enabled": true
}
]
}
}
]
},
"blueprint_inputs": null,
"context": {
"id": "01HR6MW0ST8TRSVD7JTFYVT08H",
"parent_id": null,
"user_id": null
}
},
"logbookEntries": [
{
"when": 1709620200.262314,
"state": "on",
"entity_id": "script.multiple_alexa_actionable_notification"
},
{
"name": "activate_alexa_actionable_notification",
"message": "started",
"entity_id": "script.activate_alexa_actionable_notification",
"context_id": "01HR6MW0ST8TRSVD7JTFYVT08H",
"when": 1709620200.279609,
"domain": "script",
"context_state": "on",
"context_entity_id": "script.multiple_alexa_actionable_notification"
},
{
"when": 1709620200.280045,
"state": "on",
"entity_id": "script.activate_alexa_actionable_notification",
"context_state": "on",
"context_entity_id": "script.multiple_alexa_actionable_notification"
},
{
"when": 1709620200.297533,
"state": "{\"text\": \"Sono le 7:30, apro il garage?\", \"event\": \"alexa_garage_mattina\"}",
"entity_id": "input_text.alexa_actionable_notification",
"context_state": "on",
"context_entity_id": "script.multiple_alexa_actionable_notification"
},
{
"when": 1709620200.310114,
"state": "off",
"entity_id": "script.activate_alexa_actionable_notification",
"context_state": "on",
"context_entity_id": "script.multiple_alexa_actionable_notification"
},
{
"name": "activate_alexa_actionable_notification",
"message": "started",
"entity_id": "script.activate_alexa_actionable_notification",
"context_id": "01HR6MW0ST8TRSVD7JTFYVT08H",
"when": 1709620217.598736,
"domain": "script",
"context_state": "on",
"context_entity_id": "script.multiple_alexa_actionable_notification"
},
{
"when": 1709620217.599196,
"state": "on",
"entity_id": "script.activate_alexa_actionable_notification",
"context_state": "on",
"context_entity_id": "script.multiple_alexa_actionable_notification"
},
{
"when": 1709620217.622849,
"state": "off",
"entity_id": "script.activate_alexa_actionable_notification",
"context_state": "on",
"context_entity_id": "script.multiple_alexa_actionable_notification"
},
{
"name": "activate_alexa_actionable_notification",
"message": "started",
"entity_id": "script.activate_alexa_actionable_notification",
"context_id": "01HR6MW0ST8TRSVD7JTFYVT08H",
"when": 1709620234.583457,
"domain": "script",
"context_state": "on",
"context_entity_id": "script.multiple_alexa_actionable_notification"
},
{
"when": 1709620234.58393,
"state": "on",
"entity_id": "script.activate_alexa_actionable_notification",
"context_state": "on",
"context_entity_id": "script.multiple_alexa_actionable_notification"
},
{
"when": 1709620234.620691,
"state": "off",
"entity_id": "script.activate_alexa_actionable_notification",
"context_state": "on",
"context_entity_id": "script.multiple_alexa_actionable_notification"
}
]
}