Sample Vera Echo Bridge Voice Commands for Sonos, thermostat Temperature, etc

Since the Amazon Echo Bridge threads are so big, thought that I would make a new thread with this topic.

First create a new device with the name “Thermostat” in whatever Echo Hue bridge you are using. I’m using Crush’s version form this thread:
http://forum.micasaverde.com/index.php/topic,31920.0.html

OnURL:
http://192.168.X.XXX:3480/data_request?id=action&output_format=json&serviceId=urn:upnp-org:serviceId:TemperatureSetpoint1_Cool&action=SetCurrentSetpoint&DeviceNum=60&NewCurrentSetpoint=${intensity.percent}

  1. Replace Xs with your Vera IP
  2. Replace “60” with Vera Device ID of your Thermostat
    (FYI, This is setting the temp for the AC. I figure i will change it up winter to set the temp for the Heat).

OffURL:
http://192.168.X.XXX:3480/data_request?id=action&output_format=json&serviceId=urn:upnp-org:serviceId:HVAC_UserOperatingMode1&action=SetModeTarget&DeviceNum=60&NewModeTarget=Off

  1. Replace Xs with your Vera IP
  2. Replace “60” with Vera Device ID of your Thermostat

Tell Alexa to rediscover your devices.

Now…Try the command out by saying “Alexa, set the thermostat to 76”. 8)

You’ll need to have your Air Conditioner already on for this to work. I have another Device Named Air Conditioner that I use to tell Echo to turn on. This what just sets the thermostat to a predetermined number.

I’ll be using this thread to post snippets of the devices I add to the Echo Vera Bridge.

Please feel free to add any devices/code snippets that you think are useful.

I just figured out the Sonos commands.

OnURL to play
http://192.168.X.XXX:3480/data_request?id=action&output_format=json&serviceId=urn:micasaverde-com:serviceId:Sonos1&action=PlayURI&DeviceNum=100&URIToPlay=SR:siriushits1&Volume=35

  1. Replace Xs with your Vera IP
  2. Replace “100” with Vera Device ID of your Sonos Device
  3. Replace “SR:siriushits” with the PlayURI that you want. To figure it out for any device. Just place what you want, then go to the device, advanced tab and look at the CurrentTrackURI. That’s what you’ll need.

From the looks of any device can be controlled. You can look in the Advance tab of the LUA code and see what is available. You just need to change the service, action, device ID, and pass the correct parameters.

Just test in a browser first and you should get “OK” responses from your Vera. Becareful of spaces as the browser will translate that to %20 and the Vera doesn’t recognize this as a space and will throw an error not executing the action.

I’ve found a quick and easy way to get the PlayURI is to just open up a browser to http://192.168.X.XXX/cgi-bin/cmh/log.sh?Device=LuaUPnP to view the log file in real time.
Then go to the Sonos Device and select the station you want. You should see the plugin send a command to the device describing the parameters.

An easy way to get the PlayURI for any of your Sonos favorites is to go to the Device properties find “Favorites” and copy the contents out to a text editor to view. Each entry in front of the “@” is what you need to put in the PlayURI. For example, one of mine is FV:2/31.

Here is how the On URL looks:
http://192.168.X.XXX:3480/data_request?id=action&output_format=json&serviceId=urn:micasaverde-com:serviceId:Sonos1&action=PlayURI&DeviceNum=100&URIToPlay=ID:FV:2/31&Volume=30

That’s simpler then creating a scene for each one. Just to verify the sonos, volume, and playlist are hardcoded?

Great thread!

You’d still have to create a device for each zone, but at least it’s less scene creation in Vera. I assume you name each something like "Sonos kitchen " and then what echo command do you use? “Alexa, turn Sonos kitchen on” ?

What I really want is volume and transport controls.

Yes, you have to hardcode those. Last night I went through my favorites and created commands for the main ones I use. So now I say Alexa turn on “Sirius XM Coffee House”…etc

I used the links from my favorites because it was faster and easier, but that is a little riskier because you favorites could change. It would stop working if the station is removed form you favorites. The best is to put the “SR:” link like I did below with Hits 1 and the Beat.

Sirius XM Fly - added
http://192.168.1.XXX:3480/data_request?id=action&output_format=json&serviceId=urn:micasaverde-com:serviceId:Sonos1&action=PlayURI&DeviceNum=100&URIToPlay=ID:FV:2/29&Volume=30

