Examples have quotes aroud the message. In the UI, I add the quotes… save the automation… but when I reopen it, the quotes are gone. do I need the quotes?
Can anyone see a problem as to why my speaker isn’t speaking?
You can use entity_id: all in an service call to target all relevant entities. In this case, it would make all media players say the message. I also don’t see an indentation problem (remember that OP is using the UI editor). But yes, if OP only wants to target a single speaker (which they indeed did say in the post), then the entity ID of that speaker is needed.
@Cralis check your logs for anything related to the automation when you manually trigger it. You could also post the automation code from automations.yaml, it’s possible the UI editor is doing something weird.
Ah good point, the UI editor probably doesn’t need data: for service data since it would add it already. That’s part of why I asked to see the YAML itself since I don’t use the UI editor
Thanks very much, guys! I’m going to remove the ‘data:’, and make sure my indentation is right. I wasn’t aware that whitespace was actually a think in yaml. Thanks for the headsup!
And sorry, initially I intended to target one speaker (I till do) but when posting the code, it was at the stage I was hunting for example, and came across ‘all’. I’ll change it back to the speaker in the room with the light. I also want to switch on 2 lights. Would IO just do two actions? Or can I switch on more than one in a single action?
I’ll try this:
message: The sun has set. Switching on the lounge light
entity_id: media_player.living_room_speaker