alexa_media_player: Guard state not updated in Home Assistant

I have no problems enabling Alexa Guard mode using this component. When I do, the button I press in lovelace changes color to show the status of whether Alexa Guard has been enabled or disabled.

However if Alexa Guard is enabled or disabled by saying to the Amazon echo, “I’m leaving”, or disabled by saying “I’m home”, the state for Alexa Guard doesn’t change in Home Assistant. It remains “disarmed” whether Alexa Guard is enabled or not.

After enabling Alexa Guard by saying to Amazon echo, “I’m leaving”, I get the following log entries:

2019-07-15 23:30:27 DEBUG (SyncWorker_1) [alexapy.alexaapi] get_guard_state response: {'deviceStates': [{'entity': {'entityId': 'AAA_OnGuardSmartHomeBridgeService_XXX', 'entityType': ''}, 'capabilityStates': ['{"namespace":"Alexa.SecurityPanelController","name":"armState","value":"ARMED_STAY","timeOfSample":"2019-07-16T03:30:27.821Z","uncertaintyInMilliseconds":0,"deepQuery":true,"timeOfStateChange":""}'], 'error': None}], 'errors': []}

Upon turning off Alexa Guard by saying, “I’m Home”, I get the following log entries:

2019-07-15 23:33:03 DEBUG (SyncWorker_2) [alexapy.alexaapi] get_guard_state response: {'deviceStates': [{'entity': {'entityId': 'AAA_OnGuardSmartHomeBridgeService_XXX', 'entityType': ''}, 'capabilityStates': ['{"namespace":"Alexa.SecurityPanelController","name":"armState","value":"ARMED_AWAY","timeOfSample":"2019-07-16T03:33:03.186Z","uncertaintyInMilliseconds":0,"deepQuery":true,"timeOfStateChange":""}'], 'error': None}], 'errors': []}

EDIT: Formatting/obfuscation

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 23 (9 by maintainers)

Most upvoted comments

Oh wait, I think I know. At line 158 add self.schedule_update_ha_state() Should look like this:

        _LOGGER.debug("%s: Alarm State: %s", self.account, self.state)
        self.schedule_update_ha_state()