Virtual Switch for Alexa Devices

tivo, When say drivers list you are talking the list to the right drop named type coreect? sorry only my 3rd day with HE

I meant this on the device driver page:

Hey y'all. I'm a newbie to Hubitat HE and having a bunch of problems getting stuff playing nicely. As well as Hubitat I also have Alexa and a Schlage Encode smart lock on the front door. I have worked out how to make the front door lock, but not unlock, due to a restriction in the Schlage skill. I do kind of value this override in case my Alexa account gets hacked (I'm less worried about the Hubitat lol) But it would be nice to somehow have this virtual contact open the switch and make alexa unlock from hubitat (even if it needs the PIN to do so..)

I kinda wish I got the Schlage Connect instead, but it wasn't in stock.. Oh well :confused:

For anything that Alexa recognizes as a security related device you need to go into the Alexa app and add a PIN for the device. It will prompt you for the pin before opening/unlocking. (I was going to give you some screen shots but it appears that Alexaā€™s app canā€™t find the servers this morninā€™ - devices are working butā€¦)

OK, I'm tryng to do something much more simple now. I've got Alexa, the HE, and a garage door. I'm using a Shelly One to open then close the door. I want to be able to say "Alexa open the garage door" or "alexa close the garage door"... Or maybe even ask her if it's open or closed. Seems simple right? Well I'm using Stephen Hackets' Virtual Contact Sensor with Switch driver and Alexa sees it as a switch (though it has the convenient option of treating it as a lightbulb). I've set up automation in HE to pulse the Shelly on then off for a second when the vswitch changes state. Telling Alexa to 'turn on' the garage door doesn't roll off the tongue. Queue the Virtual Contact Sensor driver. That seems to show as "open" or "closed" in Alexa's devices menu but when I ask her to open or close the garage door she tells me that the device "doesn't support that". Seriously!

I've also got a Sonoff SNZB zigbee contact sensor on the garage door which is nice except for the fact my damn HE can't hear it without a router in the middle even though its a matter of metres away from it...but that's a different issue. Maybe if I could get that to work I could expose THAT to Alexa and then..I don't know??

Physical contact sensors detect open/close but donā€™t allow you to set them, thus Alexa, in this instance, is correct. You could use a custom Alexa routine to issue a turn on/off when it hears open/close to get around this.

Ah you're right. Just for once, Alexa actually is doing the right thing!
So... In lieu of getting my REAL contact sensor going I could do something like this

  • expose a virtual contact sensor and a virtual contact sensor with switch (or just a virtual switch) to Alexa
  • Setup a routine for Alexa to flip on the virtual switch when she hears "open the garage door" or "close the garage door"
  • Setup Hubitat basic rule to turn the Shelly on, wait a second, turn it off when it sees that switch flipped, and then update the virtual contact sensor status with the opposite of what it currently is (open/closed)

Then when I resolve my ridiculous zigbee range issue I can expose the real garage door contact sensor to her instead? Hmm let me try all this...

Just a side note. Alexa is sometimes inconsistent in the order in which she tries to understand a phrase. For example, I'd love to have "Alexa, open the pod bay door" open my garage door, but she has a canned response to that phrase that she prefers, but not all the time.

Similarly, if you say "open the garage door" and you have a routine that is triggered by that phrase, it may work some of the time. Or she may say she couldn't find a device named "garage door" or, if you have any devices with those words in them, she may say "There are several devices named door. Which one do you want?" Moral of the story: Avoid words in the trigger phrase that may also appear in smart home devices, or are verbs commonly used for smart home devices (e.g. turn on, open, etc.).

I've given up and now have two NSFW phrases that tell Alexa what she can do. One opens the garage door. One closes it. She has no idea what she's doing.

1 Like

Yeah, Iā€™ve got a few phrases that tell Alexa what she can do, too. And she then tells me to watch my language.

1 Like

Using a custom Alexa routine you can actually have Alexa tell Alexa to ā€œturn on the Garageā€ in response to telling her ā€œopen the Garageā€..

1 Like

Hmmm - so I've implemented the above and alexa seems to run the routine properly when I ask her to open or close the garage door. For the time being, she's doing that rather than trying to open the contact switch. I swapped over my Sonoff zigbee device on the garage door and it seems to be working much better than the other one so it's probably a hardware fault. I can now see open/close status in the alexa app but when I ask alexa "is the garage door open or closed" she says "the device doesn't support that". Even though there it is, right in front of her, fricken showing open or closed! Guess now you've mentioned the inconsistency with routines above I will have to change the routine from "open/close the garage door" to "beam me up/down scotty" or something ridiculous... Sigh

Actually come to think of it the other zigbee devices that the Alexa HE app are presenting to Alexa are doing the same thing: Live status showing up in the Alexa app, but when I ask her if the damn thing is open or closed "that's not supported yet". Seriously FFS!!

I remember a few years back when I was on ST there were a series of smart apps (Ask Alexa?) that gave Alexa some status reporting capability, but IIRC it was a rather tricky install with a lot of moving parts.

Hi Newbie here from smartthings. just getting started.

I was able to control alexa devices from smartthings but can't seem to do that in hubitat. for example, I own an alexa outlet. want to control on/off and receive status in hubitat but that seems pretty complicated and not directly supported.
Likewise I could create a rule in smartthings that would announce in alexa (e.g. door opened) but can't figure that out.
So many devices (my TV, etc.) have native Alexa a/o Google integration and was expecting to be able to integrate them in hubitat.
I know that home assistant can do this...

Check out Echo speaks.

Not sure what you mean by controlling Alexa devices. Do you mean controlling Echos and Dots? I suspect you actually meant to control devices that Alexa can also control. As far as I know, thereā€™s no such thing as an Alexa outlet.

Anything that Alexa can do can be done with Hubitat. The trick is to use a virtual switch with contact (or with motion) and control that via Hubitat. On the Alexa side, create a routine to take the desired action.

As far as getting status from Alexa-controlled devices .. if Alexa can see it, she can flip a virtual switch, which in turn Hubitat can use as a trigger.

Thanks. Sorry for the late reply. I have an outlet for example (also have others) that only works with Alexa. I'd like to use hubitat to control it (virtual switch) and also see it's status (not sure about that).
I can see how to create a virtual switch and understand creating the routine. Do I need echo speaks for any of this integration?

No if you just want to turn on a virtual switch with Alexa then Echo speaks is not necessary. Just the Amazon Echo skill, that gives Alexa control over the virtual switch, and an Alexa routine, this activates said switch with your voice comamnd..

1 Like

The key to the puzzle is a virtual switch with contact in Hubitat (see the early comments in this thread). The reason for the dual identity device is that Alexa routines cannot at this time be triggered when a switch changes. So on the Alexa routine side, she thinks a contact opened and that is the trigger in a routine to turn on the smart plug. Similarly, create a routine so that when the contact closes, she turns off the plug.

3 Likes