Sirius Xml Silk - added
http://192.168.1.XXX:3480/data_request?id=action&output_format=json&serviceId=urn:micasaverde-com:serviceId:Sonos1&action=PlayURI&DeviceNum=100&URIToPlay=ID:FV:2/28&Volume=30

Sirius XM Hits 1 - Added
http://192.168.1.XXX:3480/data_request?id=action&output_format=json&serviceId=urn:micasaverde-com:serviceId:Sonos1&action=PlayURI&DeviceNum=100&URIToPlay=SR:siriushits1&Volume=30

Sirius XM Coffee House - Added
http://192.168.1.XXX:3480/data_request?id=action&output_format=json&serviceId=urn:micasaverde-com:serviceId:Sonos1&action=PlayURI&DeviceNum=100&URIToPlay=ID:FV:2/2&Volume=30

Sirius XM the Beat - Added
http://192.168.1.XXX:3480/data_request?id=action&output_format=json&serviceId=urn:micasaverde-com:serviceId:Sonos1&action=PlayURI&DeviceNum=100&URIToPlay=SR:thebeat&Volume=30

Sirius XM Pop 2K - Added
http://192.168.1.XX:3480/data_request?id=action&output_format=json&serviceId=urn:micasaverde-com:serviceId:Sonos1&action=PlayURI&DeviceNum=100&URIToPlay=ID:FV:2/31&Volume=30

You could theorhetically set the volume, if you created a new device called Sirius Volume, but the danger is that from what I can tell if the dimple device is turned on and you don’t specify a value, it will set it at 100%. I wouldn’t want to say “Alexa turn on the Sonos Volume” and have it get maxed out and mess up the speaker. Or if you do specify the value and she doesn’t hear that you did and sets it to 100 anyway.

Great thread!

You’d still have to create a device for each zone, but at least it’s less scene creation in Vera. I assume you name each something like "Sonos kitchen " and then what echo command do you use? “Alexa, turn Sonos kitchen on” ?

What I really want is volume and transport controls.[/quote]

The Main speaker that I used the most I just called “Sonos”

But yes, I have named the others ones “Bedroom Sonos” and “Bathroom Sonos”. I also set up scenes to do grouping so I have “Alexa turn on Group Bedroom”…etc

I tried to set this up to work with Nest…no go. What thermostat does this work with?

This works with Z-Wave thermostats. The nest is connected to the Vera though a plugin and is probably IP controlled. I’m not sure if you are able to pass a value to it via a URL call. You might want to do some research in the plugin section. If you are able to send commands to the Nest through web browser than you’ll be able to put that call in the OnURL.

Created a cheat sheet for the wife and guests that come over.

Nice… had same idea until we have them memorized.

Yes, you have to hardcode those. Last night I went through my favorites and created commands for the main ones I use. So now I say Alexa turn on “Sirius XM Coffee House”…etc

I used the links from my favorites because it was faster and easier, but that is a little riskier because you favorites could change. It would stop working if the station is removed form you favorites. The best is to put the “SR:” link like I did below with Hits 1 and the Beat.

Sirius XM Fly - added
http://192.168.1.XXX:3480/data_request?id=action&output_format=json&serviceId=urn:micasaverde-com:serviceId:Sonos1&action=PlayURI&DeviceNum=100&URIToPlay=ID:FV:2/29&Volume=30

Sirius Xml Silk - added
http://192.168.1.XXX:3480/data_request?id=action&output_format=json&serviceId=urn:micasaverde-com:serviceId:Sonos1&action=PlayURI&DeviceNum=100&URIToPlay=ID:FV:2/28&Volume=30

Sirius XM Hits 1 - Added
http://192.168.1.XXX:3480/data_request?id=action&output_format=json&serviceId=urn:micasaverde-com:serviceId:Sonos1&action=PlayURI&DeviceNum=100&URIToPlay=SR:siriushits1&Volume=30

Sirius XM Coffee House - Added
http://192.168.1.XXX:3480/data_request?id=action&output_format=json&serviceId=urn:micasaverde-com:serviceId:Sonos1&action=PlayURI&DeviceNum=100&URIToPlay=ID:FV:2/2&Volume=30

