I setup a local-only integration between the Encode Plus and Apple Home. After some tweaks it’s been working great for ~6 months.
This “manual” sync of the lock state between HA and Apple Home allows for locking and unlocking the lock from Home Assistant, and for the lock status to change in HA when it changes in Apple Home.
The lock is paired with Homekit in Apple Home, so that I can use the Home Key feature of the lock.
I have an Apple device that acts as an Apple Home hub.
HA exposes 3 input booleans (switch helpers) to HomeKit. Automations configured in Apple Home set the state of the status helper, and react to lock state changes in HA via the “action” helpers. Please see the final section/screenshot in my earlier post for a summary of the 4 automations involved.
When the lock status changes on the Apple Home side (e.g. unlocked via the knob), then the Apple Home automation sets the “lock status” switch (e.g. to off).
When the template lock on the HA side changes (e.g. unlock is requested), then an Apple Home Automation that is watching the “action unlock” helper switch acts by unlocking the door.
Also, what device are you using as an Apple Home hub?
HomePod Mini originally, because it’s the cheapest. I later got a recent Apple TV, and wish I had gone straight for the Apple TV (because I am using https://www.scrypted.app and the camera generates sooo much WiFi traffic when the HomePod Mini is the active hub).
Ahhhhh, sorry, yes I see now, you’re not directly integrating the lock, you’re essentially using virtual switches and automations to sync them between the HA side and the HomeKit side.
I am glad I bought the 128GB/Ethernet model of the Apple TV just last week then, I was considering a Home Pod but I hate WiFi, so out of principle I got the Apple TV, even it is just going to be an expensive “hub”.
Yep, the HomePod Mini is sitting in a corner of my office now, muted (I long-ago standardized on Google devices for voice control and whole-home audio [for better or for worse]).
I really want to like the Apple TV as a streaming device vs. the Chromecast w/ Google TV. The Apple TV interface is snappy vs. the incessant UI lag on all of Google’s devices. But my family has found it annoying to browse content on iPhone and not be able to “cast” it onto the TV with a couple taps…so the Apple TV is relegated to a secondary role…
I have several of these locks now and wanted to follow your lead on a local option using HomeKit. If I am reading the automation correctly, you have a 20 second delay before turning off/on the input_boolean that would signal to HomeKit to lock/unlcok the lock. Curious about the need for the delay. Is it necessary to avoid things getting out of sync? or other purpose.
Since this Schlage lock is now in HA proper and the HACS version is no longer needed I’m wondering if this work around for those of us wanting to use Homekey is still the preferred method. I tried adding this template to my configuration.yml but the helpers did not appear for me. So the automations reference non-existent entities. I have the bridge configured but need the helpers to send to HomeKit at this point. Any pointers on what I may need to do or may have done wrong appreciated.
When you mentioned that using the Schlage integration as well is good for battery state…Doesn’t that defeat the purpose of using Homekit, Apple HUB, and having this run on Thread?
Wouldn’t Schlage integration still need WIFI to get the battery status, or would this still somehow remain on Thread?
You are right, the Schlage cloud integration in HA core is used to get the battery status – and this requires the lock to be on Wi-Fi.
The reason I setup the HomeKit bits is because I wanted lock/unlock to function locally. If there were a way to get the battery status into HA locally, I would :).
I continue to use this HA-HomeKit setup for local control of lock and it’s been 99-100% reliable. As you said, I started down this path because Apple Home Key support was critical and non-negotiable for my needs.
The only issue I’ve had is sometimes after restarting HA the lock will show as unlocked even though it’s locked. I usually resolve this by “re-locking” the lock from HA, which propagates back to HA from HomeKit to tell HA that the lock is indeed locked.
You have the Encode Plus directly paired to HA via the Homekit integration? And then you’re exporting it back out to Apple Home via the HA Homebridge integration?
No, I have the Encode Plus paired to Apple Home (via Apple TV as hub). As far as I’m aware, there’s no way to get Apple Home Key working if it’s paired directly to HA.
The reason I went through the rigamarole above to get local control of the lock in HA is because the lock has to be paired to Apple Home for Home Key to work.
I was hoping something had changed since the links in this comment have been merged:
I’d try it, but I’m running HA on a VM in ESXi, and for some reason, the Intel WiFi/BT adaptor that I had successfully passed through to the VM before, has gone completely AWOL, not even showing at the hypervisor level. I need to reboot ESXi and have a poke in the BIOS I guess, but I’m loathed to since it has been up and running for 1.5 years without a single issue otherwise.
If I recall correctly from when I put this together, I had to use an input_boolean and not a “momentary push” button because button isn’t supported by the HA HomeKit Bridge.
So, I make the switch (input_boolean) act like a button by “resetting” it back to its normal state after 20 seconds (arbitrary number).
The purpose of input_boolean.front_door_lock_action_unlock is to communicate from HA to Apple Home that an unlock has been requested, by turning on the input_boolean.
I have the Schlage Encide Plus and it was on WiFi and, aside from the terrible response times associated with the cloud, it destroyed batteries.
I switched to thread on my HomePod Mini and it works great. I also have yet to replace the batteries.
The downside has been that the lock only shows up in HomeKit/AppleHome. How do I bring it back into Home Assistant without the cloud or WiFi?
-EDIT-
Morning brain I think someone answered that and my ADHD brain couldn’t process it. I’ll revisit =)