We have moved at community.getvera.com

Author Topic: Sample Vera Echo Bridge Voice Commands for Sonos, thermostat Temperature, etc  (Read 18368 times)

Offline Gklmdawson

  • Full Member
  • ***
  • Posts: 111
  • Karma: +4/-0
Re: Sample Vera Echo Bridge Voice Commands for Sonos, thermostat Temperature, etc
« Reply #30 on: September 05, 2015, 01:38:36 am »
I do it the hard way, in the summer I have it programmed to cool. Probably not going to run the heat when Its 100 outside. When it's time to switch to heat I update the settings to change the heat set point instead of the cool set point.  Switching over every 6 months or so is simplest for me.

Offline kenray536

  • Full Member
  • ***
  • Posts: 119
  • Karma: +1/-2
Re: Sample Vera Echo Bridge Voice Commands for Sonos, thermostat Temperature, etc
« Reply #31 on: September 14, 2015, 02:35:56 pm »
I ended up adding a "Cooler" command to my Echo. This command just takes the current temperature and lowers in by 2 degrees. This sets the coolsetpoint for the Air conditioner.

local setpoint = luup.variable_get("urn:upnp-org:serviceId:TemperatureSetpoint1_Cool", "CurrentSetpoint", 60)
local new_temp_set = setpoint - 2
luup.call_action("urn:upnp-org:serviceId:TemperatureSetpoint1_Cool", "SetCurrentSetpoint", {NewCurrentSetpoint = new_temp_set}, 60)

-- Replace "60" with the device ID of your thermostat in the 1st and 3rd lines.
Vera 3 1.5.677 - DSC Envisalink 3 - Wemo - Philips Hue - Harmony - Wink Hub - Sonos - Echo Vera Bridge - HomeKit Bridge - GE - AEON Labs - Evolve - Leviton - Schlage - Honeywell - Ring Doorbell - Eagle Rainforest Bidgely

Offline integlikewhoa

  • Master Member
  • *******
  • Posts: 5630
  • Karma: +158/-382
Re: Sample Vera Echo Bridge Voice Commands for Sonos, thermostat Temperature, etc
« Reply #32 on: September 14, 2015, 03:18:15 pm »
I do it the hard way, in the summer I have it programmed to cool. Probably not going to run the heat when Its 100 outside. When it's time to switch to heat I update the settings to change the heat set point instead of the cool set point.  Switching over every 6 months or so is simplest for me.

I say the same thing here in California or in my Vacation house in Arizona. When it's summer its hot and I never heat both or HEAT during that time. Not only that lets say at night outside does drop below my 74 degree setup and hits 70 or 65 outside during the lowest in the night. My house doesn't instantly drop that low either. It still stay warm enough inside that I don't have to switch to heat to bring it back up to 74.

Offline bangis

  • Newbie
  • *
  • Posts: 17
  • Karma: +1/-0
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.

Thanks for opening up another thread. Just a quick question - what's the OffURL to play? I can successfully turn the sonos on, but can't get it to stop?

Offline Spudz72

  • Full Member
  • ***
  • Posts: 103
  • Karma: +0/-0
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.

Sorry to revive this old thread but I don't have a nest thermostat but have a working Z-Wave thermostat on my Veralite and I am using Crush's Bridge which is working great for my lights but wanted to get my thermostat to control from Alexa but so far it is not working.  My Z-Wave Thermostat is Device #3 on my Vera.  I used the commands below but when I tell Alexa to set my Thermostat to 20 it says the device is not responding?  It is Winter here so I am in Heat mode and celcious. 

ON Command

http://192.168.0.190:3480/data_request?id=action&output_format=json&serviceId=urn:upnp-org:serviceId:TemperatureSetpoint1_Heat&action=SetCurrentSetpoint&DeviceNum=3&NewCurrentSetpoint=${intensity.percent}

OFF Command

http://192.168.0.190:3480/data_request?id=action&output_format=json&serviceId=urn:upnp-org:serviceId:HVAC_UserOperatingMode1&action=SetModeTarget&DeviceNum=3&NewModeTarget=Off

Does anyone have any idea what is wrong?  Is this the current way to get a non-nest standard z-wave thermostat to work with Alexa?

Offline davemedlin

  • Sr. Newbie
  • *
  • Posts: 28
  • Karma: +0/-0
I ended up adding a "Cooler" command to my Echo. This command just takes the current temperature and lowers in by 2 degrees. This sets the coolsetpoint for the Air conditioner.

local setpoint = luup.variable_get("urn:upnp-org:serviceId:TemperatureSetpoint1_Cool", "CurrentSetpoint", 60)
local new_temp_set = setpoint - 2
luup.call_action("urn:upnp-org:serviceId:TemperatureSetpoint1_Cool", "SetCurrentSetpoint", {NewCurrentSetpoint = new_temp_set}, 60)

-- Replace "60" with the device ID of your thermostat in the 1st and 3rd lines.