Sirius XM the Beat - Added
http://192.168.1.XXX:3480/data_request?id=action&output_format=json&serviceId=urn:micasaverde-com:serviceId:Sonos1&action=PlayURI&DeviceNum=100&URIToPlay=SR:thebeat&Volume=30

Sirius XM Pop 2K - Added
http://192.168.1.XX:3480/data_request?id=action&output_format=json&serviceId=urn:micasaverde-com:serviceId:Sonos1&action=PlayURI&DeviceNum=100&URIToPlay=ID:FV:2/31&Volume=30

You could theorhetically set the volume, if you created a new device called Sirius Volume, but the danger is that from what I can tell if the dimple device is turned on and you don’t specify a value, it will set it at 100%. I wouldn’t want to say “Alexa turn on the Sonos Volume” and have it get maxed out and mess up the speaker. Or if you do specify the value and she doesn’t hear that you did and sets it to 100 anyway.[/quote]

Found out Alexa will respond even if I say only the station name. For example, even though my Bridge Device name is “Sirius XM Fly”. If I just say “Alexa, turn on Fly” she is smart enough to figure it out. Makes it even easier to say the station names. 8)

This works with Z-Wave thermostats. The nest is connected to the Vera though a plugin and is probably IP controlled. I’m not sure if you are able to pass a value to it via a URL call. You might want to do some research in the plugin section. If you are able to send commands to the Nest through web browser than you’ll be able to put that call in the OnURL.[/quote]
I have the thermostat “dim” features working great with nest. I am loving it. Spent the whole day changing the set temperature Thanks for the tips. I should mention I am using the excellent watou version of nest integration (I am running a dsc alarm and the wwn version doesn’t play nice with others)

Thinking aloud about this while at work. Does (or is there a way) Echo understand the difference between “open/close” similar to “on/off”.

I hate saying “alexa, turn on my small garage door” :slight_smile:

I just said “Alexa, close the garage door” and she said “I added close the garage door to your to do list.”

The “Turn On” and “turn off” keywords are one of Alexa’s skills. The Keyword/skill for “Open” and “close” would need to be added.

I’ve learned from trial and error that there are certain keywords that seem to be reserved. For example it seems I can’t use any device names that contain the word “volume”.

[quote=“kenray536, post:14, topic:188597”]I just said “Alexa, close the garage door” and she said “I added close the garage door to your to do list.”

The “Turn On” and “turn off” keywords are one of Alexa’s skills. The Keyword/skill for “Open” and “close” would need to be added.

I’ve learned from trial and error that there are certain keywords that seem to be reserved. For example it seems I can’t use any device names that contain the word “volume”.[/quote]

Yep. Volume should already work with the existing Pandora app, etc.

How do you use the “dim” feature with Aleksa using the Nest plugin you outlined please?

Could you recommend a hue bridge.

I do have the native Nest plugin on my Vera and can control it with HA apps or the Vera web console…I can create scenes that change the temperature…I’m more than likely doing something wrong, I’ll keep messing with it.

Could you recommend a hue bridge.[/quote]

This can’t be run on a standard philips hue bridge. You’ll need to setup a computer to run a server program which emulates a Hue bridge. The Hue bridge you are running will then be connected to the Amazon Echo which will then allow you to use voice commands to control devices and scenes on your Vera.

There is a lot of info in this thread. Let me know if you have any questions.
http://forum.micasaverde.com/index.php/topic,31920.0.html

There are multiple versions in that thread but I run crush’s version on a raspberry pi 2. Works great and I have been able to have 43 devices. When I was running the first version by Arm, I ran into a device limit of 28. If you have a spare server running you can run it on anything that can run Java 8.

This works with Z-Wave thermostats. The nest is connected to the Vera though a plugin and is probably IP controlled. I’m not sure if you are able to pass a value to it via a URL call. You might want to do some research in the plugin section. If you are able to send commands to the Nest through web browser than you’ll be able to put that call in the OnURL.[/quote]

I was able to get this thing going fairly well with a Nest and the Nest Plugin(Vera 3/UI5). The trick is to put in the correct device ID. The one that worked for me was the Temperature Control device. The others are Nest, Home/Away and Humidity. I used the On/Off URL posted earlier and they work like a charm.