Can I ask how you got this to work? The keypad paired fine. It seems to communicate with the automation in that it triggers it, and it seems to get responses back. If I arm the alarm, the keypad gets the message and glows red. If I run the actions in the blueprint by hand, it arms or disarms the alarm (using alarmo). But the keypad will never arm or disarm the alarm. The trace always looks the same (Option 6 executed). It seems like it is very nearly working, but some detail is wrong. Any help appreciated.
UPDATE: OK, I figured out that I needed to add another 4-digit code to Alarmo for the keypad. I made it the same as the keypad code, so not sure if it because they are the same, or because it needed to be 4 digits, or because it just needed to be a new slot. But now it works. alarm_night_zones is not working, so might try the modifications of @Tykan to the blueprint.
I tried @Tykan 's modification, but it lacked some of the features of the original, so I modded the original instead. All I did was add the night arming feature available on both Alarmo and the Xfinity XHK1-UE keypad. Using this blueprint, you could easily program this button on the keypad to do some other function on your alarm panel, like arm vacation. It is a trivial change to @AndrejDelany 's original blueprint, so I will just add it here.
blueprint:
name: PIN-Keypads for Zigbee2MQTT including Xfinity XHK1-UE
description: This Blueprint allows the synchronisation of an alarm control panel
with a Zigbee2MQTT keypad. This means that the status of the alarm control panel
is transmitted to the keypad and vice versa.
domain: automation
input:
z2m_keypad_path:
name: MQTT State Topic of your Zigbee2MQTT Keypad
description: 'The State Topic is composed of your Zigbee2MQTT base_topic (see
your Z2M Addon Configuration) and the Friendly Name of your keypad in Z2M.
Example: zigbee2mqtt/Keypad'
z2m_keypad_path_set:
name: MQTT Set Topic of your Zigbee2MQTT Keypad
description: 'This is the same as your State Topic, with the addition of /set.
Example: zigbee2mqtt/Keypad/set'
pin:
name: Pincode
description: 'The valid pin code to be accepted as correct by your alarm system.
Example: 1234'
control_panel:
name: Control Panel
description: 'An alarm control panel. Example: https://www.home-assistant.io/integrations/manual'
default: []
selector:
entity:
domain:
- alarm_control_panel
multiple: false
action_arming:
name: Action Arming
description: An action to be performed when the alarm panel changes to the arming
state.
default: []
selector:
action: {}
action_armed_home:
name: Action Armed Home
description: An action to be performed when the alarm panel changes to the armed
home state.
default: []
selector:
action: {}
action_armed_night:
name: Action Armed Night
description: An action to be performed when the alarm panel changes to the armed
away state.
default: []
selector:
action: {}
action_armed_away:
name: Action Armed Away
description: An action to be performed when the alarm panel changes to the armed
away state.
default: []
selector:
action: {}
action_disarmed:
name: Action Disarmed
description: An action to be performed when the alarm panel changes to the disarmed
state.
default: []
selector:
action: {}
action_pending:
name: Action Pending
description: An action to be performed when the alarm panel changes to the pending
state.
default: []
selector:
action: {}
action_panic:
name: Action Panic
description: An action to be performed when the panic / SOS button of the keypad
is pressed.
default: []
selector:
action: {}
source_url: https://community.home-assistant.io/t/zigbee2mqtt-sync-keypad-and-with-alarm-control-panel-states/345311
variables:
pin_var: !input pin
trigger:
- platform: state
entity_id: !input control_panel
to: arming
id: panel_arming
- platform: state
entity_id: !input control_panel
to: armed_home
id: panel_armed_home
- platform: state
entity_id: !input control_panel
to: armed_night
id: panel_armed_night
- platform: state
entity_id: !input control_panel
to: disarmed
id: panel_disarmed
- platform: state
entity_id: !input control_panel
to: armed_away
id: panel_armed_away
- platform: state
entity_id: !input control_panel
to: pending
id: panel_pending
- platform: mqtt
topic: !input z2m_keypad_path
id: keypad_mqtt
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: panel_arming
sequence:
- choose:
- conditions:
- condition: state
entity_id: !input control_panel
state: armed_home
attribute: next_state
sequence:
- service: mqtt.publish
data_template:
topic: !input z2m_keypad_path_set
payload: "{\n \"arm_mode\": \n {\n \"mode\": \"arm_day_zones\"\n }\n}"
- conditions:
- condition: state
entity_id: !input control_panel
state: armed_night
attribute: next_state
sequence:
- service: mqtt.publish
data_template:
topic: !input z2m_keypad_path_set
payload: "{\n \"arm_mode\": \n {\n \"mode\": \"arm_night_zones\"\n }\n}"
- conditions:
- condition: state
entity_id: !input control_panel
state: armed_away
attribute: next_state
sequence:
- service: mqtt.publish
data_template:
topic: !input z2m_keypad_path_set
payload: "{\n \"arm_mode\": \n {\n \"mode\": \"exit_delay\"\n }\n}"
default: []
- choose:
default: !input action_arming
- conditions:
- condition: trigger
id: panel_armed_away
sequence:
- service: mqtt.publish
data_template:
topic: !input z2m_keypad_path_set
payload: "{\n \"arm_mode\": \n {\n \"mode\": \"arm_all_zones\"\n }\n}"
- choose:
default: !input action_armed_away
- conditions:
- condition: trigger
id: panel_disarmed
sequence:
- service: mqtt.publish
data_template:
topic: !input z2m_keypad_path_set
payload: "{\n \"arm_mode\": \n {\n \"mode\": \"disarm\"\n }\n}"
- choose:
default: !input action_disarmed
- conditions:
- condition: trigger
id: panel_armed_home
sequence:
- service: mqtt.publish
data_template:
topic: !input z2m_keypad_path_set
payload: "{\n \"arm_mode\": \n {\n \"mode\": \"arm_day_zones\"\n }\n}"
- choose:
default: !input action_armed_home
- conditions:
- condition: trigger
id: panel_armed_night
sequence:
- service: mqtt.publish
data_template:
topic: !input z2m_keypad_path_set
payload: "{\n \"arm_mode\": \n {\n \"mode\": \"arm_night_zones\"\n }\n}"
- choose:
default: !input action_armed_night
- conditions:
- condition: trigger
id: panel_pending
sequence:
- choose:
default: !input action_pending
- conditions:
- condition: trigger
id: keypad_mqtt
sequence:
- choose:
- conditions:
- condition: template
value_template: '{{ trigger.payload_json.action_transaction != null and
trigger.payload_json.action_code == pin_var }}'
sequence:
- service: mqtt.publish
data_template:
topic: !input z2m_keypad_path_set
payload: "{\n \"arm_mode\": \n {\n \"transaction\": \"{{ trigger.payload_json.action_transaction
}}\",\n \"mode\": \"{{ trigger.payload_json.action }}\"\n }\n}"
- choose:
- conditions:
- condition: template
value_template: '{{ trigger.payload_json.action_code == pin_var and trigger.payload_json.action
== "arm_all_zones" }}'
sequence:
- service: alarm_control_panel.alarm_arm_away
target:
entity_id: !input control_panel
data:
code: !input pin
- conditions:
- condition: template
value_template: '{{ trigger.payload_json.action_code == pin_var and trigger.payload_json.action
== "arm_night_zones" }}'
sequence:
- service: alarm_control_panel.alarm_arm_night
target:
entity_id: !input control_panel
data:
code: !input pin
- conditions:
- condition: template
value_template: '{{ trigger.payload_json.action_code == pin_var and trigger.payload_json.action
== "arm_day_zones" }}'
sequence:
- service: alarm_control_panel.alarm_arm_home
target:
entity_id: !input control_panel
data:
code: !input pin
- conditions:
- condition: template
value_template: '{{ trigger.payload_json.action_code == pin_var and trigger.payload_json.action
== "disarm" }}'
sequence:
- service: alarm_control_panel.alarm_disarm
target:
entity_id: !input control_panel
data:
code: !input pin
- conditions:
- condition: template
value_template: '{{ trigger.payload_json.action == "panic" }}'
sequence:
- choose:
default: !input action_panic
- conditions:
- condition: template
value_template: '{{ trigger.payload_json.action_code != pin_var and trigger.payload_json.action_code
| int(-1) != -1 }}'
sequence:
- service: mqtt.publish
data_template:
topic: !input z2m_keypad_path_set
payload: "{\n \"arm_mode\": \n {\n \"transaction\": \"{{ trigger.payload_json.action_transaction
}}\",\n \"mode\": \"invalid_code\"\n }\n}"
- conditions:
- condition: template
value_template: '{{ trigger.payload_json.action == None }}'
sequence:
- choose:
- conditions:
- condition: state
entity_id: !input control_panel
state: armed_away
sequence:
- service: mqtt.publish
data_template:
topic: !input z2m_keypad_path_set
payload: "{\n \"arm_mode\": \n {\n \"mode\": \"arm_all_zones\"\n
\ }\n}"
- conditions:
- condition: state
entity_id: !input control_panel
state: armed_home
sequence:
- service: mqtt.publish
data_template:
topic: !input z2m_keypad_path_set
payload: "{\n \"arm_mode\": \n {\n \"mode\": \"arm_day_zones\"\n
\ }\n}"
- conditions:
- condition: state
entity_id: !input control_panel
state: armed_night
sequence:
- service: mqtt.publish
data_template:
topic: !input z2m_keypad_path_set
payload: "{\n \"arm_mode\": \n {\n \"mode\": \"arm_night_zones\"\n
\ }\n}"
- conditions:
- condition: state
entity_id: !input control_panel
state: disarmed
sequence:
- service: mqtt.publish
data_template:
topic: !input z2m_keypad_path_set
payload: "{\n \"arm_mode\": \n {\n \"mode\": \"disarm\"\n }\n}"
- conditions:
- condition: state
entity_id: !input control_panel
state: arming
- condition: state
entity_id: !input control_panel
state: armed_home
attribute: next_state
sequence:
- service: mqtt.publish
data_template:
topic: !input z2m_keypad_path_set
payload: "{\n \"arm_mode\": \n {\n \"mode\": \"arm_day_zones\"\n
\ }\n}"
- conditions:
- condition: state
entity_id: !input control_panel
state: arming
- condition: state
entity_id: !input control_panel
state: armed_night
attribute: next_state
sequence:
- service: mqtt.publish
data_template:
topic: !input z2m_keypad_path_set
payload: "{\n \"arm_mode\": \n {\n \"mode\": \"arm_night_zones\"\n
\ }\n}"
- conditions:
- condition: state
entity_id: !input control_panel
state: arming
- condition: state
entity_id: !input control_panel
state: armed_away
attribute: next_state
sequence:
- service: mqtt.publish
data_template:
topic: !input z2m_keypad_path_set
payload: "{\n \"arm_mode\": \n {\n \"mode\": \"arm_all_zones\"\n
\ }\n}"
default: []
default: []
mode: parallel
max: 10
Wasnāt there so I created it and the blueprint is now available, havenāt got it working exactly as I wanted but at least I now have something to work with.
Many thanks for helping me out
.
And obviously many thanks to @AndrejDelany for the blueprint
unfortunately the import button seems to be broken.
I canāt import as the link doesnāt point to a valid YAML file.
My I kindly ask the author to fix this? Or provide a link to github or similar?
@semtex as the developer is sharing his code you can easily grab it and create your own thankfully. Just Create copy it in .yaml (whatever his name) and place it in /config/blueprint/automation . Then reload your yaml config in Development tools, it should appears in your Blueprints . @AndrejDelany A big thanks, now I can enjoy my Frient Keypad, it works like a charm
Seems like the Import Bluetooth link refers to this page rather than point to actual page where the blueprint resides at. For example, when I try to import this blueprint, on the HA diaglog, the Blueprint address shows up as:
However, if I try to add another blueprint from here (for example, Pause Climate Entityā¦ Pause climate entity when window/ door open ), on the HA dialog the following address shows up:
I have now figured out what the problem is. Home Assistant can apparently only import the yaml code from this forum if there is only one code element in the first post. I have now marked the example code for the alarm panel as a quote rather than code. Now it works.
Hello! I wanted to point out that starting from the latest version of Home Assistant, the invocation service mqtt.publish has been changed.
The definition has changed from:
service: mqtt.publish
data_template:
topic:
to this:
service: mqtt.publish
data:
topic:
Where the data_template entry has been simplified to just data.
The automation of the blueprint gives an error on the mqtt_publish service, and changing this will resolve the issue.