Sonos Automation via physical switch

Hi!

I am looking for a home automation system quiet some time now and hubitat seems perfect.
Maybe you could help me with the following question.

Is it possible to:

When a wall mounted switch is pressed the smart power outlet turns on + Sonos will play my favorite radio station on TuneIn. Maybe it is stupid simple but I am a newbie :slight_smile:

Thank you very much
Greetings from Austria (europe) . (sorry for my bad english)
Stefan

I so almost exactly that.. except I use a button :slight_smile:

So yes, it’s perfectly possible to do that!

Andy

Absolutely. There are a couple of posts showing how to use the API (including how to install it) to have Sonos play alerts, favorite stations and even search for a specific artist or song. I'll post up the links later, but if you search for "Sonos" you should find some great info.

1 Like

Hehehe..
I wrote an app to use ‘echo speaks’ to do it for me

1 Like

To add to what @homeauto2112 said, the starting point would be to install jishi's node-sonos-http-api.

It opens up all sorts of possibilities when used with RM or @ogiewon's http-momentary-switch for Hubitat.

I have BBC News setup as a favorite on my Sonos, and therefore it shows up as a favorite on node-sonos-http-api. I created a virtual switch on HE called "Sonos-BBC" that is an http-momentary-switch that plays this favorite. "Sonos-BBC" is triggered as part of my Wake Up rule.

4 Likes

Just wanted to say Thank you for posting this example.
I'm using this to group (join) and ungroup (leave) zones when I talk to Alexa (Alexa, play music outside --> Alexa, stop music outside), and it works flawlessly now!

1 Like