Alexa Unlock

Using latest Hubitat 2.0.1.117 and Alexa Skill (UK).

Should Alexa be able to unlock a Virtual Lock?

I've added a Virtual Lock, authorized it in the Alexa Skill and it appears to be recognised as a lock correctly by Alexa - I can ask "Is the door locked" for example and she replies accordingly. I can also lock the Virtual Lock via Alexa too.

I don't seem to be able to unlock it though, in the Alexa App it just says "Alexa cannot unlock this smart device".

I've played around with the settings on the Virtual Lock, added some lock codes, turned on lock code encryption, etc. Nothing seems to help :frowning:

Should this work?

I havent tried this myself but there is a limitation of Alexa when it comes to Unlocking devices. By default it is disabled. If you click on "Locks" does your virtual lock show in the list? If it does select it, then hit the hamburger menu in the top right corner. It should give you a page like this

Enable the Unlock by voice option.
Hopefully it is available for Virtual devices.

1 Like

No I don't get those options at all, but I'm not sure if that's a limitation of UK Alexa or a problem with the Hubitat Alexa Skill.

Unfortunately I don't have a real lock device that works in Hubitat that I can test with Alexa directly to see if I get those options :frowning:

You can get around this by linking a virtual switch to the lock in a rule. Then create a routine with the words “unlock the door”, or something similar, your choice. Then assign that virtual switch to the routine so when it turns on, the door unlocks. However you may want to make it so that when it turns off the door locks. The reason I suggest that is sometimes I’ve found after reboot, certain switches are just on. So you might not want your lock to suddenly open when your hub reboots.

There is a disadvantage to this in that it will not ask you for a code so anybody that asks Alexa to unlock your door can do so. I add an extra layer of protection with this Stringify flow. It then triggers an IFTTT applet that triggers the Hubitat switch. So anyone who asks will get no results if my phone’s not on location.

So in this flow when I say “Alexa, unlock the back door” via an Alexa routine, it will trigger “Back Door look” which shows up as a device in the Alexa app. If my phone also matches the Geo location at the time that is triggered, it runs the Stringify flow which tells IFTTT to tell Hubitat to flip the switch and the back door opens.

Why not just let RM handle the lock/unlock and set a restriction or condition based on presence?

Nice workaround, a bit too "cloudy" for me though with reliance on Stringify & IFTTT.

From what I can see the functionality should be there within Alexa by default (with option to enable unlock by App and / or Voice with PIN).

IF anybody has a real lock working direct to unlock in Alexa then perhaps they can try with a Virtual Lock too....

I do have a Yale 210 integrated with HE and then Alexa and just tested a Virtual lock. it does work just like the Yale. I did add a code to the virtual lock and this is with a US Alexa account.

True. I did set this up before I had HE. I use HomeKit for presence and I'm just not sure it would work the same. I will try it for myself. You're right not that I think about it. Doesn't really make sense to use this anymore. Maybe there's something I'm forgetting about my setup.

It get's difficult to remember why I setup all these different scenarios when I look at them later and I ofter have to go through the process of trying to change it before a light bulb turns on and I remember why I didn't do whatever a certain way before. :wink:

I think @martyn 's particular issue is the UK Skill just isn't offering that. Someone at Amazon in the UK said "no, we're not going to allow that" I guess.

Thanks for confirming drew :slight_smile:

@SmartHomePrimer yes that's what I fear, sounds like it may not be available in the UK yet.

I don't like limitations. I'd just work around it with a virtual switch. As far as the solution I suggested, yes you are making a few cloud hops, but it's actually not that slow (not as fast as a button controller configured to open the lock, for sure). Anytime you ask Alexa to do anything it's cloud. Stringify is an Amazon cloud server and IFTTT is also an Amazon cloud server. For all we know, that single request never even leaves a single Amazon server farm before being fulfilled.

Now I remember why I don't do that. Becuase I use iOS geolocation data in combination with WiFi presence to auto unlock our door, if I also wanted to have Geolocation be a trust factor for unlocking the door by voice, I would have to keep the virtual switch that is tied to our Geolocation enabled all the time while we're home.

That would cause an issue if one our phones lost WiFi for whatever reason, because that would mean that as soon as WiFi reconnected, my unlock rule for the door would be true and it could unlock without our knowledge. The way my auto-unlock rule works right now is this:

  1. As each of us leave the Geofenced area, our associated "Location" virtual switches are already OFF.
  2. We re-enter the Geofenced area an the virtual switch turns back on, but the rule is still false.
  3. When each of our phones reconnects with WiFi, that turns on a "Presence" virtual switch for 1 second.
  4. Since both the "Location" virtual switch and the "Presence" virtual switch are both ON for a second, the rule becomes true, causing the door to unlock and turn off the "Presence" virtual switch so that it cannot be a part of inadvertently unlocking to door if one of us loses and rejoins WiFi.

Yeah guess I'd just prefer things to work as they should ...... if I'm back in the world of workarounds then I might as well go back to Vera / ST / Fibaro / etc :roll_eyes:

I did have a quick look at the Alexa developer docs and as far as I can see there shouldn't be a limitation for UK users when it comes to locks, so could be the issue is with HE after all.

:rofl: You can't be serious. Using a virtual lock icon instead of a virtual switch icon in the Alexa app doesn't justify any of that pain.

As @drew mentioned, he was able to get these options with a Virtual Lock. I just added one as well and the Alexa app gave me the option to Unlock By Voice as well. It seems more likely to be a regional issue.

Just to confirm...when you open the Virtual Lock in Alexa, you are clicking the top right menu depicted here:

1 Like

Yes for sure, there's no options on that screen other than changing the name. The text under the device is different too as it only says "Alexa cannot unlock this smart device".

It may well be a regional thing, although I couldn't see any restrictions in the Alexa SDK side that would suggest it's not available.

Worth asking support, but it does appear to be a regional limit. I can open an HE virtual lock as well by Alexa if I wanted to.

Yeah I've sent a support ticket now to double check.

I did reach out to Amazon support and after a very protracted conversation they did eventually confirm that there shouldn't be any regional restrictions and that it should work in the UK. Not sure how much I trust that information though, although I do like being called Sir and referred to as their "most valuable excellent customer" :slight_smile:

1 Like

Hi, did you ever get to the bottom of this? I have the exact same problem and dont have those options available to me. The lock I have connects via alexa so if it wont open it I cant figure out a workaround. Cheers!

Yes, eventually.

As part of my wider HA system I have my own developed / hosted Alexa Skills, so I ended up setting up a proof of concept UK Smart Home Skill with a lock device.

Then I went via developer support (as opposed to the script reading call center muppets on the customer facing "pleased for you to be our most excellent valuable customer" side).

Bottom line is that the UK (probably EU too) is WAY behind US in Alexa features on the development side, so we don't get features like unlocking locks, using sensors, etc, etc. That was six months ago and I don't believe anything has changed - I still have my test skill and it still doesn't offer unlock and none of the test sensors show as available in Alexa routines etc.

Of course they won't commit to when those features are coming to the UK either, other than "soon" .....