Hi, I used the info from your other message to create an Echo Thermostat item in order to be able to just tell Alexa to set my thermostat to a particular degree and it works great. Thanks! I'd also like to setup this cooler item as well but can't get it to work. I guess it's because I'm not sure how to enter the info above. I assumed this was just creating a bridge device called cooler and adding that code to the ON section, then telling Alexa to "Turn on Cooler". Probably where I'm going wrong. Don't know if this is supposed to be a switch, script, etc. Can you help? Thanks again!!

Offline davemedlin

  • Sr. Newbie
  • *
  • Posts: 28
  • Karma: +0/-0
I ended up adding a "Cooler" command to my Echo. This command just takes the current temperature and lowers in by 2 degrees. This sets the coolsetpoint for the Air conditioner.

local setpoint = luup.variable_get("urn:upnp-org:serviceId:TemperatureSetpoint1_Cool", "CurrentSetpoint", 60)
local new_temp_set = setpoint - 2
luup.call_action("urn:upnp-org:serviceId:TemperatureSetpoint1_Cool", "SetCurrentSetpoint", {NewCurrentSetpoint = new_temp_set}, 60)

-- Replace "60" with the device ID of your thermostat in the 1st and 3rd lines.

Hi, I used the info from your other message to create an Echo Thermostat item in order to be able to just tell Alexa to set my thermostat to a particular degree and it works great. Thanks! I'd also like to setup this cooler item as well but can't get it to work. I guess it's because I'm not sure how to enter the info above. I assumed this was just creating a bridge device called cooler and adding that code to the ON section, then telling Alexa to "Turn on Cooler". Probably where I'm going wrong. Don't know if this is supposed to be a switch, script, etc. Can you help? Thanks again!!

Okay, think I figured this out, this is Luup code so just created a scene and have Alexa call the scene.

Offline michaelhinchey

  • Full Member
  • ***
  • Posts: 147
  • Karma: +2/-2
Hello,  This is way easier than going through the entire ha bridge thread and I couldn't find anything about thermostats anyway, so thank you.\

My question is, I only have heat and I have a separate wall unit for air which I am not controlling as of yet with zwave.
    I have my heat set most times to auto.
So what function do I call.  IM a bit lost with the &action part
Do I call Auto&action (if there is such a thing)

http://192.168.x.x:3480:3480/data_request?id=action&output_format=json&serviceId=urn:upnp-org:serviceId:TemperatureSetpoint1_Heat&action=SetCurrentSetpoint&DeviceNum=30&NewCurrentSetpoint=${intensity.percent}
??

this is to turn it off right
http://192.168.X.XXX:3480/data_request?id=action&output_format=json&serviceId=urn:upnp-org:serviceId:HVAC_UserOperatingMode1&action=SetModeTarget&DeviceNum=(id)&NewModeTarget=Off

Any help would be great.

Offline TinCup

  • Jr. Member
  • **
  • Posts: 78
  • Karma: +2/-0
Here's some bridge code I use to control my Sonos. 

I've got some XM channels setup as favorites so I just use the station name as the bridge device, "XM 80s on 8", "XM Symphony Hall" etc, then tell Alexa to "Turn on Symphony Hall" or whatever station I want.

To turn on the particular station, I use:
 
    http://<vera ip>:3480/data_request?id=action&output_format=json&serviceId=urn:micasaverde-com:serviceId:Sonos1&action=PlayURI&DeviceNum=<device id>&URIToPlay=ID:FV:<x/xx>

You can get the Favorites ID out of the Advanced section of the Sonos device in Vera, look under the Favorites variable.


To turn off Sonos, I use:
 
    http://<vera ip>:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:MediaNavigation1&action=Stop&DeviceNum=<device id>


For volume control, I have the bridge device setup as a dimmer with the "on" setting turning the volume to a maximum of 75 so I don't blow out any speakers around the house (they are hardwired into the Sonos).

On my bridge, I have the device called "Speakers" since "Volume" is a internally reserved command for the Echo.  I just say "Alexa, turn speakers to 60" or whatever.

To turn on the speakers:

   http://<vera ip>:3480/data_request?id=action&DeviceNum=<device id>&serviceId=urn:upnp-org:serviceId:RenderingControl&action=SetVolume&DesiredVolume=75


To set the speaker volume:

   http://<vera ip>:3480/data_request?id=action&serviceId=urn:upnp-org:serviceId:RenderingControl&action=SetVolume&DesiredVolume=${intensity.percent}&DeviceNum=<device id>


To turn off the speakers (this does not stop the Sonos from playing, it just sets the volume to 0):

   http://<vera ip>:3480/data_request?id=action&serviceId=urn:upnp-org:serviceId:RenderingControl&action=SetVolume&DesiredVolume=0&DeviceNum=<device id>


Hope this helps someone down the line!

« Last Edit: December 19, 2016, 10:00:13 pm by cgray »
Vera 3 UI5 | Homewave | Amazon Echo | BWS HA Bridge | PLEG/PLTS | OpenSprinkler | AD2USB | GE/Jasco | Schlage BE469 | Kwikset 912 | ecobee3 | SONOS + TTS | Aeotec 4-in-1 | EcoLink | Everspring ST812 | Remotec ZFM-80 | Evolve LRM-AS/LFM-20 | Hikvision DS-2CD2332 Turret | Dahua IPC-HFW4300S Bullet