Franck Nijhof 6ca14d3efc
Rename 'service' to 'action' in automations and scripts (#34023)
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2024-07-31 14:37:02 +02:00

2.0 KiB

title, description, ha_category, ha_release, ha_quality_scale, ha_domain, ha_codeowners, ha_integration_type
title description ha_category ha_release ha_quality_scale ha_domain ha_codeowners ha_integration_type
Lock Instructions on how to setup your locks with Home Assistant.
Lock
0.9 internal lock
@home-assistant/core
entity

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 actions lock.lock, lock.unlock, and lock.open (unlatch) to control locks.

{% include integrations/building_block_integration.md %}

Actions

A lock integration provides the following actions:

Action lock.lock

Lock your door, the attribute should appear under a 'data' attribute for the action.

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

Action lock.unlock

Unlock your door, the attribute should appear under a 'data' attribute for the action.

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

Use the actions

Go to the Developer Tools, then to Actions in the frontend, and choose lock.lock, lock.unlock or lock.open from the list of available actions. Enter something like the sample below into the data field and select Perform action.

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