The automation has no trigger (so it’s effectively a non-functional automation) and it has a few syntax error where certain lines are not indented correctly.
Even if you fix the indentation errors, it won’t be functional until you provide a proper trigger. What do you want to happen in order for this automation to execute? Perhaps the condition you created is what you actually want as the trigger?
Thanks for the response. I haven’t put anything in it because I wanted to later activate this automation linking it with the iOS Shortcuts app with an automation there so that when I snooze or stop an alarm on my iPhone my SONOS speaker plays a specific playlist.
In the official documentation. Here are the docs for scripts:
You should familiarize yourself with it (and for Automations) even if you intend to compose scripts and automations using the UI-based editors (as suggested by m0wlheld).
When you use the UI-based editors, they allow you to switch from visual mode to YAML mode. It’s a good way to see the YAML that’s being generated when you use the UI-based form.
When saving what I add to the “call service media_player.media_play” via yaml it defaults back to the UI standard yaml, not saving the extra code… how do I add what media it should play?
I suggest reviewing the documentation for media_player. It explains how each one of its service calls works.
It’s easy to mix up those two service calls because they have nearly identical names. One is used to “un-pause” a paused player (that’s the one you mistakenly used) and the other is for selecting and playing media (that’s the one you wanted).