alias: New automation
description: ""
triggers:
- trigger: state
entity_id:
- media_player.speaker_1
- media_player.speaker_2
- media_player.speaker_3
- media_player.speaker_4
- media_player.speaker_5
to:
- unavailable
- unknown
- idle
conditions: []
actions:
- action: persistent_notification.create
metadata: {}
data:
message: >-
Entity {{ trigger.entity_id }} changed state to {{
trigger.to_state.state }}
mode: single
Please guide how can I make the above automation more generalised by not hard-coding the media_player names. My goal is to create a notification if any of the player i.e. media_player.speaker_1 to media_player.speaker_5 changes is state to idle, unknown or unavailable.
Message malformed: Entity {{ states.media_player | map(attribute=‘entity_id’) | list }} is neither a valid entity ID nor a valid UUID for dictionary value @ data[‘entity_id’]
Sorry it was a typo. My goal is to create a notification if any of the player i.e. media_player.speaker_1 to media_player.speaker_5 changes is state to idle, unknown or unavailable.