Can you clarify what you meanwith the base IP and Honeywell?
The Honeywell Callback URL as shown in the post by ski522, and the “base_url” specified in the "http: section of Home Assistant’s configuration.yaml. Both must be the private IP address.
Hey guys,
I was able to get through initial setup. The front end displayed the intial thermostat values correctly, but everytime I change a value it is unresponsive and I get the following in the HA log:
HTTP Error Lyric API: 400 Client Error: User Input Error for url: https://api.honeywell.com/v2/devices/thermostats/LCC-B82CA00F315E?locationId=890140&apikey=sF8cgw6b7JiEv9reiDqRZYadeErsVwpt
Any thoughts?
I have connection and indeed. The temperature was set on 18 Celcius. I set it to 17.5 and the lyric lightsup and changed to 17.5. Change to higher or lower value only thing is that the lyric lightsup but stays on 17.5
Update: After serveral reboots of the raspberry pi it is stable.
I’m not sure what was going on last night but it’s working great today.
I had the same errors occurring, not sure what the problem is. But it seems to need one more reboot to fix it.
Haven’t taken a look at it yet, maybe there is no config file or thermostat info and it errors out that way.
Here is a summary of the installation steps for those who follow:
If you find any errors, please send me a message and I will amend the text. This summary summarizes the work of @Bram_Kragten, @cheelio, @ski522 and others who blazed the trail.
Part 1: Obtain client key & secret from Honeywell
- Visit Honeywell Developers , and sign in. Create an account if you don’t have one already.
- Fill in account details.
- Submit changes
- Click “My Apps ” at top of page, under your account.
- Click “Create New App ”
- Fill in details:
- App name. Can be anything, I use Home Assistant.
- In the “Callback URL” enter the IP address to your Home Assistant instance as seen below:
- Click “Save Changes”
- On the apps page, click on the just created app.
- The “Consumer Key” and “Consumer Secret” are shown now. Be sure to copy these fields before you leave the Honeywell site. You’ll need to insert them into the configuration.yaml or secrets.yaml file.
Part 2: Download Lyric files and install them in Home Assistant
The “custom_components” folder must exist in the same Home Assistant root folder … where your configuration.yaml resides. Custom_components must contain a subfolder named “climate”. Copy the lyric.py files to these folders based upon the file-path notated in the link names.
Part 3: Modify Home Assistant YAML files:
- Store the key and secret that you obtained from Honeywell in your secrets.yaml file. example below:
lyric_client_key: kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
lyric_client_secret: ssssssssssssssssssssssss
- Add the Lyric Thermostat to your configuration.yaml file. example below:
###############################################
# Honeywell Lyric Thermostat #
###############################################
lyric:
client_id: !secret lyric_client_key
client_secret: !secret lyric_client_secret
- Check “base_url” in your configuration.yaml. To authenticate with Honeywell, your “base_url” must concatenate with “/api/lyric/authenticate” to produce the “Callback URL” that you registered with Honeywell.
###############################################
# http #
###############################################
http:
base_url: https://192.168.1.215:8123
Part 4: Reboot Home Assistant
After a reboot, Home Assistant should present a card to configure the Lyric Thermostat. You will be asked to authenticate with the Honeywell Developer’s site, and ultimately, the Home Assistant front-end should display a Climate card for the Lyric Thermostat that will look something like:
Known issues:
- Lyric fan controls are not currently supported
- Lyric outdoor temperature sensors are not currently supported
- Lyric indoor humidity sensor is not currently supported
- Advanced features, like the control of dual heating systems are not supported.
Ok, stupid me… After having this working for about a year I have screwed up. I noticed above post and looked at my Honeywell account and noticed that my callback URL was still linking to my old internal IP. And even tough (for me for not understandable reasons) everything was still working fine I changed it to the correct IP.
Now setting a setpoint in HASS works suddenly very unreliable (strange enough, sometimes I see it work). Setting setpoint on thermostat still show up in HASS. Also get errors in logs (some symbols replaced with xxx):
HTTP Error Lyric API: 400 Client Error: User Input Error for url: https://api.honeywell.com/v2/devices/thermostats/LCC-00D02DExxxxE?locationId=53xxxx&apikey=zStmuOO7lbKKgaVQqxxxxxxxxxxxxx
If I run the URL I get;
{"code":401, "message":"Invalid or expired accesstoken"}
While this is really the correct token +expiration date is unlimted.
So tought; let’s start over. Created new app with new name on honeywell but then actually never get the authentication pop-up.
Any suggestions?
Your key never expires … but I am pretty sure that the acesstoken can. If I understand correctly, the access code is created when we execute the authentication pop-up. Home Assistant stores this so it can communicate with Honeywell via the API.
I’m guessing (and I’m no expert on this topic) that your HA is still storing the old access token, and it won’t display the authentication popup because it think’s it is already authenticated … but the access token is invalid for the new Honeywell app, so you get the “invalid or expired” message.
Could make sense…
Anyone any idea how to re-trigger the authentication/pop up window?
Edit: after re-reading most of the posts it seems I need to remove lyric.conf. will try that when back home
I did some searching, and found this interesting … My .homeassistant folder contains a lyric.conf and it stores my Honeywell API access token. Assuming you have that file as well, you might try renaming it and restarting HA to see what happens.
Thanks for spotting this
I was unable to set the temperature using this component, because I would get the following error:
2019-02-06 13:34:01 ERROR (SyncWorker_4) [lyric] HTTP Error Lyric API: 400 Client Error: User Input Error for url: https://api.honeywell.com/v2/devices/thermostats/XXX?locationId=YYY&apikey=ZZZ
Some people in this topic mentioned that this error will disappear after a few hours. Well, after some debugging I found out they’re right: this error only occurs when the thermostat is set to HoldUntil
(e.g. the thermostat is temporarily set to 20 degrees until 18:00). You can disable this mode by clicking on the small cross (bottom right) on the thermostat, or by simply waiting until that time has passed and the thermostat continues its normal schedule.
Technical details
The request fails with this response:
{"code":400, "message":"nextPeriodTime required"}
And the documentation mentions:
- “HoldUntil” - Requires a “nextPeriodTime” value, the thermostat will hold the requested setpoint(s) until that time.
Fix
I’ve created a Pull Request to automatically set the mode to PermanentHold
before changing the temperature. I’m not sure if this is the best fix, but anyone running into the same issue can apply this patch to make it work!
Seems Bram commited your change, however now I get below. Do you have the same?
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/climate/__init__.py", line 266, in state_attributes
if self.fan_list:
File "/config/custom_components/climate/lyric.py", line 285, in fan_list
return self._fan_list
AttributeError: 'LyricThermostat' object has no attribute '_fan_list'
2019-02-07 12:36:55 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 239, in async_update_ha_state
attr = self.state_attributes or {}
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/climate/__init__.py", line 266, in state_attributes
if self.fan_list:
File "/config/custom_components/climate/lyric.py", line 285, in fan_list
return self._fan_list
AttributeError: 'LyricThermostat' object has no attribute '_fan_list'
I’m not getting any exceptions and I also haven’t changed anything related to that part of code.
Looking at the latest code this seems like a weird error to me because _fan_list
should always exist. Are you sure you haven’t accidentally altered some part of the code?
Just to make sure: Can you post your full lyric.py?
Thanks , but it seems you submitted the change to Bram Kragtens version, which in the meantime seems out of sync with Cheelio’s version…(in which , locally, you made some changes). Or am I wrong?
My changes to the Lyric Home Assistant component (components/lyric.py
and components/climate/lyric.py
) haven’t been merged and are therefore unchanged. Instead, I fixed the issue in the Python package python-lyric
, on which both Bram’s and Cheelio’s version have a dependency.
A new version of this package hasn’t been published to PyPI yet, so if you installed the dependency using pip install python-lyric
(or let Home Assistant do it) then nothing has changed for you.
The error you’re getting doesn’t seem related to the python-lyric
package at all. I would like to help you fix it but I can’t think of any reason why you would be getting that error…
I’m a github noob so interpreted you link above as an update to Bram’s lyric.py (which seems he commited to his branch). So I copied that as my new lyric.py. That caused above errors.
So I’m now back to the files from this post and all is working like before (but obviously still with the errors in the log you mention in post 485)