core: Honeywell Lyrics becomes unavailable every 4 to 8 hours

The problem

OK so here goes… first, I’m not a programmer and HA is a bit overwhelming. My goal is to turn my HVAC off when someone leaves a door open for too long. My alarm system is Alarm.com. In the configuration file, I’ve setup the Honeywell Lyrics integration per the instructions. I’ve setup HA to read notification emails from Alarm.com and I’ve setup an automation to turn the HVAC off or on based on the subject of the email. I believe this all works fine until Lyrics becomes unavailable. When Lyrics does become unavailable, I am still able to see both Honeywell T9 thermostats on my app. Reauthorization is simple without any issues… its just a pain.

What is version of Home Assistant Core has the issue?

core-2021.5.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Honeywell Lyrics

Link to integration documentation on our website

No response

Example YAML snippet

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
lyric:
  client_id: xxxxxxxxxxxxxxxxxxxx
  client_secret: yyyyyyyyyyyyyyy
sensor:
  - platform: imap_email_content
    server: imap.gmail.com
    name: doors_status
    port: 993
    username: zzzzzzzzzzz@gmail.com
    password: xxxxxxxxxxxxx
    senders:
      - notifications@alarm.com
    value_template: >-
      {% if 'Door was left open' in subject %}
        doors_are_open
      {% elif 'issued a Sensor-Left-Open restoral' in subject %}
        doors_are_closed
      {% endif %}

Anything in the logs that might be useful for us?

2021-06-01 05:59:07 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.doors_status is taking over 10 seconds
2021-06-01 05:59:37 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.doors_status is taking over 10 seconds
2021-06-01 06:00:07 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.doors_status is taking over 10 seconds
2021-06-01 06:00:37 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.doors_status is taking over 10 seconds
2021-06-01 06:00:58 ERROR (SyncWorker_4) [homeassistant.components.imap_email_content.sensor] Failed to reconnect
2021-06-01 06:01:37 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.doors_status is taking over 10 seconds
2021-06-01 06:01:59 ERROR (MainThread) [homeassistant.components.lyric] Authentication failed while fetching lyric_coordinator data: {'request': {'method': 'GET', 'url': 'https://api.honeywell.com/v2/locations?apikey=xxxxxxxxxxxxxxxxxxx', 'headers': {'Authorization': 'Bearer xxxxxxxxxxxxxxxxxxxx', 'Content-Type': 'application/json'}}, 'response': {'code': 'Unauthorized', 'message': 'Authorization has been denied for this request '}, 'status': 401}

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 4
  • Comments: 98 (9 by maintainers)

Most upvoted comments

Been happening constantly recently, not sure what is happening and havent had time to investigate. In the latest beta we reduced the calls to the api but it hasnt seemed to help (at least for myself)

`alias: Algemeen) Honeywell Unavailable description: ‘’ trigger:

  • platform: time_pattern minutes: /5 condition:
  • condition: state entity_id: climate.mijn_thermostaat state: unavailable action:
  • service: homeassistant.update_entity target: entity_id: climate.mijn_thermostaat mode: single `

This automation helps to fix it not ideal but a fix for now

Yes. There Is a reset option under settings. Don’t worry about wifi or other configs they Will remain as they are.

Il mer 3 nov 2021, 13:00 Oulewappeur @.***> ha scritto:

Under settings on your T6 menù u have to do reset of device so that u Will able to see It on your HA integration as HomeKit device. Il mer 3 nov 2021, 12:36 Oulewappeur @.***> ha scritto: … <#m_8931383446346228039_> I try to move back to homekit, But somehow my old connection is still active and I can’t pair my thermostat. If I check the Honeywell Home app on my mobile phone it still shows up “Home Assistant” as connected service. Any ideas how to drop this service? I can’t find anything in HomeAssistant. Delete your app in the developer portal? Already done, but the HomeKit integration is not related to the Honeywell Dev Apps. Well, I deleted the app and added my T6 on device to HK without any problems. Maybe some leftover configuration in HA? You used Homekit or Homekit Controller integration? — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#51344 (comment) https://github.com/home-assistant/core/issues/51344#issuecomment-958948356>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABG2J6QLWBLKEVQZVAXFSOTUKENEVANCNFSM455CELMA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .

You mean on the physical device itself?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/51344#issuecomment-958963129, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABG2J6VWX5GDNX2QJ7JTFB3UKEP4TANCNFSM455CELMA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Any chance you can provide the NodeRed config? Would love to add this into mine.

Node Red config for anyone interested:

[{"id":"e6a08422065e2879","type":"tab","label":"Honeywell Lyric Watchdog","disabled":false,"info":""},{"id":"5795810d89b8914c","type":"server-state-changed","z":"e6a08422065e2879","name":"","server":"c0337d1c.d3c23","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"^climate\\..*$","entityidfiltertype":"regex","outputinitially":false,"state_type":"str","haltifstate":"unavailable","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":160,"y":340,"wires":[["bbed887326cb947f"],[]]},{"id":"bbed887326cb947f","type":"api-call-service","z":"e6a08422065e2879","name":"","server":"c0337d1c.d3c23","version":3,"debugenabled":false,"service_domain":"homeassistant","service":"update_entity","entityId":"climate.hvacmainfloor, climate.hvacupstairs","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":500,"y":280,"wires":[["5bea7ded3087efef","472054dc50fffa27"]]},{"id":"e63087135d0c406b","type":"stoptimer","z":"e6a08422065e2879","duration":"1","units":"Minute","payloadtype":"num","payloadval":"0","name":"","x":1180,"y":180,"wires":[["bbed887326cb947f"],[]]},{"id":"5bea7ded3087efef","type":"api-current-state","z":"e6a08422065e2879","name":"","server":"c0337d1c.d3c23","version":2,"outputs":2,"halt_if":"unavailable","halt_if_type":"str","halt_if_compare":"is","entity_id":"climate.hvacmainfloor","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":850,"y":260,"wires":[["e63087135d0c406b"],[]]},{"id":"472054dc50fffa27","type":"api-current-state","z":"e6a08422065e2879","name":"","server":"c0337d1c.d3c23","version":2,"outputs":2,"halt_if":"unavailable","halt_if_type":"str","halt_if_compare":"is","entity_id":"climate.hvacupstairs","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":840,"y":320,"wires":[["e63087135d0c406b"],[]]},{"id":"b1a28b1220e9674c","type":"inject","z":"e6a08422065e2879","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":190,"y":460,"wires":[["bbed887326cb947f"]]},{"id":"e746488d5defe33b","type":"poll-state","z":"e6a08422065e2879","name":"","server":"c0337d1c.d3c23","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"10","updateIntervalUnits":"minutes","outputinitially":false,"outputonchanged":false,"entity_id":"climate.hvacupstairs","state_type":"str","halt_if":"unavailable","halt_if_type":"str","halt_if_compare":"is","outputs":2,"x":150,"y":280,"wires":[["bbed887326cb947f"],[]]},{"id":"2ed8ee2712c87e30","type":"poll-state","z":"e6a08422065e2879","name":"","server":"c0337d1c.d3c23","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"10","updateIntervalUnits":"minutes","outputinitially":false,"outputonchanged":false,"entity_id":"climate.hvacmainfloor","state_type":"str","halt_if":"unavailable","halt_if_type":"str","halt_if_compare":"is","outputs":2,"x":150,"y":220,"wires":[["bbed887326cb947f"],[]]},{"id":"c0337d1c.d3c23","type":"server","name":"Home Assistant","version":1,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

Watchdog has two triggers: a state change to unavailable, and a poller that checks for unavailable just to be sure (this can be optional, I haven’t tested the state change to ensure it works as expected so the poller acts as a fallback).

It then sets the entity (which fixes the integration), then checks to see that the entity is no longer unavailable. If it’s still unavailable (there have been reports from @LouisMT that it sometimes takes more than one go), it waits 1min then tries again.

Also note that I have two thermostats, so you can remove one if you only have one. My state node uses regex to get all entities that start with climate..

@sven41 Thanks, it works great.

I observed in my logbook that the automation sometimes starts 2 or 3 times instead of just once. Perhaps Honeywell is then unavailable for 10-15 minutes? Anyone noticed this?

image

@justinmbrock I agree that would generally be a better option, but your automation only updates the entity once (when it becomes unavailable), while @sven41’s automation will keep doing this every 5 minutes as long as it stays unavailable. As it seems that the API is unstable at some times, I think this might be just what makes it work. 😄

I’ve combined both of your automations, it’ll fire as soon as the integration becomes unavailable (so in a best case scenario you won’t even notice that it has become unavailable) and keep retrying every 5 minutes. Hopefully this works for me too, I just started it! 😄

- alias: Honeywell Lyric Fix
  trigger:
    - platform: time_pattern
      minutes: /5
    - platform: state
      entity_id: climate.woonkamer
      to: unavailable
  condition:
    - condition: state
      entity_id: climate.woonkamer
      state: unavailable
  action:
    - service: homeassistant.update_entity
      entity_id: climate.woonkamer

Edit: the automation was triggered 3 times before the integration recovered.

Correct me if I wrong but as I understand it his automation should run EVERY time the state changes not just once. However, if you had to reboot HA and the initial state after boot for the Lyric was unavailable the automation would miss it because there was no state change since boot, so you would really need a second automation for boot specifically.

Edit: In your code your trigger and condition do the same thing.

@justinmbrock I agree that would generally be a better option, but your automation only updates the entity once (when it becomes unavailable), while @sven41’s automation will keep doing this every 5 minutes as long as it stays unavailable. As it seems that the API is unstable at some times, I think this might be just what makes it work. 😄

I’ve combined both of your automations, it’ll fire as soon as the integration becomes unavailable (so in a best case scenario you won’t even notice that it has become unavailable) and keep retrying every 5 minutes. Hopefully this works for me too, I just started it! 😄

- alias: Honeywell Lyric Fix
  trigger:
    - platform: time_pattern
      minutes: /5
    - platform: state
      entity_id: climate.woonkamer
      to: unavailable
  condition:
    - condition: state
      entity_id: climate.woonkamer
      state: unavailable
  action:
    - service: homeassistant.update_entity
      entity_id: climate.woonkamer

Edit: the automation was triggered 3 times before the integration recovered.

Is it not recommended to use something like the state change as a trigger? Something like this:

alias: Update Honeywell Lyric integration
description: ''
trigger:
  - platform: state
    entity_id: climate.thermostat
    to: unavailable
    for:
      hours: 0
      minutes: 1
      seconds: 0
      milliseconds: 0
condition: []
action:
  - service: homeassistant.update_entity
    target:
      entity_id: climate.thermostat
mode: single

Same here. In just the last 24 hours I have had to re-auth 3 times. Starting to drive me nuts. The honeywell thermostats are great other than this issue. I agree with what some other folks have said about a possible change to the API. I’m running the latest version with the fix like others (2021.10.6). Any solution in site on this one?