Virtual switch to control Sonos station/Nest temp up or down?

Ok, I jumped on the Alexa (Amazon Echo) bandwagon and love it. Immediately replaced my minimote. What I cant figure out, but someone must have, is how to construct virtual switched tied to the following things that would allow Alexa to control them without some involved ASK/server action which I’m not capable of constructing.

Select / change:

  • Sonos Pandora station, even if its a separate request from turning it on and I have to make a switch for each station by name
    • Turn Nest temp up or down, even if I have to make one switch for up and one for down
    • Select a color for Hue bulb, even if I have to preselect what constitutes blue or red and name each of them

I searched the Community but couldn’t find anything I thought was relevant. I’m sure someone has done it.

wow, no ideas? really? @JDRoberts ? @tgauchat ?

The first thought is see which of these tasks can be done with a Routine, that way you don’t need a custom SmartApp, but rather use any virtual switch that is a Routine trigger.

Other than that, a Custom SmartApp(s) are trivial for these scenarios if the Device Type for Sonos, Nest, Hue have Commands available (though Hue is most complex because it requires defining the colors somewhere as opposed to just “up/down” for Nest, for example).

Alexa also uses “on/off” … so momentaries are a bit of an anomaly. Then again, this is an advantage, perhaps, as you could try “on = up”, “off = down” (or on = next station, off = previous station…).

Nest: In looking at options for routine, I could see creating a routine that changes the nest set point to a particular temp, which may be the only option, but I was hoping to be able to ‘nudge’ it by 1 degree, etc. I’d want a switch that when I turn it ‘on’ with Alexa it increases the temp setpoint by 1 degree (I’m thinking for the heater.)

Sonos score!: I was thinking about Sonos and digging around. I set up a virtual switch through the IDE, then linked it through Sonos Mood Music App to a specific Pandora playlist. That works! Love it. One down

Hue: still cant figure out how to link a specific color to a switch

There’s a SmartApp that does this for an Aeon Minimote. That would probably be the baseline I’d suggest; replacing the awkward Minimote subscriptions with Virtual Momentary or maybe Virtual Switch(on).

There are a couple of topics where people are working on nest controls. I would just look at those. Check the project category.

As far as Sonos, there’s a topic for that as well. :sunglasses:

I don’t have it either those devices so I can’t do much more than point you to those topics.

I’m physically really exhausted right now, in large part because of dealing with the poltergeists. I had to call my neighbor to come over to take the batteries out of the motion sensor to see if we can get the touchless switch working again. So I’m not doing a lot of LMGTFY right now.

1 Like

Well tis the season for ghosts…

I may need to wait on the other stuff as I can cut and paste code but not write it, and certainly not do any of the server stuff referenced in the links you sent (which I had already looked at btw). Is it ironic that I had to google LMGTFY?

1 Like

Tasmin you were able to get Alexa to skip track, switch station etc on sonos without that complicated post from above?

No, it cant do any of the native functions, which I would expect of an Echo/ST “authorized integration” but I could assign Pandora Stations I’ve made on my Sonos to individual virtual switches that Alexa can turn on. Which mostly solves my dilemma of wanting to switch the station while covered in pasta sauce etc making dinner.

Create a virtual switch (momentary button tile) and then use the Smartapp “Mood Music” to link it to a Pandora station you have already created.

Would love to be able to control the volume, but no idea how to make a switch to raise it or lower it.

Hi Tasmin,

I tried setting up Sonos Mood Music and got to “Play this Track” but when I select it, it is empty.

I feel like I’m missing a step. Can you help me out?

Thanks in advance.

The trick is you have to go into your Sonos app first and start playing the station you want. Then move over to set up the SmartApp and it will see it. Must do them sequentially to set them up


That did it!

Thank you!

I’m almost there but I must be missing a step.

I can activate the switch in the ST App. which then plays my radio station as expected.

But when creating a group in Alexa the switch does not show, even after doing multiple Discover new devices.

Am I missing something?

You need to discover new devices so Alexa knows the new switch exists. In the SmartThings app open the smartapp for Alexa, add the switch to the list of switches that she can see, and then ask her “discover new devices”

1 Like

I did Discover new devices several times but the switches do not show in the Alexa app. Strange.

Here are some screenshots of what I have.

But Sonos does now show in the Alexa app even after I do “discover new devices”

So I’m not exactly sure how you set up yours, but let me explain mine. I have a device for Sonos, device type Sonos player that Alexa uses to only turn on and off the speaker.

I then have another device called “Chill Out Radio”, device type Momentary Button Tile that Alexa uses to start that radio station. It lists “In Use By”: “Chill Out Radio (Sonos Mood Music)” and “Amazon Echo”

Looks like the Sonos Device Sonos is not in use by Amazon Echo. You should have a device with momentary button tile “The Hog” for your station

If you open on your phone Smartapps> Amazon Echo, do you see your station “The Hog” listed. If not, use the + sign to add it here, then ask Alexa to discover new devices.

1 Like

That was the part I was missing!

Thank you again!

Nest update: A new option for Alexa in IFTTT was recently released allowing you to make your own word command after stating “Alexa trigger”. So my work around is to connect “Alexa trigger make my living room warmer” and set that to turn the living room nest to 71F.

I’d still rather be able to go up or down one degree instead, but that functionality isn’t available for Nest through IFTTT.

Note this only works when you are not in “Away” or “Auto Away.” I tested it out after working in the office (not near the living room) and got this IFTTT error: “Action skipped: Action skipped Nest error: Cannot set temperature range while Nest is set to away mode”