How to add battery level and charging status to a lock template to work in Homekit?

Hi everyone,

can you guys help me with setting up the homekit configuration / template in order to have the battery level and charging status being shown in homekit? It is for a lock template device.

This is what I tried:

  - platform: template
    name: Car Lock
    value_template: "{{ is_state('lock.car_door_lock', 'locked') }}"
      service: lock.lock
        entity_id: lock.car_door_lock
      service: lock.unlock
        code: 1234
        entity_id: lock.car_door_lock
        linked_battery_sensor: sensor.car_battery_sensor

There is an integration from HACS but I have to enter a PIN in order to unlock the car. So I created a template lock with the PIN being a part of it. In the original lock in homekit, battery level and charging status are being displayed. And I’d like to have that in my template lock as well?

Or a different approach: Can I modify a lock (coming from the HACS integration) to always send a data payload with the PIN? Then I would not need a template lock.

Appreciate any hint!

1 Like


  code: '1234'

The integration for my EV has a service call that awaits a PIN code for unlocking the car. This is sent in the data: code: format. Obviously, the PIN is not 1234. Nevertheless, it’s a 4-digit PIN. Security-wise not safe at all. :smiley: