In coordinator mode the keypad can run automations itself - no hub, no cloud. Rules
react to PINs, control keys, sensors and time, and drive the Zigbee devices paired to the
keypad.
Build them in the dashboard's Automations tab. Every rule has two views of the same thing:
the form builder (dropdowns) and the code view (plain text). They stay in sync - build
with the form and fine-tune as text, or write the text and check it in the form.
Using Home Assistant mode? Build your automations in Home Assistant instead. The keypad
exposes entities there (Keypad State, Active Pin Number, control keys...) - see the
User Guide. This page is for the keypad's
own on-device automations (coordinator mode).
A rule is a set of lines:
name and enabled / disabled - what it is called and whether it runs.when) - the rule runs when any of them fires.if) - all must be true when the rule runs.then) - run in order.when| Syntax | Fires when |
|---|---|
when state <entity> |
the entity changes |
when state <entity> <op> <value> |
it changes to a value matching =, !=, <, <=, >, >= |
when state <entity> between <lo> and <hi> |
the new value is inside the range |
when state <entity> from <a> to <b> |
the transition matches (from / to alone are also allowed) |
when pin <n> |
the PIN with switch number n is entered |
when time HH:MM[:SS] |
once a day at that time (needs the clock set) |
ifAll if lines must be true when the rule runs.
| Syntax | True when |
|---|---|
if <entity> <op> <value> |
=, !=, <, <=, >, >= |
if <entity> between <lo> and <hi> |
the value is inside the range |
if <entity> changed |
the value changed on this run |
if <entity> changed from <a> to <b> |
the transition matches |
if time <op> HH:MM[:SS] |
comparison against the current time of day |
if time between HH:MM[:SS] and HH:MM[:SS] |
time of day in range - an end time earlier than the start (e.g. 22:00 to 06:00) means the window runs overnight |
thenActions run in order.
| Syntax | Does |
|---|---|
then set_binary <entity> <on/off> |
turn a switch/binary on or off |
then toggle_binary <entity> |
toggle it |
then set_analog <entity> <value> |
set a number/analog value |
then offset_analog <entity> <delta> |
add/subtract (e.g. -10) |
then cover_open <entity> |
open a cover |
then cover_close <entity> |
close a cover |
then cover_toggle <entity> |
toggle a cover |
then cover_position <entity> <0-100> |
move a cover to a position |
then set_color <entity> #rrggbb [brightness%] |
set a color light (optional brightness) |
Ids are typed by prefix: binary.* (on/off), sensor.* (readings), number.*
(analog/number) and cover.* (covers). The keypad itself also exposes three local entities:
| Entity | Meaning |
|---|---|
binary.armed |
the keypad is armed (read/write) |
number.last_pin |
the switch number of the last accepted PIN |
sensor.battery |
keypad battery percentage |
Use the entity dropdown in the builder - it shows name (id) - value - to copy the exact id.
when time and if time need a real clock, and the keypad has no clock battery - it syncs
the time over the network. So a time trigger needs:
pool.ntp.org is fine for most people).Until the clock has synced at least once, rules with a time trigger cannot match a time.
The Automations tab shows a banner at the top when something would stop your rules working:
| Banner | Shown when | Fix |
|---|---|---|
| Sleep may block this automation | Sleep is enabled and a rule needs periodic checks (time or sensor triggers) | Press Disable sleep, or set a long timeout in Settings |
| You have an automation that requires a time trigger | A rule uses when time / if time, but the clock is not synced - usually no Wi-Fi (AP mode), no timezone, or the keypad is asleep |
Press Go to Host Configuration and set Wi-Fi + timezone |
Deep sleep stops automations. If your rules rely on time or sensors, either disable
sleep or set a long timeout in Settings.
Units and automations: a reading is compared in the unit you picked for that endpoint,
so if you change a unit, update any automation that uses that entity (a threshold of25
means something different in C and F).
Turn on a light when a PIN is entered after dark:
name Porch light on PIN
enabled
when pin 7
if time between 18:00 and 06:00
then set_binary binary.porch_light on
18:00 to 06:00 crosses midnight, and that's fine: when the end time is earlier than the
start time, the keypad treats the window as overnight (true from 18:00 until 06:00 the next
morning). This rule runs on the keypad itself, not in Home Assistant, so the HA limitations
around overnight windows don't apply.
Close all covers at a fixed time every night:
name Covers closed at night
enabled
when time 23:30:00
then cover_close cover.all
Color a lamp from a control key:
name Control key A - party color
enabled
when state binary.control_key_a to ON
then set_color number.lamp_color #ff00ff 80
Silence the siren and re-arm from a PIN:
name Silence siren and re-arm on PIN
enabled
when pin 1
then set_binary binary.siren off
then set_binary binary.armed on