gazoscalvertos / Hass-Custom-Alarm

Yet another take on a home assistant custom alarm
221 stars 94 forks source link

MQTT issue #4

Closed TheCellMC closed 6 years ago

TheCellMC commented 6 years ago

I'm having some trouble getting the MQTT portion of this working. As soon as I discovered that MQTT was added, I updated the custom_component and added mqtt: True to the alarm.yaml. However, I could not figure out what the state and command topics are. So I tried uncommenting all of the options:

 mqtt: True
 state_topic: home/alarm 
 command_topic: home/alarm/set 
 qos: 0 
 payload_disarm: "DISARM" 
 payload_arm_home: "ARM_HOME" 
 payload_arm_away: "ARM_AWAY"
 payload_arm_night: "ARM_NIGHT"

However, I then got an error whilst rebooting HASS

Invalid config for [alarm_control_panel.bwalarm]: [state_topic] is an invalid option for [alarm_control_panel.bwalarm]. Check: alarm_control_panel.bwalarm->state_topic. (See ?, line ?). Please check the docs at https://home-assistant.io/components/alarm_control_panel.bwalarm/ Do you have any idea of what the issue could be?

gazoscalvertos commented 6 years ago

Apologies thats my error the state/command is missing the custom options from the code. Ill upate today.

The default state topic is home/alarm The default command topic is home/alarm/set

TheCellMC commented 6 years ago

Thanks for the help, everything is now working as expected.

On another note, why can't I set the alarm to armed_home when it set to armed_away via a service call?

gazoscalvertos commented 6 years ago

It's due to the logic the system follows.

What circumstance would you use this in?

TheCellMC commented 6 years ago

Sorry for taking too much time to reply. I made some physical buttons to arm the alarm to home and away. However, sometimes I press the wrong button (ie, I arm the alarm to home instead of away). As a result, I have to disarm the alarm and then arm it away again.

I'm also running into another MQTT related issue. I set this component up to work the the MQTT control panel app. However, when the alarm goes to warning, the app does not update. I think the cause of this is that the app can only receive these payloads: disarmed, armed_away, armed_home, pending, triggered. Can this bug be easily fixed on your side or should I contact the app's developer?