Alexa Routine Not Triggering from Hubitat Virtual Switch

It's been a while since I’ve set this up, but I’m trying to trigger an Alexa routine using a virtual switch in Hubitat (C7 hub 2.4.0.151). I’ve tried every virtual driver I could find—contact+switch, motion+switch—but none of them seem to activate the routine in Alexa. The routine itself works because it runs fine when I manually press "Play" in the Alexa app.

I also just realized that the virtual switches I set up a year ago are no longer triggering routines either.

As part of troubleshooting, I disabled and re-enabled the Echo Skill in Hubitat, but that didn’t help. I even tried creating a simple Alexa routine—like having Alexa give me a daily affirmation when a virtual device is triggered—but that doesn’t work either.

I'm using this driver: Virtual Motion Switch by ogiewon.

My goal is to have Hubitat turn on a virtual switch when everyone leaves the house, which should then trigger Alexa to start my Ecovacs vacuum. Has anyone else experienced this issue or found a workaround?


I assume you have checked the device page for the switch, and confirmed it is still changing the motion attribute when you switch it?

There are other virtual switches out there, like this one, you could try instead. You can try triggering with lock or contact as an alternative, but it looks like you have already tried others.

I used to use virtual switches, but I moved to having Echo Speaks trigger my routines with the executeRoutineID command. So that is another option, though it is a pain to set up if you are not using Echo Speaks now.

Thanks. I've used Echo Speaks in the old Smartthings Days. Does it still need the heroku server?

Despite the topic title, I think you are aware of this. But to make it clear for the thread - you cannot use a virtual switch to trigger an Alexa routine.

The Virtual Motion Sensor with Switch you cited is one of many simple virtual devices that have both switch and motion (or switch and contact) capabilities. This allows you to use it as a switch in Hubitat, yet use it as motion (or contact) in Alexa routines.

Although this has been the go-to solution for years, there are anecdotal reports (including my observations) that Alexa sometimes gets confused by those combo devices. I have been converting all of my combo switch/contact to simply contact and never have any trouble with routines.

Try making your "virtual switch" a virtual contact sensor instead. Use it like this on the Hubitat side (the Action is Run Custom Action):

image

Yes.

I recommend a different route. Install HA in a VM somewhere in your house. It has a very robust Ecovacs integration. And HA devices can be brought into Hubitat using Home Assistant Device Bridge.

Going this route will let you trigger your Deebot directly in your Rule rather than using Alexa as an intermediate.

Thanks, I have done that. But when I install the ecovacs integration and login with my ecovacs account, I dont see the vac or see where to add it.

I even tried it with a physical motion sensor, and a routine wont trigger.

That’s odd, as motion is a valid trigger for routines. You are sure you have it listed as a device to be shared via the Amazon Echo Skill?

Sometimes Alexa can be a harsh mistress. There is an element of randomness to what works and what does not. This may be particularly true now as the spilt functionality into a basic and paid tier.

Yes it is def shared with the skill. Very strange. And routines I had working months ago, stopped.

I can see the device in Alexa, and it opens and closes when I open/close the physical sensor. Very weird.

Alexa support was just a waste of time, as usual.

I just did a few more tests. A wifi smartplug (kasa) which is shared through Hubitat was able to trigger a routine, but my zigbee motion sensor and zwave lock was not. Could it possible be a zwave, zigbee thing?

Sounds like a parallel universe. Plugs, like switches, cannot trigger Alexa routines. But contacts and motion sensors can.

Try testing with a virtual contact sensor. Using virtual eliminates any possibility it has anything to do with ZWave or Zigbee.

My routines look something like this

// REMOVED MY INCORRECT TEXT

// EDIT: the text above/my original post was incorrect wrt/ the Alexa trigger. I'm using contact triggers "open/close" as I believe @HAL9000 was alluding to for Alexa routines. Even though the device, to Hubitat, is essentially a switch, it's also a Contact sensor... which is the only aspect Alexa sees.

I beg to differ. What driver (device type) is your virtual momentary switch? Would you care to post a screen shot of the trigger part of the Alexa routine?

1 Like

Mine looks very similar to this. Look at my original screenshot from the Alexa app. I've tried every device type. Added/ removed the device from Alexa. Logged out of Alexa, rebooted echo devices. Communication definitley works one way, as I can have alexa turn on/off hubitat devices. Would removing the Echo integration and adding it back possibly help?

Sure. The device type/class exposes itself to Hubitat as both a contact and a switch. It's exposed to Alexa as only a contact (which may well be your point)--I assume you're looking for the Alexa "opens" trigger vs. "on", etc. Yup, same on my end.

Use the driver I'm using. I don't recall where I got it from right now but the code is short and sweet (LSS 60 lines). I'm sure someone has a Github link. If not, ping me and I'll get the code to you.

It doesn't actually. In fact, I believe a lot of people have moved to hosting their own server because Heroku started charging. It does need a server, but it is very easy to host your own on a PI. I used an old PI 3 I had laying around, following the instructions was easy.

The other option to trigger routines is by using Voice Monkey.

I used it for sending voice commands back when Smart Things banned the Echo Speaks app for too much polling on their servers. It worked as a good alternative at the time, but I was glad to get Echo Speaks back when I moved to Hubitat after Samsung eliminated the Groovy cloud. It uses an api call, which is easy from Webcore, and I believe you can do web requests with Rule Machine now too, but I don't really use RM.

The other nice thing about Echo Speaks is you can use the voiceCommandAsText command, and just send text commands from Hubitat like, "Turn on the kitchen light" instead of needing any virtual switches or routines on the Alexa side.

Yes, that’s my point.

Yup, understood and agreed.

Corrected my post above; my bad.

1 Like