www.homeseer.com    
 

Go Back   HomeSeer Message Board > HomeSeer Products & Services > HomeSeer Software > HomeSeer Amazon Echo Connected Home API

HomeSeer Amazon Echo Connected Home API Discussions related to the Amazon Echo native support for connected home products

Reply
 
Thread Tools Display Modes
  #1  
Old January 4th, 2017, 04:28 PM
kenm kenm is offline
Seer Deluxe
 
Join Date: Jan 2001
Location: San Jose, CA
Posts: 497
Triggering Events with Virtual Devices

Here's a step-by-step on how to create a virtual device that can be recognized by the Alexa app and used to trigger events based on On or Off requests.

In theory the virtual device could also be set to dimmable and be used to control anything that takes a value between 0 and 100. (Like audio volume)


Creating a Virtual Device:

1. On the Top Menu, Click on View->Device Management

2. On the upper right of the page, Click on the green "+" button to create a new device.

3. Name the device in the pop-up window and click submit.

4. If you use it set a location2.

5. Set the location for your device.

6. Leave "Code" blank

7. Set Address to something meaningful but unique (i.e. virt-001)

8. Make sure all the options are unchecked except "Voice Command" which should be checked if you want to use this device with Alexa.

9. Click on the "Advanced" Tab and type "Virtual" in the field "Device Type (String)".

10. Click on the "Done" button at the bottom of the page to create the device.


Creating an Event that Triggers based on a device change:

1. On the Top Menu, Click on View->Events

2. Click on the "Show All" button on the upper-right of the page.

3. Click on the green "+" button next to "Event Groups" to create a new group.

4. In the pop-up windows name the group and click submit.

5. Click the green "+" button next to "Events" to create a mew evemt.

6. In the pop-up window type the name of the event and click submit to create the event.

7. Select something meaningful for "Type" or leave it blank.

8. Select If "A Device's Value is..." and under (Choose Another) Select "This device had it's value set to..."

9. Under (Select A Device) select the virtual device created above.

10. Under 'is set to' select "On" or "Off"

11. Make sure the condition is set to "THEN" and under (Choose an Action) Select the action you want.

12. I generally select "Run a Script or Script Command" since most of my actions are controlled by scripts. Click "Edit" to choose a script to run and fill in the sub or function as well as any script parameters needed.

Feel free to ask questions.

--Ken
Reply With Quote
  #2  
Old January 5th, 2017, 03:23 PM
billbingaman billbingaman is offline
Seer
 
Join Date: Dec 2013
Location: Iowa
Posts: 29
This is helpful. Do I need to set up new events if i already have events set up to operate the system?
Reply With Quote
  #3  
Old January 5th, 2017, 03:52 PM
kenm kenm is offline
Seer Deluxe
 
Join Date: Jan 2001
Location: San Jose, CA
Posts: 497
It depends on what you are using to trigger the events you already have setup. You may want to set up separate events for your virtual devices based on device value change of the virtual device and then just set the action to "Run Another Event" to run the events you already have setup. This will keep the actual event logic all in one place.
Reply With Quote
  #4  
Old January 5th, 2017, 04:35 PM
billbingaman billbingaman is offline
Seer
 
Join Date: Dec 2013
Location: Iowa
Posts: 29
I am triggering events to send ir codes to my audio system. I was just able to add it to the existing ones. Works great thanks.

I also have separate events for volume up and volume down, but you have to run each of them one step at a time. Any suggestion as to how to make it a true volume up and down, like a slider or enter a value 1-10
Reply With Quote
  #5  
Old January 6th, 2017, 03:34 PM
will.i.am will.i.am is offline
Seer
 
Join Date: Nov 2014
Location: Pennsylvania, PA
Posts: 42
Quote:
Originally Posted by billbingaman View Post
I am triggering events to send ir codes to my audio system. I was just able to add it to the existing ones. Works great thanks.

I also have separate events for volume up and volume down, but you have to run each of them one step at a time. Any suggestion as to how to make it a true volume up and down, like a slider or enter a value 1-10
Make the virtual device dimmable with control type of slider. You will have to provide a range of volume settings like 0 to 100%. Just look at one of your existing devices that has a slider, like a dimmable light.

Then you should be able to tell Alexa to set the volume to 50%.
Reply With Quote
  #6  
Old January 7th, 2017, 04:16 PM
kenm kenm is offline
Seer Deluxe
 
Join Date: Jan 2001
Location: San Jose, CA
Posts: 497
Bill (and Will),

One of the tricky things about changing volume via IR is knowing your starting and ending points. If you're only controlling your volume via HomeSeer then you can sort of rely on a device value and then calculate the number of steps up or down to get to the desired volume. If your sound system supports discrete volume setting via IR then it's a lot easier since you can just calculate what 50% is and send the discrete value. If you're also using an IR remote to control your sound system then you can't rely on a HomeSeer device value since it will likely be out-of-sync with your sound system.

My setup is a bit different. I have a Denon AVR-4308CI that has both Ethernet/Wifi and an RS323C port. The Ethernet/Wifi allows telnet commands to be sent to the AVR but doesn't support local change feedback unless a telnet session is active. I really wish they would have just used UDP messages since UDP is session-less, but I digress. Instead I use the RS232C port connected to a Serial-Ethernet adapter along with COM port redirector software on my HS system to connect to the AVR. Since this connection is always active I can not only query and control the AVR but I get status updates every time something is changed whether it's via serial command, the front control panel, or IR remote. I have a serial callback script that processes all the status messages and keeps the HomeSeer virtual devices in-sync with the AVR settings. The Denon also supports direct volume control so when I ask Alexa to set the kitchen volume to 50% the virtual device set value is converted to a Denon volume value of -30 (0 to 100 = -80 to +20) and then sent to the Denon just like sending a command to any other serial device.

Because the Alexa set, raise, and lower directives require an ending position you have to figure out a way to calculate the number of up or down steps needed if your sound system doesn't support discrete volume setting.

--Ken
Reply With Quote
  #7  
Old January 8th, 2017, 09:26 AM
Steve Q's Avatar
Steve Q Steve Q is offline
OverSeer
 
Join Date: Jun 2005
Location: Michigan
Posts: 3,656
Triggering Events with Virtual Devices

To minimize the problem of keeping the HS volume adjustment "in sync" with a remote, I send 10-12 volume down commands from HS3 to make sure the volume level is zero regardless of its previous volume level. I then send the appropriate number of volume up commands to bring the volume to my desired level. I do this every day for my whole house audio system when it turns on. It has worked well for me for many years.

Steve Q


Sent from my iPad using Tapatalk
__________________
HomeSeer Version: HS3 Pro Edition 3.0.0.368, Operating System: Microsoft Windows 10 - Home, Number of Devices: 373, Number of Events: 666, Enabled Plug-Ins
2.0.83.0: BLRF, 2.0.10.0: BLUSBUIRT, 3.0.0.75: HSTouch Server, 3.0.0.58: mcsXap, 3.0.0.11: NetCAM, 3.0.0.36: X10, 3.0.1.25: Z-Wave,Alexa,HomeKit
Reply With Quote
  #8  
Old January 8th, 2017, 02:16 PM
kenm kenm is offline
Seer Deluxe
 
Join Date: Jan 2001
Location: San Jose, CA
Posts: 497
Good suggestion Steve. That reminded of the X10 trick I used to do with lights. Before X10 devices allowed preset dim levels I'd dim a lamp down to zero instead of turning it off. When I wanted it to ramp up I'd start from zero and walk it up to the desired light level.
Reply With Quote
  #9  
Old January 9th, 2017, 10:07 AM
Steve Q's Avatar
Steve Q Steve Q is offline
OverSeer
 
Join Date: Jun 2005
Location: Michigan
Posts: 3,656
Triggering Events with Virtual Devices

Yeah, there are lots of ways to get stuff to work. X10 technology got labeled as "unreliable" because of noise on the power line caused by other appliances. "Wall warts" were a huge contributor to this noise 10-15 years ago. Today there is much less power line noise because of better electronics design. So now x10 is still a good choice for a lot of less critical device control. I think it is interesting how much x10 discussion is still occurring on this board. I think x10 will still be around years from now.

Steve Q


Sent from my iPad using Tapatalk

Last edited by Steve Q; January 9th, 2017 at 04:43 PM.
Reply With Quote
  #10  
Old March 18th, 2017, 11:40 AM
ykamenet ykamenet is offline
Seer
 
Join Date: May 2016
Location: USA, MA
Posts: 33
Omitting "on" or "off" in the command?

Thanks for the guide, it works great! One question I have - it is possible to configure this to NOT require "on" or "off" in the command? My example - I created a virtual device called "Tell kids to get up" which triggers an Event that does TTS through Sonos speakers in my kids rooms to play a chime and tell them to get up. Then it turns the virtual device off. If possible, I would like to be able to say 'Alexa, tell kids to get up" rather then "Alexa, tell kids to get up ON". Is it possible to create a custom command that does not require explicit "on" or "odd" instruction?
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HS Events not triggering when API devices change ksdehoff Arduino Plugin (3P) 0 December 8th, 2016 12:41 PM
Copy group events, virtual devices etc? U5tabil HS3 / HS3PRO Discussion 0 February 10th, 2015 03:45 PM
Events not triggering devices patrick.heinrichs HS3 / HS3PRO Discussion 6 December 4th, 2013 09:54 AM
Controlling Virtual Devices Through Events jebdmk HS2 / HSPRO 2 February 20th, 2013 12:47 PM
Virtual Devices and conditional events weathrman1 HS2 / HSPRO 4 February 15th, 2009 08:17 PM


All times are GMT -4. The time now is 12:09 AM.


Copyright HomeSeer Technologies, LLC