Using and Syncing Virtual Devices with Amazon Echo

Posted on
Mon Mar 21, 2016 8:54 pm
ckeyes888 offline
Posts: 2031
Joined: Nov 26, 2009
Location: Kalispell, MT

Using and Syncing Virtual Devices with Amazon Echo

I use Alexa specific meta/virtual devices that when turned on/off by Alexa will trigger
actions. If you only trigger those actions by Alexa turning the devices on/off all is well.
If you undoubtedly execute actions some other way, such as turn the TV on,
you cannot simply update the Alexa virtual device without re-triggering the actions
attached to it.
Happens all the time I'll turn the TV on using Alexa, then turn it off some other way,
then the next time I ask Alexa to turn it on nothing happens as that device is still on
and the trigger is looking for a "becomes on".

In this case I'm using Meta devices as opposed to virtual devices as they seem to require
an Action to execute when their state changes. Meta devices are nothing more than
dummy on/off devices.

Hoping someone might have a suggestion for a better way to keep Alexa devices in sync
without having them re-trigger.

Thanks,

Carl

Posted on
Mon Mar 21, 2016 10:21 pm
RogueProeliator offline
User avatar
Posts: 2067
Joined: Nov 13, 2012
Location: Baton Rouge, LA

Re: Using and Syncing Virtual Devices with Amazon Echo

Well, one solution might be to create a variable that controls execution of the Action Group associated with the Virtual Device. You could set that to False, say, when updating the state from non-Alexa so that the action group does not fire. So, for example a TV controller might be:

Virtual Device - On/Off Action Groups; each action group has a condition for execution "executeAlexaTV Is True" where in executeAlexaTV is a variable. If you need to update the device state from, say, a plugin's reading that the TV is off then you:
1. Set executeAlexaTV to False
2. Change the device state, actions don't fire since condition is not met
3. Set executeAlexaTV to True

It is a bit more overhead but I think accomplishes what you want.

Adam

Posted on
Mon Mar 21, 2016 11:41 pm
ckeyes888 offline
Posts: 2031
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Using and Syncing Virtual Devices with Amazon Echo

Thanks Adam. That did occur to me but I wasn't too jazzed about all the extras involved.
I'll try a few using that technique and see how it goes.

Also considered disabling the trigger during the Alexa device change.

Carl

Posted on
Tue Mar 22, 2016 11:54 am
jay (support) offline
Site Admin
User avatar
Posts: 14756
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Using and Syncing Virtual Devices with Amazon Echo

Well - the Meta devices aren't part of the Virtual Devices Interface (you failed to mention that in your other thread), so this really isn't the place to talk about them.

However, one of your biggest issues is that you want the virtual device (however it's implemented) to track the state of your TV. So you need to make it do that. Adam's idea is certainly one way. The other would be a couple of triggers that watch for the state of your TV to change and then update the state of your Virtual On/Off Device (I don't know how you do that with a Meta device).

Bottom line though - you're trying to track state changes of a 3rd device and have that reflected in some kind of virtual device - that's the problem to solve and it has nothing to do with the Alexa plugin.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Mar 22, 2016 8:24 pm
RogueProeliator offline
User avatar
Posts: 2067
Joined: Nov 13, 2012
Location: Baton Rouge, LA

Re: Using and Syncing Virtual Devices with Amazon Echo

Thanks Adam. That did occur to me but I wasn't too jazzed about all the extras involved.
I'll try a few using that technique and see how it goes.

Yeah, I haven't done that just an idea that came to mind. What TV and plugin are you tracking with?

Adam

Posted on
Wed Mar 23, 2016 12:04 am
ckeyes888 offline
Posts: 2031
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Using and Syncing Virtual Devices with Amazon Echo

RogueProeliator wrote:
Yeah, I haven't done that just an idea that came to mind. What TV and plugin are you tracking with?

Adam


Adam, not sure what you mean, "What TV and plugin are you tracking with?"
I'm not using any plugins to track the TV or other states. To solve my sync problem I ended up disabling the triggers that would normally fire when Alexa controls a device, triggered by the TV or whatever state has changed,
then auto-enabling it after a few seconds. Seems to work well.

Jay, in my other post I stated that the sync issue I was trying to solve had nothing to do with the Alexa
plugin. Sorry if you thought I was ragging on it.
The Meta device plugin has been around forever and is very similar to Virtual devices
except it has no options to execute actions. For my use, to simply trigger from it's on/off state,
it works fine.

Thanks,

Carl

Posted on
Wed Mar 23, 2016 9:32 am
jay (support) offline
Site Admin
User avatar
Posts: 14756
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Using and Syncing Virtual Devices with Amazon Echo

ckeyes888 wrote:
I'm not using any plugins to track the TV or other states.


OK, now I'm REALLY confused. What exactly is getting out of sync if you're not tracking the TV's state?

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Mar 23, 2016 10:39 pm
RogueProeliator offline
User avatar
Posts: 2067
Joined: Nov 13, 2012
Location: Baton Rouge, LA

Re: Using and Syncing Virtual Devices with Amazon Echo

OK, now I'm REALLY confused. What exactly is getting out of sync if you're not tracking the TV's state?

Ditto. Carl, what I was asking is whether or not you are using a plugin to monitor the state of the TV (in order to know if you need to flip the virtual device).

Posted on
Wed Mar 23, 2016 11:28 pm
ckeyes888 offline
Posts: 2031
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Using and Syncing Virtual Devices with Amazon Echo

Wow, now I'm totally confused :-)
Maybe if I just re-state what I'm doing.

I have Meta relay (on/off) devices that I trigger actions from when the Alexa plugin turns them
off/off.

If I execute those Alexa actions some other way the Alexa device became out of sync.
For example, I have a device called Alexa heat. When I turn it on by voice
it executes some thermostat actions.
If I turned the heat on some other way the Alexa device would not reflect that change
and remain off causing the trigger not to fire if I try to turn it off by voice.
(the triggers fire on "becomes on" and "becomes off")

Disabling the trigger for a few seconds while I update the Alexa devices
seems to work fine without re-triggering the actions.

Hope I made it a bit clearer.

edit: Is there a plugin to aid in keeping devices in sync?

Thanks,

Carl

Posted on
Thu Mar 24, 2016 9:55 am
jay (support) offline
Site Admin
User avatar
Posts: 14756
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Using and Syncing Virtual Devices with Amazon Echo

Ok, let me rephrase to remove Alexa as a potential source of confusion:

You have a meta device that triggers an actions when turned on and triggers other actions when turned off. If you trigger those actions in some other way (not by changing the state of the meta device), the meta device gets out of sync with reality. Is that correct?

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest