Multiple template lock config incorrect doc?

HI,

trying to configure multiple template locks I wonder if there’s anything missing in the way we should set these up.

with sensors, binary_sensors, template_sensors etc we use

sensor:
  - platform: template
    sensors:
      name: 

as described on https://www.home-assistant.io/components/template/#configuration

checking the docs on https://www.home-assistant.io/components/lock.template/#configuration the equivalent line to sensors: in this case would be locks: but that is not described.

Could this be an oversight in the docs, or is it an oversight in the integration setup…

I think I’m having a similar issue. In the following, only the second lock “Pinless Front Door” shows up in the entity registry. I think this may be a bug. Ideally there should be a “locks” attribute for consistency.

- platform: template

  name: 'Pinless Garage Door'
  value_template: "{{ is_state('cover.garage_door_opener', 'open') }}"
  unlock:
    service: cover.open_cover
    data:
      entity_id: cover.garage_door_opener
  lock:
    service: cover.close_cover
    data:
      entity_id: cover.garage_door_opener
      
  name: 'Pinless Front Door'
  value_template: "{{ is_state('lock.schlage_allegion_be469_touchscreen_deadbolt_locked_frontdoor', 'unlocked') }}"
  unlock:
    service: lock.unlock
    data:
      entity_id: lock.schlage_allegion_be469_touchscreen_deadbolt_locked_frontdoor
  lock:
    service: lock.lock
    data:
      entity_id: lock.schlage_allegion_be469_touchscreen_deadbolt_locked_frontdoor

ETA: WORKAROUND

Add - platform: template before each lock definition makes both locks appear in the registry

1 Like

yes, I did so also.
still I feel this is an incorrect and at least inconsistent way of doing so.
filed an issue to be sure this gets some attention: https://github.com/home-assistant/home-assistant/issues/26061