You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I checked for similar existing issues (both open and closed) before posting.
I am running the latest version.
Expected behavior
No warnings/errors on startup.
Actual behavior
Warnings appear in log during startup before alarmo is loaded. I think alarmo is accepting MQTT state updates before it is ready?
Restart when armed in Home mode
2021-09-09 16:09:09 DEBUG (MainThread) [custom_components.alarmo.alarm_control_panel] alarm_arm_home
2021-09-09 16:09:09 WARNING (MainThread) [custom_components.alarmo.alarm_control_panel] Mode armed_home is not supported, ignoring.
2021-09-09 16:09:09 DEBUG (MainThread) [custom_components.alarmo.alarm_control_panel] alarm_control_panel.alarmo is added to hass
2021-09-09 16:09:09 DEBUG (MainThread) [custom_components.alarmo.alarm_control_panel] Initial state is armed_home
2021-09-09 16:09:09 DEBUG (MainThread) [custom_components.alarmo.alarm_control_panel] Waiting for all sensors to be ready...
Restart when armed in Away mode
2021-09-09 16:22:55 DEBUG (MainThread) [custom_components.alarmo.alarm_control_panel] alarm_arm_away
2021-09-09 16:22:55 WARNING (MainThread) [custom_components.alarmo.alarm_control_panel] Mode armed_away is not supported, ignoring.
2021-09-09 16:22:55 DEBUG (MainThread) [custom_components.alarmo.alarm_control_panel] alarm_control_panel.alarmo is added to hass
2021-09-09 16:22:55 DEBUG (MainThread) [custom_components.alarmo.alarm_control_panel] Initial state is armed_away
2021-09-09 16:22:55 DEBUG (MainThread) [custom_components.alarmo.alarm_control_panel] Waiting for all sensors to be ready...
2021-09-09 16:36:09 DEBUG (MainThread) [custom_components.alarmo.alarm_control_panel] alarm_disarm
2021-09-09 16:36:09 ERROR (MainThread) [homeassistant.util.logging] Exception in async_message_received when handling msg on 'alarmo/command': '{"command":"DISARM","code":"XXXX"}'
Traceback (most recent call last):
File "/config/custom_components/alarmo/mqtt.py", line 259, in async_message_received
await entity.async_alarm_disarm(code, skip_code)
File "/config/custom_components/alarmo/alarm_control_panel.py", line 322, in async_alarm_disarm
(res, info) = self._validate_code(code, STATE_ALARM_DISARMED)
File "/config/custom_components/alarmo/alarm_control_panel.py", line 283, in _validate_code
if state == STATE_ALARM_DISARMED and not self._config[const.ATTR_CODE_DISARM_REQUIRED]:
KeyError: 'code_disarm_required'
Traceback (most recent call last):
File "/config/custom_components/alarmo/mqtt.py", line 259, in async_message_received
Restart when disarmed
2021-09-09 17:16:33 DEBUG (MainThread) [custom_components.alarmo.alarm_control_panel] alarm_disarm
2021-09-09 17:16:33 INFO (SyncWorker_1) [pychromecast] Querying device status
2021-09-09 17:16:33 ERROR (MainThread) [homeassistant.util.logging] Exception in async_message_received when handling msg on 'alarmo/command': '{"command":"DISARM","code":"XXXX"}'
Traceback (most recent call last):
File "/config/custom_components/alarmo/mqtt.py", line 259, in async_message_received
await entity.async_alarm_disarm(code, skip_code)
File "/config/custom_components/alarmo/alarm_control_panel.py", line 322, in async_alarm_disarm
(res, info) = self._validate_code(code, STATE_ALARM_DISARMED)
File "/config/custom_components/alarmo/alarm_control_panel.py", line 283, in _validate_code
if state == STATE_ALARM_DISARMED and not self._config[const.ATTR_CODE_DISARM_REQUIRED]:
KeyError: 'code_disarm_required'
2021-09-09 17:16:34 INFO (MainThread) [homeassistant.components.select] Setting up select.zwave_js
2021-09-09 17:16:34 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.zwave_js
2021-09-09 17:16:34 INFO (MainThread) [homeassistant.components.fan] Setting up fan.zwave_js
2021-09-09 17:16:34 DEBUG (MainThread) [custom_components.alarmo.alarm_control_panel] alarm_control_panel.alarmo is added to hass
2021-09-09 17:16:34 DEBUG (MainThread) [custom_components.alarmo.alarm_control_panel] Initial state is disarmed
2021-09-09 17:16:34 DEBUG (MainThread) [custom_components.alarmo.alarm_control_panel] entity alarm_control_panel.alarmo was updated from None to disarmed
Duplicate of #249
Please continue the discussion here (feel free to copy your issue to there).
Retain MQTT Message in app setting makes no difference (occurs when either on or off).
I have my doubts about this.
It is almost certain to me that you try to arm/disarm alarmo through MQTT immediately upon startup of HA.
Alarmo is not ready for messages during initialization, it is built to restore its previous state.
You should try some 'mqtt sniffer' application (e.g. mosquitto_sub for linux) and see what traffic happens on the command topic.
Maybe the topic needs to be 'wiped' after removing the retain setting. I once made a little script for that, but it comes down to writing null to the topic.
Funny that you keep your own issue list for problems in your setup 😄
I apologize for the dupe, it didn't appear to be a related issue to me.
I finally had a chance to play with this. My mqtt broker was retaining a command topic that must have got sent when the retained setting got turned on and wasn't deleting it when the setting was turned off. I deleted the command topic in my broker, cleared the cache in the app and all seems ok now.
Checklist
Expected behavior
No warnings/errors on startup.
Actual behavior
Warnings appear in log during startup before alarmo is loaded. I think alarmo is accepting MQTT state updates before it is ready?
Restart when armed in Home mode
Restart when armed in Away mode
2021-09-09 16:36:09 DEBUG (MainThread) [custom_components.alarmo.alarm_control_panel] alarm_disarm
2021-09-09 16:36:09 ERROR (MainThread) [homeassistant.util.logging] Exception in async_message_received when handling msg on 'alarmo/command': '{"command":"DISARM","code":"XXXX"}'
Traceback (most recent call last):
File "/config/custom_components/alarmo/mqtt.py", line 259, in async_message_received
await entity.async_alarm_disarm(code, skip_code)
File "/config/custom_components/alarmo/alarm_control_panel.py", line 322, in async_alarm_disarm
(res, info) = self._validate_code(code, STATE_ALARM_DISARMED)
File "/config/custom_components/alarmo/alarm_control_panel.py", line 283, in _validate_code
if state == STATE_ALARM_DISARMED and not self._config[const.ATTR_CODE_DISARM_REQUIRED]:
KeyError: 'code_disarm_required'
Traceback (most recent call last):
File "/config/custom_components/alarmo/mqtt.py", line 259, in async_message_received
Restart when disarmed
2021-09-09 17:16:33 DEBUG (MainThread) [custom_components.alarmo.alarm_control_panel] alarm_disarm
2021-09-09 17:16:33 INFO (SyncWorker_1) [pychromecast] Querying device status
2021-09-09 17:16:33 ERROR (MainThread) [homeassistant.util.logging] Exception in async_message_received when handling msg on 'alarmo/command': '{"command":"DISARM","code":"XXXX"}'
Traceback (most recent call last):
File "/config/custom_components/alarmo/mqtt.py", line 259, in async_message_received
await entity.async_alarm_disarm(code, skip_code)
File "/config/custom_components/alarmo/alarm_control_panel.py", line 322, in async_alarm_disarm
(res, info) = self._validate_code(code, STATE_ALARM_DISARMED)
File "/config/custom_components/alarmo/alarm_control_panel.py", line 283, in _validate_code
if state == STATE_ALARM_DISARMED and not self._config[const.ATTR_CODE_DISARM_REQUIRED]:
KeyError: 'code_disarm_required'
2021-09-09 17:16:34 INFO (MainThread) [homeassistant.components.select] Setting up select.zwave_js
2021-09-09 17:16:34 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.zwave_js
2021-09-09 17:16:34 INFO (MainThread) [homeassistant.components.fan] Setting up fan.zwave_js
2021-09-09 17:16:34 DEBUG (MainThread) [custom_components.alarmo.alarm_control_panel] alarm_control_panel.alarmo is added to hass
2021-09-09 17:16:34 DEBUG (MainThread) [custom_components.alarmo.alarm_control_panel] Initial state is disarmed
2021-09-09 17:16:34 DEBUG (MainThread) [custom_components.alarmo.alarm_control_panel] entity alarm_control_panel.alarmo was updated from None to disarmed
Steps to Reproduce
Alarmo MQTT enabled
MQTT alarm panel connected to broker (I'm using Android MQTT Alarm Panel)
Restart HA
Errors appear in log during restart.
After startup errors do not occur after startup, everything works as expected
Errors do not occur when MQTT alarm panel is not connected to broker even if MQTT enabled.
Retain MQTT Message in app setting makes no difference (occurs when either on or off).
The text was updated successfully, but these errors were encountered: