Hacking to use Homekit for my Schlage Sense deadbolts. Initial Homekit issue

Tags: #<Tag:0x00007efec8fef6a0>

I called up Schlage to ask for their API documentation
They told me to go pound sand.

Well, my Schlage Sense locks are controlled by Homekit, so maybe I can hack something

In Paper UI
I setup a generic MQTT Thing with a Switch channel and a Number channel.
I then linked channels to an appropriate Item.

They show up and in Paper UI control… I can toggle the switch and set the number

I then created the Homekit Items file

Group SchlageShadow "Schlage Shadow" <lock> {homekit = "Lock"}
Number SchlageShadow_LockedState "Locked" (SchlageShadow) {homekit = "Lock.LockCurrentState"}
Switch SchlageShadow_LockCommand "Command" (SchlageShadow) {homekit = "Lock.LockTargetState"}

I can now see a Lock in my iPhone Home App

Toggling the lock in the Home app toggles the Lock command in the Paper UI

So my problem is I can never see the lock state in the iPhone Home app. It always just shows “unknown”

When I set the lock state in the Paper UI, in the OH log I see

2020-08-29 11:16:43.123 [ome.event.ItemCommandEvent] - Item 'SchlageShadow_LockState' received command 0
2020-08-29 11:16:43.124 [nt.ItemStatePredictedEvent] - SchlageShadow_LockState predicted to become 0
2020-08-29 11:16:43.128 [vent.ItemStateChangedEvent] - SchlageShadow_LockState changed from 1.0 to 0.0

So I don’t know why the iPhone Home app is not showing the intended state.
I’m guessing that OH is not sending Homekit an Integer 0, but a floating 0.0

Any suggestions?

My first intention is to set up Homekit automations that cause the Homekit Schlage Shadow device state to follow the real Schlage device state.

The OH MQTT Thing was just a convenient way to create the Schlage Shadow device. I am not trying to use MQTT for anything.

I just found this link. Very interesting if not immediately useful.

you need to connect items, e.g. SchlageShadow_LockedState, to thing. otherwise it does not know where to get the state from. you need to tell which physical device it is and which API to use.
does MQTT work with your lock?

without API (MQTT, REST or whetever) you cannot control the device.

Well, I have a somewhat working hack

I used Switch for SchlageShadow_LockedState instead of Number

I created 2 Homekit automations and 2 Openhab rules to keep Openhab SchlageShadow synced with The Homekit Schlage Lock

SchlageShadow updates whenever the Schlage lock is Locked or Unlocked, manually or in Homekit
The Schlage Lock will lock or unlock when SchlageShadow is updated in OpenHab

I will try to post more detail when I have more time

The SchlageShadow items are linked to a Generic MQTT Thing. Just as a way to get ScjlageShadow to show up in Paper UI. I put dummy MQTT topics into the links and are not used.

I got a HARD go away from Schlage about the details to their API

Earlier I said “somewhat working Hack”

What I mean is that the Schlage Sense Locks do not reliably follow Homekit when I use the Home App.

Nothing wrong with OpenHab or the Homekit Plugin.

It is infuriating that such an expensive lock is so unreliable