Alarm Control Panel pass disarm code with command

I’m using the MQTT Alarm Control Panel to control a Cytech Comfort alarm system. I want to pass the disarm code along with the disarm payload to the alarm. The documentation mentions command_template which has the available variables: action and code. This sounds like it might work, but I’m unsure how to use it.
Has anyone got this to work?

Are you wanting to do this in automation?
Below items should be used in automation action

service: alarm_control_panel.alarm_disarm
entity_id: alarm_control_panel.your_alarm
code: xxxx

Thanks @tmjpugh, I was just trying to get the MQTT alarm control panel to publish the security code that is entered on the alarm panel along with the command (arm, disarm, etc.). By default, only the command is published.
With a bit of experimentation , I managed to get it working. For the record, here is my config:

alarm_control_panel:
  - platform: mqtt
    name: 'Comfort Alarm'
    state_topic: 'homeassistant/alarm/comfort/alarm_mode/status'
    command_topic: "homeassistant/alarm/comfort/alarm_mode/set"
    code_arm_required: true
    code_disarm_required: true
    code: '1234'
    payload_arm_away: 'away'
    payload_arm_home: 'day'
    payload_arm_night: 'night'
    payload_disarm: 'off'
    command_template: "{{action}}, {{code}}"

Does that actually work for you or is it just always using the code from your yaml file?
I have multiple codes configured in my paradox system, but only the one in the yaml file even triggers a mqtt message to be sent. It seems the yaml code entry is for hassio to enforce a code. It doesn’t blindly pass it along to the panel.

I was hoping to have it use whatever code is entered in the UI, but if I don’t include a code yaml entry then I don’t get the keypad in the UI.

Hello Sota,

its just i need but how sent the “code” and “action” with an arduino, i succeed to change the “state” with

client.publish("home/alarm/set", armed_away, true);

but because my alarm panel need a code in the front end to arm/disarm, it doesnt work when i publish this.

How publish the action + code please? i dont understand how the “command_template” work, i have only understand how the “command_topic” work…sorry…noob question perhaps…

Thanks

The command_template sets what items are included in the state topic. For my system, it needed to have the arm/disarm command and then the security code.
So for my system to disarm it publishes to the topic homeassistant/alarm/comfort/alarm_mode/set and the payload is off,1234
I would suggestt that you use MQTT Explorer to find what combination of topic and payload works and then plug that into the configuration.
Also, you will need to know what arm/disarm payloads your system accepts and then put those into the payload_arm_away: etc. setting as well. On my system payload_arm_away: is translated to away, which is what it expects.
Hope this helps.

1 Like

thanks for your reply!

its resolved! i have not set the right payload…

thanks