Alexa routine to UNlock a virtual lock

This is probably more of an Alexa support issue, but maybe someone here has seen the same.

I'm trying to see if I can sync a physical lock in Alexa with a virtual lock in HE, using Alexa routines. The physical lock is not a part of Hubitat.

I have a virtual lock created in HE that is discovered by Alexa and can be "locked/unlocked" using the Alexa app, that part is OK. Unlock by app is enabled for the lock in the Alexa app.

Using an Alexa routine I'm able to sync the lock function, i.e., the physical lock locks and an Alexa routine triggers to lock the virtual lock. The problem is with unlocking, as it appears that Alexa doesn't support unlocking via a routine. When creating the routine it only gives an option to lock. Has anyone tried this?

I could do this using a virtual switch instead of a virtual lock but I'd prefer to avoid the extra steps.

I created a virtual switch on/off to represent lock and unlock to be controlled by Alexa in a routine. Then translate that with a rule to control your virtual lock. That's how I did my garage door as I have a DIY solution, so nothing standard would work. It's a bit more set up, but it's been solid for me for two weeks now.

Thanks for the reply. That sounds similar to what I'm attempting. Are you controlling the garage door only via Hubitat?

I would like to control the physical lock (which is connected to another HA system, but exposed to Alexa) through HE but I don't think I can fully, with the limitations that Alexa has on unlocking.

I am thinking that per each physical lock I will need:
1 virtual lock
1 virtual switch
3 Alexa routines (1 to lock the v-lock when physical-lock locks, 1 to turn off v-switch when physical-lock unlocks, 1 to lock physical-lock when v-lock locks. No routine for unlocking the physical-lock).
1 HE rule (to keep the v-switch and v-lock in sync)

With that setup I think I can at least keep the v-lock status in sync with the physical-lock, and lock it through HE. That covers most of my needs. Unlocking would require using Alexa app.

I will try it on 1 lock to see what happens...

Sorry it took me so long to get back to you. Yes, I have an arrival switch in HE. I also have two virtual momentary switches garage door up and garage door down. When we arrive a routine turns on the switch that says we're home. When that switch turns on then it triggers a rule in HE that triggers the rule that pushes the button for the garage door to open. Upon departure, a routine triggers the garage door closed button which will close the garage door. Even though the switches are set up as momentary, I still have an off with a delay of 1 second to make sure that the switch will turn off. Otherwise it ties up my button and won't let it be controlled from the wall button. Here is my rule:
image
I imagine that you could do the same with your lock. Call one virtual switch exposed to alexa that will turn on when you need it to be locked and off when you need it to be unlocked. (NOT MOMENTARY) Then set up a rule that acts on switch change. Trigger being that switch is "changed"
If switch is on
then lock door
else if switch is off
then unlock door.
end-if

Set up a routine in alexa that is more friendly. "Alexa unlock my door" turn switch off
and
"alexa, lock my door" turn switch on.

In theory, this should work. What is and what is thought to be can be two different things. Let me know what you come up with. Set up more logic as you get this to work for you. Like only unlocking during certain hours, etc.
I remember you mentioning that you had another platform working your lock. If it's compatible with hubconnect, then there should be no problems with making this work. You never said what platform you used with this or how you were triggering to the other hub. (Don't worry, the community doesn't hate on owning other hubs. We embrace it.)

Oh, that was a quick reply, so thanks for that. And thank you for posting the rule, that is so helpful for noobs to see practical examples. My locks are on HE right now but not working well, so I'm going to try moving them back to Wink ... regrettably. I don't think there is any formal integration between the two platforms. Right now, the best intermediary I can find is having the locks paired to and controlled by Wink (where they have been reliable), discovered by Alexa, and having the lock status synced with HE by Alexa routines. But as you said, this is in theory and the application may be different. A lot of this hinges on how reliable the Alexa routines are. They are still primitive compared to RM but Amazon has improved them by leaps and bounds in recent months. I'll post back an update when I get 1 lock setup.

1 Like

Well, keep me informed of your progress. I noticed t hat alexa will allow you to change bulbs to switches, so maybe it will allow you to spoof it.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.