Smart routing of sonos_say script

Awesome… will check out shortly

I’m confused on the “Set Text To Say” change node. You do a “set” to a global variable, but how do you populate the “to” field? In your example, it’s hardcoded to “Whatever You Want To Announce” and I’m not sure how to populate that field with another value.

Well, the basis of my flow was from a “person left/entered a zone” announcement so when I determine that I have a switch leading to different change nodes, one for each announcement to be made, e.g. “This person has left school” or “This person has entered home”. Then I can feed all those change nodes back into the rest of the flow that does the announcing so the TTS node just recalls the global variable (which technically could just be a flow variable, to be honest).

So for the flow I gave you the JSON for above, just edit the change node and edit this to whatever you want the TTS to say:

Your other option is to open the TTS Service node and edit the Data to:

{"message":"Whatever you want to say"}

here is a pic of that

Thanks for the clarification. I understand now and it works like a charm.

WOW! Fantastic flow, thanks ALOT!

Thanks a lot for you flow and sorry for diggin this out…

What if all players are paused? Nothing happens then :frowning: Am I missing something?

Wondering if anyone is still using the flow from @strangedesign13, I’ve been using it for months without issue. However I’m now getting the following error:

"Call-service API error. Error Message: must contain at least one of entity_id, area_id."

The error is coming from ‘Snapshot Sonos’, both the example and my copy does not have an entity_id specified and till recently it didn’t seem to matter or through an error.

Curious if anyone else has seen/fixed this?

That changed in the 0.93 release when the sonos domain was created. All services now require a entity_id.

You can read more here: https://www.home-assistant.io/blog/posts/4#sonos

Thank you for that, I’ve added ‘all’ for the entity_id and it’s working again!

It seems, the flow only works, if the Sonos player is in mode “playing”. If all Sonos speakers are paused, nothing happens!? Do I miss something?