Help me understand Manual Alarm Control Panel with MQTT Support

Hello all,

I’m trying really hard to understand how that component should workd but I miss a point somewhere.
1- I have this config (copy/paste from the doc)

alarm_control_panel:
  - platform: manual_mqtt
    name: Home Alarm
    state_topic: home/alarm
    command_topic: home/alarm/set
    code: 0406
    pending_time: 30
    delay_time: 20
    trigger_time: 4
    disarmed:
      trigger_time: 0
    armed_home:
      pending_time: 0
      delay_time: 0

2- I then get an Home Alarm icon on my main screen. If I try to arm or disarm using the PIN code above. I just get this error in log

Invalid code given for armed_away

3- trying to call the service from dev tool will just fail the same way.

4- however, publishing a MQTT message (topic: home/alarm/set, payload: DISARM) without any PIN code will arm and disarm no problem (so what the point to have a PIN code in the configuration?)

So: am I suppose to use the alam panel only through MQTT? Or am I doing something wrong?

I can’t comment on points #2 and #3 because I do not use Manual Alarm Control Panel with MQTT Support. I’m using MQTT Alarm Control Panel and the pin-code works as advertized.

Regarding point #4:

It’s a minimal form of authentication to prevent anyone from arming/disarming the alarm panel. Given that your alarm panel has no native authentication (simply publishing to home/alarm/set is all it takes) the pin-code is used by the Frontend to challenge the user.

Yeah I know what is the purpose of a PIN code. I mean in this situation it fails if you try to arm with the PIN code, so what is the point to include a parameter that do not work as expected? I spent a few hour trying to figure out what was wrong in my setup. I was using simple Alarm Panel before switching to MQTT and PIN code was working fine.

Obviously the developers believe it works. If you think it’s a bug, file an issue in github.

try loading your code entry like this

code: “0406”

That did the trick. Or it is the latest update (as I did the two changes before rebooting).

FWIW, I’m using the other component (MQTT Alarm Control Panel) in 0.80, the pin-code is not delimited, and it works fine.

In my case, the pin-code is stored in secrets.yaml.

In configuration.yaml the relevant entry looks like this:
code: !secret alarm_panel_code
In secrets.yaml the corresponding variable looks like this (no delimiters):
alarm_panel_code: 9999

One way to determine what actually “did the trick” is to remove the " delimiters, restart HA, and see if the problem returns or it continues to work correctly.

BTW, I’ve looked at the the most recent closed Pull Request for this component (Manual Alarm Control Panel for 0.84.3) but it deals with restoring the state. I see no mention of it changing the way it handles the pin-code. Curious.

Try use the touch screen to enter the numbers.
If I use the keyboard, it don’t work.

1 Like