1: My Schlage Lock is integrated and controllable by Alexa
2: Alexa has no way of knowing if I and my wife are home or not
3: I use person.vinny and person.faith and assigned my trackers to them, I use bluetooth and nmap to increase accuracy
4: I made a binary sensor called people_home using the person.vinny & faith
5: I went into Customization and changed the entity people_home binary sensor device class to window
6: I then exposed that entity to Alexa. It see’s it as people_home “window” is “open” when we both are home or “closed” when we both are gone.
7: I wrote an Alexa routine to lock my schlage lock when it see’s the “window” goes from open to closed
Unfortunately Alexa will not automatically open the lock so you cannot run a routine to unlock when you return but at least I know I’m not forgetting to lock up.
It’s a bit of work, probably took an hour but it has been working perfectly. Whenever we go out my schlage app notifies me the door has locked within a minute or 2 of us leaving if I forget it.
I’ll put some money in the donation box if somebody would make an integration
Also, homekit isn’t working right? I must have not done enough research, because I wanted to open the door using a shortcut with my iPhone triggered by a NFC sensor by the door…
I have an Encode, it woks pretty well with the phone app, and it shows up in wifi clients for my router. It took me two tries to get it working, probably because of user error in setting up. I had to delete it from the app and reset the lock and start over.
I need to be able to work the lock when the house is not online so i really need HA integration
I’ve spent the last couple days reverse engineering their app and some of the API calls and I’m close…
Here is what I’ve found…
The auth uses Amazon Cognito and SRP… I was able to find the identity pool ID, app secret from the iOS app hard coded.
The one issue I’m running into now is the secret hash validation for the SRP… everything after that SRP uses bearer authorization and should be smooth sailing.
If there are any really developers who want to take a crack I’m happy to share what I got to.
I believe the only issue is something missing from the hash calculation for the SRP but that seems like something not too hard to figure out but it’s beyond the time and skill I have…
Going to shift my focus to making this brine tank sensor HA enabled
great man! that lock is the only smart device not compatible with my home assistant set up.
I can’t wait to be able to use a NFC tag to open the door with
I have not looked inside the lock but I’m tempted to consider replacing the original control board with an ESP32 or equivalent and a small servo controller. Consider that a lock is a very simple device. It moves a bar back and forth and senses the movement.
I would also like to add a solar panel on the door. I expect that unless the doorway is used a lot, or us in a dark location, a solar panel should be able to keep batteries charged.
I just got one of these as well. I went with the WiFi since I don’t have any z-wave devices and didn’t want to add any just for this lock. I’d really love to just be able to see the door status and don’t really care about the lock/unlock from HA right now. One of the routes I tried to go down was to get the lock into the Ring app with the hopes that it would then show up there. To do this I had to pair it with the Amazon Key app. The lock now shows up in the Ring App but does not show as an entity for the Ring integration. Any thoughts on how to get this? It could be a round about way to see the lock in HA.
As proper integration isn’t available I thought I would share a solution I’m working on using Alexa integration with Home Assistant. Allowing Home Assistant to lock the door.
Basically, you use a virtual switch in Home Assistant to change the state of a virtual Home Assistant sensor that Alexa monitors. When Alexa sees the state of that sensor change (i.e. to closed) you have an Alexa routine lock the door.
You don’t need an Amazon Alexa device to use this BTW, just the Alexa app and Amazon account on your Android (maybe iOS device too).
This is the virtual switch, which when in the ‘off’ state will trigger the sensor to change to ‘closed’ and the Alexa Routine. Add this to your configuration.xml.
front_door_lock_alexa_switch:
name: Front Door Lock HA Switch
icon: mdi:door-closed-lock
This is the virtual sensor which Alexa will watch.
- platform: template
sensors:
front_door_lock_ha_alexa_switch_sensor:
friendly_name: "Front Door Lock HA Switch State Sensor"
device_class: door
value_template: '{{ is_state("input_boolean.front_door_lock_alexa_switch","on") }}'
Next enable Home Assistant Cloud, Alexa Integration and ensure that the Front Door Lock HA Switch State Sensor is synced to Alexa.
Configure the Schlage Encode integration within the Alexa app on your mobile device.
Setup a Routine in the Alexa to Lock the Front Door when it sees the “Front Door Lock HA Switch State Sensor” in the Closed state.
One problem I’m still working on is that this only works once as Front Door Lock HA Switch and Sensor won’t automatically open again if the front door is actually unlocked. You will need an Automation in Home Assistant to change the virtual switch back to the On state (Sensor Open) every x seconds or something. Or maybe Alexa changes the HA switch state back to Open when is see’s it was open. Not sure yet, but wanted to share my progress as is.
For now the workaround is this automation which reset the switch (effectively turning it into a momentary switch) 10 seconds after it is used.
Add this Automation via the HA GUI using this yaml.
alias: Reset Front Door Lock Switch State
description: 'Resets switch after 10 seconds so it can be reused'
mode: single
trigger:
- platform: state
entity_id: input_boolean.front_door_lock_alexa_switch
to: 'off'
for: 00:00:10
condition: []
action:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.front_door_lock_alexa_switch