Lock


Keeps track which locks are in your environment, their state and allows you to control them.

  • Maintains a state per lock and a combined state all_locks.
  • Registers services lock.lock, lock.unlock and lock.open (unlatch) to control locks.

Building block integration

This lock is a building block integration that cannot be added to your Home Assistant directly but is used and provided by other integrations.

A building block integration differs from the typical integration that connects to a device or service. Instead, other integrations that do integrate a device or service into Home Assistant use this lock building block to provide entities, services, and other functionality that you can use in your automations or dashboards.

If one of your integrations features this building block, this page documents the functionality the lock building block offers.

Services

A lock integration provides the following services:

Service lock.lock

Lock your door, the attribute should appear under a ‘data’ attribute for the service.

Service data attribute Optional Description
entity_id no Entity of the relevant lock.
Example
action:
  service: lock.lock
  target:
    entity_id: lock.my_place

Service lock.unlock

Unlock your door, the attribute should appear under a ‘data’ attribute for the service.

Service data attribute Optional Description
entity_id no Entity of the relevant lock.
Example
action:
  service: lock.unlock
  target:
    entity_id: lock.my_place

Use the services

Go to the Developer Tools, then to Call Service in the frontend, and choose lock.lock, lock.unlock or lock.open from the list of available services (Services: on the left). Enter something like the sample below into the Service Data field and hit CALL SERVICE.

{"entity_id":"lock.front_door"}
Service data attribute Optional Description
entity_id yes Only act on specific lock. Use entity_id: all to target all.