Virtual Open/Closed Button Tile for Amazon Echo + Routines Automation

I’ve been annoyed that I couldn’t trigger routines from Alexa. I’ve read various solutions, but came up with this, which involves creating just one virtual device that can be used directly by routines without any other smartapps. The readme has step-by-step how to set it up.



Seems like routines should be triggered optionally by switches, and this and AlexaHelper would not be needed.

but there are much bigger fish to fry first

It would make sense to also let routines be triggered by switches, but even then you’d need a “virtual switch” for Alexa-triggered routines. I think they just need to add native support for routines in the Alexa application. I’m going to give them the benefit of the doubt that there’s some technical reason that hasn’t been done yet :wink:

This is pretty slick. I was actually thinking of this today but for an entirely different reason.

On April 4 Amazon pushed an updated that has screwed up the voice recognition for home automaton. My garage door no longer respond properly to open it or close and I have some problems with a few virtual switches.

So, I was going to create a switch basically like this to solve the garage door problem.

The other reason… You can only have 100 devices with the same capability, in my case it was switch. I have over 100 physical devices and had to delete over 20 virtual switches.

Will this help me use Alexa to say “Alexa, Open the Garage Door” or “Alexa, Close the Garage Door”. Currently have the MyQ garage doors that Alexa sees as switches and the Open command works for both opening and closing, but the close command doesn’t work.

mbhforum - I don’t think it would help you with that. This is still a switch and used as a switch by Alexa. You still say “Alexa, turn on “switch name”” with this. My understanding is that this is a limit of the Alexa connected home functionality, which is keying off of only a few phrases (unfortunately not open/close):

bamarayne - 100 switches, holy cow. I haven’t had issues with Alexa + ST, but don’t have quite that many things in it.

Thanks. Actually Alexa now supports open close and another of other phrases. They haven’t done a good job advertising that though…

Yeah, but Alexa is still having issues recognizing home automaton devices

The problem with the switch, is once Alexa triggers the switch (On) to activate the routine, the switch is left on. If you don’t have a need to turn the switch off (say, if you’re going from one scene or “routine” directly into another…perhaps for lighting scenes) the next time you ask alexa trigger "xxx’ it will say "sending that to IFTTT, but I won’t launch because it is already on. I think the solution is to use a virtual button instead of a switch, but I haven’t figure out how to make that work yet. Any suggestions?

I just recently incorporated Harmony into my ST environment and I’ve run into the same thing.

As for routines, if you go into the IDE you can create a virtual momentary button that you can use to trigger your routines…

Or, you can install AskAlexa and that will do everything for you without the virtual switches. You then just tell Alexa to run the routine you want.

I’ve run into what you describe I think. The fix is to be sure the switch is turned back off. You can have the same routine or another relevant one trigger turning the virtual switch off. So for example, I have “Night” routine triggered when “Night Mode” opens. I tell Alexa, "turn on “Night Mode”. She turns on the switch, triggering Night routine. In Good Morning routine, which is triggered by time or motion after 5am, I have added “Night Mode” to “turn these switches off”. An alternative that might work even better would be to turn “Night Mode” off in “Night” routine, so that it immediately resets it for next time.

Will that work? To have the routine turn of it’s own triggering switch? I’ll need to try that! Thank you.

Hey, have you guys taken a look at the smartapp askAlexa?

You can run routines just by telling Alexa to, without the virtual switches… And so much more.

Do a search for askAlexa. You won’t regret it.

@jnschlesinger @danroot

I did look at AskAlexa, but felt like it was more more custom code and moving pieces than I wanted to deal with at the time. It was also right after a big developer “walk out”, so I wasn’t sure how some of these 3rd party apps would be supported. I’m a developer by day, but I didn’t want to set up an AWS Lambda account, etc., or have my SmartThings’ wife-acceptance-factor be dependent on AWS and a complex 3rd party app. My hack doesn’t give you all the features, but is just one simple .groovy that then works with the existing native SmartThings routines and Alexa integration. It was “the simplest thing that worked” for my immediate need. AskAlexa does look cool though, and I may have to pick that up at some point.

I completely understand. Initial setup is a little complex, but since you’re already a developer it would be a breeze for you… Maybe 30 min max. The directions are very detailed and accurate.

It has almost completely replaced my native ST/Alexa integration.

Oh, my wife is much happier with the house HA project since the install.

Just my totally biased opinion… Lol