Template Lock Not Updating Status, Always "Off"

Hi all,

I’m trying to set up a template lock in HA for a Schlage Encode Plus lock added to HomeKit by following this excellent guide. The code I have is linked below.

Template lock:

  - platform: template
    name: Entryway Door Lock
    value_template: "{{ is_state('input_boolean.entryway_door_lock_status', 'on') }}"
      service: input_boolean.turn_on
        entity_id: input_boolean.entryway_door_lock_unlock_action
      service: input_boolean.turn_on
        entity_id: input_boolean.entryway_door_lock_lock_action

Input Booleans:

The details of why the lock is configured this way is included in the link above. TLDR; it is to “manually” sync the lock between Apple Home and HA.

Everything works perfectly except for some reason, the state of the template lock is always “off”.

I confirmed in the Developer tools that the input_boolean.entryway_door_lock_status is changing from on to off as expected when locking and unlocking the lock.

It seems the template lock is not actually listening the state change events for input_boolean.entryway_door_lock_status? The Logbook for the template lock is also empty.

Am I missing something? Any help would be appreciated.


At first I was confused as your lock should have the state locked/unlocked, not off.

Then I saw this:


That is a binary sensor not a lock. And you do not put all that config in the template section of the UI binary sensor, just the template. So delete that whole thing.

You need to define the template lock in YAML in your configuration.yaml file:


Ah! I definitely overlooked that detail in the doc. Added to my configuration.yaml and it works just fine now. Thank you for the assistance and the lightning-fast response!

1 Like