Integrations

Lock

Spook adds an action to the lock integration of Home Assistant that sets the default code of locks, so a dashboard or automation does not ask for it.

The lock integration is the one behind every smart lock in Home Assistant. Some locks want a code for every lock or unlock, and Home Assistant can keep a default code for those, so a dashboard button or an automation does not have to ask.

Home Assistant offers that setting one lock at a time, in its settings. Spook adds an action that sets it from an automation or a script, on as many locks as you like.

Actions

Spook adds one action to the lock integration. You find it wherever you add an action, marked with a 👻.

Set default code

Sets the code one or more locks use when an action gives none.

The same setting as Default code in the settings of a lock. Set it on the front door lock, and the button on your dashboard unlocks it without asking for the code every time. Set it from an automation, and take it away again when you leave the house.

A lock only uses a default code that fits its code format, like four digits. A code that does not fit, or a lock that takes no code at all, is refused, with a message that names the lock and never the code.

A code is a secret. Spook itself never writes it in a log, never repeats it in an error, and never shows it back to you. Home Assistant does keep it in a few places of its own: see the known limitations. To take a code away, set it again, empty.

How to use it

  1. Open the automation or script that should do this, and select Add action.
  2. Search for default code, and select Lock: Set default code 👻.
  3. Under Entity, pick the locks.
  4. Type the code under Default code.
  5. Select Save.

Just want to see it work? Try this action opens it in your Home Assistant, ready to run once.

Use cases

What people use this for:

  • Put a default code on the front door lock so the dashboard does not ask for it, and take it away when everybody leaves.
  • Set the same code on every lock in the house in one action, instead of opening each one in the UI.

Missing something here?

An action, an entity or a repair this integration should have? Say so. Stuck, or found a bug? There is help.