8000 Honeywell Lyric becomes unavailable · Issue #61140 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Honeywell Lyric becomes unavailable #61140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
LouisMT opened this issue Dec 7, 2021 · 9 comments · Fixed by #62100
Closed

Honeywell Lyric becomes unavailable #61140

LouisMT opened this issue Dec 7, 2021 · 9 comments · Fixed by #62100

Comments

@LouisMT
Copy link
Contributor
LouisMT commented Dec 7, 2021

The problem

The Honeywell Lyric integration becomes unavailable after a some time.

A fix for this issue is included in the current beta, but it does not work unfortunately. The integration became unavailble within 2 hours after upgrading, on 2 completely separate Home Assistant instances.

What version of Home Assistant Core has the issue?

core-2021.12.0b1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

lyric

Link to integration documentation on our website

https://www.home-assistant.io/integrations/lyric/

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2021-12-06 17:13:30 ERROR (MainThread) [homeassistant.components.lyric] Authentication failed while fetching lyric_coordinator data: {'request': {'method': 'GET', 'url': 'https://api.honeywell.com/v2/locations?apikey=X', 'headers': {'Authorization': 'Bearer X', 'Content-Type': 'application/json'}}, 'response': {'code': 'Unauthorized', 'message': 'Authorization has been denied for this request  '}, 'status': 401}

Additional information

See:

@probot-home-assistant
Copy link

lyric documentation
lyric source
(message by IssueLinks)

@probot-home-assistant
Copy link

Hey there @timmo001, mind taking a look at this issue as it has been labeled with an integration (lyric) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@timmo001
Copy link
Contributor
timmo001 commented Dec 7, 2021

Still occuring for me. I have a temporary workaround with a script that calls homeassistant.update for the thermostat and the authentication passes after updating the token.

The previous fix didnt help, the frequency seems to be after an hour or so (so probably when Honeywell provided token expires).

My theory is the token might be expiring quicker than honeywell state.

@sven41
Copy link
sven41 commented Dec 8, 2021

Authentication failed while fetching lyric_coordinator data: {'request': {'method': 'GET', 'url': 'https://api.honeywell.com/v2/locations?apikey=*', 'headers': {'Authorization': 'Bearer *', 'Content-Type': 'application/json'}}, 'response': {'code': 'Unauthorized', 'message': 'Authorization has been denied for this request '}, 'status': 401}

same problem

@aed0nis
Copy link
aed0nis commented Dec 9, 2021

@sven41 I am getting that error too, it is referencing api endpoint locations. In the Honeywell API page, you will have to grant access to the app in order to use it because it records your location. There needs to be a feature to disable this API endpoint.

@LouisMT
Copy link
Contributor Author
LouisMT commented Dec 14, 2021

It seems that Honeywell's API is just misbehaving 😄 I switched to the HomeKit integration for now, which is all local, so no third party APIs to deal with! And it was surprisingly fast & easy to do.

I couldn't do this before, because I'm running HASS in Docker without the host network mode. But using a mDNS reflector it's working perfectly. Basically it comes down to:

sudo apt install avahi-daemon
sudo nano /etc/avahi/avahi-daemon.conf # uncomment enable-reflector and set it to yes
sudo systemctl restart avahi-daemon

And the thermostat should pop up in Home Assistant within a few seconds, ready to add via HomeKit! 😄

@Tankdoz
Copy link
Tankdoz commented Dec 16, 2021

Hi Louis,
Lyric has been unstable for me the last few months. I need re-authenticate every few hours, which I need to do from my PC as on my iPad re-authentication will not finish. I'm very interested in your solution. Can you please explain a bit further? Do I need to install the Homekit-controller integration?

@MNLFDF
Copy link
MNLFDF commented Dec 16, 2021

Still happening for me.

`Logger: homeassistant.components.lyric
Source: helpers/update_coordinator.py:227
Integration: Honeywell Lyric (documentation, issues)
First occurred: 11:18:57 (1 occurrences)
Last logged: 11:18:57

Authentication failed while fetching lyric_coordinator data: {'request': {'method': 'GET', 'url': 'https://api.honeywell.com/v2/locations?apikey=Xxxxxxxxxxxxxxx', 'headers': {'Authorization': 'Bearer xxxxxxxxxxxxxxxx', 'Content-Type': 'application/json'}}, 'response': {'code': 'Unauthorized', 'message': 'Authorization has been denied for this request '}, 'status': 401} `

After a full restart it seems to work for some time, but then this error occurs.

2021.12.2 / HA OS installation / Honeywell Integration

@timmo001
Copy link
Contributor
timmo001 commented Dec 16, 2021

Been doing some debugging and it seems Honeywell are expiring tokens before the time they state:

2021-12-16 13:44:49 INFO (MainThread) [homeassistant.helpers.config_entry_oauth2_flow] Ensuring token is valid
2021-12-16 13:44:49 INFO (MainThread) [homeassistant.helpers.config_entry_oauth2_flow] Validating token for {'access_token': 'abc123', 'refresh_token': 'abc123', 'expires_in': 1799, 'token_type': 'Bearer', 'expires_at': 1639662887.6470149}
2021-12-16 13:44:49 DEBUG (MainThread) [homeassistant.helpers.config_entry_oauth2_flow] Current time is  1639662309.001169 (Thu Dec 16 13:45:09 2021)
2021-12-16 13:44:49 DEBUG (MainThread) [homeassistant.helpers.config_entry_oauth2_flow] Token expires at 1639662887.6470149 (Thu Dec 16 13:54:47 2021)
2021-12-16 13:44:49 DEBUG (MainThread) [homeassistant.helpers.config_entry_oauth2_flow] Token valid: True
2021-12-16 13:44:49 DEBUG (MainThread) [homeassistant.components.lyric] Token is now valid
2021-12-16 13:44:49 INFO (MainThread) [homeassistant.helpers.config_entry_oauth2_flow] Validating token for {'access_token': 'abc123', 'refresh_token': 'abc123', 'expires_in': 1799, 'token_type': 'Bearer', 'expires_at': 1639662887.6470149}
2021-12-16 13:44:49 DEBUG (MainThread) [homeassistant.helpers.config_entry_oauth2_flow] Current time is  1639662309.001372 (Thu Dec 16 13:45:09 2021)
2021-12-16 13:44:49 DEBUG (MainThread) [homeassistant.helpers.config_entry_oauth2_flow] Token expires at 1639662887.6470149 (Thu Dec 16 13:54:47 2021)
2021-12-16 13:44:49 DEBUG (MainThread) [homeassistant.helpers.config_entry_oauth2_flow] Token valid: True
2021-12-16 13:44:49 ERROR (MainThread) [homeassistant.components.lyric] Authentication failed while fetching lyric_coordinator data: {'request': {'method': 'GET', 'url': 'https://api.honeywell.com/v2/locations?apikey=abc123', 'headers': {'Authorization': 'Bearer abc123', 'Content-Type': 'application/json'}}, 'response': {'code': 'Unauthorized', 'message': 'Authorization has been denied for this request  '}, 'status': 401}
2021-12-16 13:44:49 DEBUG (MainThread) [homeassistant.components.lyric] Finished fetching lyric_coordinator data in 0.541 seconds (success: False)

The above case was far earlier than expected.

Calling the update service (or restarting) to force an update fixes this until the next time honeywell returns a 401. (but only if token's expires_at time has passed)

image

@github-actions github-actions bot locked and limited conversation to collaborators Jan 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
0