Alarm control panel
The alarm control panel integration is the one behind every alarm system in Home Assistant. Most of them want a code to arm or disarm, 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 alarm panel at a time, in its settings. Spook adds an action that sets it from an automation or a script, on as many alarm panels as you like.
Actions
Spook adds one action to the alarm control panel integration. You find it wherever you add an action, marked with a 👻.
Set default code
Sets the code one or more alarm control panels use when an action gives none.
The same setting as Default code in the settings of an alarm control panel. Set it, and the automation that arms the house when the last person leaves does not need the code written in it.
Home Assistant hands an alarm panel its default code whatever the panel says about codes, so any alarm panel takes one. That includes panels that want a code to arm without saying what it looks like, like many MQTT alarm panels, which cannot be armed from a dashboard without one.
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
- Open the automation or script that should do this, and select Add action.
- Search for default code, and select Alarm control panel: Set default code 👻.
- Under Entity, pick the alarm control panels.
- Type the code under Default code.
- Select Save.
Just want to see it work? Try this action opens it in your Home Assistant, ready to run once.
| Action properties | |
|---|---|
| Action | Alarm control panel: Set default code 👻 |
| Action name | alarm_control_panel.set_default_code |
| Action targets | No |
| Action response | No response |
| Spook's influence | Newly added action |
| Tools | Try this action |
| Action data parameters | |||
|---|---|---|---|
| Attribute | Type | Required | Default / Example |
entity_id | string or list | Yes | "alarm_control_panel.house" |
default_code | string or null | Yes | "1234" |
An empty default_code, or null, takes the code away. Put a code in quotes in YAML: unquoted, a code with a leading zero is read as a number, and loses it.
Every alarm control panel you name is checked before any of them are changed. If one of them does not exist, the whole call fails and nothing is touched.
A default code for the house alarm:
action: alarm_control_panel.set_default_code
data:
entity_id: alarm_control_panel.house
default_code: "1234"
And taking it away again:
action: alarm_control_panel.set_default_code
data:
entity_id: alarm_control_panel.house
default_code: null
- Only alarm control panels with a unique ID can be changed, the same ones that have settings in the UI.
- With a default code set, anybody who can press the button on your dashboard arms and disarms the alarm. Keep that in mind before you set one.
- The code is in the action data of your automation or script, and so in its traces, like anything else you write there.
- Home Assistant writes the data of every action call, the code included, in its own log when
homeassistant.corelogs at debug level, and in the recorder's database as part of the event for the call. Spook cannot keep it out of either. - A
!secretdoes not keep it out of any of these: Home Assistant reads the secret before the action runs, and from then on it is the code itself. - Changing these settings is for admins, the same as in the UI. An automation or a script can still use it.
Use cases
What people use this for:
- Arm the alarm from an automation when the last person leaves, without the code in the automation.
- Set the same code on every alarm panel 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.
