Honeywell Lyric Thermostat

Hesitant to post - I’m not sure if this will help or make things worse, but I was getting errors in the 0.0.3.alpha.1 version of python-lyric init.py yesterday. When I opened init.py in vi, it said “File truncated unexpectedly” or something like that. I’m relatively new to this world, so not sure if github might corrupt files occasionally? Anyway, I switched to the master branch in components/lyric.py, and that seemed to resolve the issue.

REQUIREMENTS = [
https://github.com/bramkragten/python-lyric
‘/archive/master.zip’
‘#python-lyric==0.0.3’]

I’m also using the Jan 27 components/climate/lyric.py (https://github.com/bramkragten/home-assistant/blob/efd976fab7338099f33f0399e2ff157e0898b518/homeassistant/components/climate/lyric.py) and have not modified climates/service.yaml.

I also, had to change that line to something like:

REQUIREMENTS = [
'https://github.com/bramkragten/python-lyric/archive/master.zip#python-lyric==0.0.3']

OK, another try.

Could you update to the latest version:
https://raw.githubusercontent.com/bramkragten/home-assistant/lyric/homeassistant/components/lyric.py
https://raw.githubusercontent.com/bramkragten/home-assistant/lyric/homeassistant/components/climate/lyric.py

And add this to your configuration.yaml logger:

logger:
  default: error
  logs:
    custom_components.lyric: debug
    custom_components.climate.lyric: debug

And then check your logs?

Here’s what I see in the logs (with personal information redacted). Still no climate entity in HA.

2017-08-09 17:37:10 DEBUG (SyncWorker_8) [custom_components.lyric] proceeding with setup 
2017-08-09 17:37:11 DEBUG (SyncWorker_8) [custom_components.lyric] [{'locationID': XXX, 'name': 'Home', 'streetAddress': 'XXX', 'city': 'XXX', 'state': 'GA', 'country': 'Usa', 'zipcode': 'XXXXX', 'devices': [], 'users': [{'userID': XXXX, 'username': 'XXXXXX', 'firstname': 'XXX', 'lastname': 'XXXX', 'created': XXXXXX, 'deleted': XXXXX, 'activated': True, 'connectedHomeAccountExists': True, 'locationRoleMapping': [{'locationID': XXX, 'role': 'Adult', 'locationName': 'Home', 'status': 1}]}, {'userID': XXXX, 'username': 'XXXXX', 'firstname': 'XXXX', 'lastname': 'XXXX', 'created': XXXXX, 'deleted': XXXXX, 'activated': True, 'connectedHomeAccountExists': True, 'locationRoleMapping': [{'locationID': XXXXX, 'role': 'Adult', 'locationName': 'Home', 'status': 1}]}], 'timeZoneId': 'Eastern', 'timeZone': 'Eastern Standard Time', 'daylightSavingTimeEnabled': True, 'geoFences': [{'geoFenceID': XXXXX, 'latitude': XXXX, 'longitude': -XXXX, 'radius': 3220, 'geoOccupancy': {'withinFence': 0, 'outsideFence': 0}}], 'geoFenceEnabled': True}] 
2017-08-09 17:37:11 DEBUG (SyncWorker_8) [custom_components.lyric] proceeding with discovery of platforms 
2017-08-09 17:37:11 DEBUG (SyncWorker_8) [custom_components.lyric] setup done of component 
2017-08-09 17:37:12 DEBUG (SyncWorker_9) [custom_components.climate.lyric] Set up Lyric climate platform

Here is what I got. I am using a straight install on Debian.

2017-08-09 17:03:05 ERROR (MainThread) [homeassistant.loader] Error loading homeassistant.components.climate.lyric.     Make sure all dependencies are installed
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/loader.py", line 142, in get_component
    module = importlib.import_module(path)
  File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1471, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/climate/lyric.py", line 16, in <module>
    from custom_components.lyric import DATA_LYRIC
ImportError: No module named 'custom_components'
2017-08-09 17:03:05 ERROR (MainThread) [homeassistant.loader] Unable to find component climate.lyric
2017-08-09 17:03:05 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform climate.lyric: Platform not found.

OK, that’s what I was affraid of, the devices part is empty. So you don’t get any devices from the API. That’s not something my library is doing, but a problem at the Honeywell side.

Try removing your lyric.conf, re-authenticate, and I noticed they changed the last step, where you have to choose what devices you want to give access too. Make sure the thermostat is checked!

You should either move it to custom_components or change line 16 of climate/lyric.py:

from custom_components.lyric import DATA_LYRIC
from homeassistant.components.lyric import DATA_LYRIC

Edit: whoops, missed the services.yaml snippet above. I’ve deleted most of my comment since it’s not constructive, but I’m leaving the following just because :slight_smile:

Also, while I have your attention… “OK! All good. Got the respons! You can close” You’re missing the e in “response”.

Everything is working now. We need to make sure that the thermostat is checked for it to appear in HA. The climate entity is there. Now, we need to add some more instructions to the services and looks like we may be ready for a PR soon :slight_smile:

I’ve mixed in services.yaml from down in /srv/homeassistant into custom_components along with the additional lyric entry up above. Now I’m getting the following, which looks similar to Honeywell Lyric Thermostat however I do not see a resolution to that user’s issue. I’m on the version listed in post 84.

2017-08-10 09:23:51 DEBUG (Thread-11) [custom_components.lyric] proceeding with discovery of platforms
2017-08-10 09:23:51 DEBUG (Thread-11) [custom_components.lyric] setup done of component
2017-08-10 09:23:51 DEBUG (Thread-8) [custom_components.climate.lyric] Set up Lyric climate platform
2017-08-10 09:23:51 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/tasks.py", line 233, in _step
    result = coro.throw(exc)
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 381, in async_process_entity
    new_entity, self, update_before_add=update_before_add
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 212, in async_add_entity
    yield from self.hass.async_add_job(entity.update)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/climate/lyric.py", line 302, in update
    self._scheduleSubType = self.device.scheduleSubType
  File "/srv/homeassistant/lib/python3.4/site-packages/lyric/__init__.py", line 695, in scheduleSubType
    if ('scheduleType' in self._lyric_api._device(self._locationId, self._deviceId)) & ('scheduleSubType' in self._lyric_api._device(self._locationId, self._deviceId)['scheduleType']):
KeyError: 'scheduleType'

I created the custom_components folder. Many thanks.

I see Config file not found: /home/homeassistant/.homeassistant/custom_components/climate/services.yaml and several mentions of services above. What goes in that file?

I copied /srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/climate/services.yaml and added the additional section from post #74

The services.yaml file is here

Please share the info you get from the debug in the log.

Just the info of that post will do if in custom components

Seeing these in the logs (not been able to pinpoint what is causing them):

2017-08-10 12:33:05 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.lyric_t5_thermostat fails
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 225, in async_update_ha_state
    yield from self.hass.async_add_job(self.update)
  File "/usr/lib/python3.5/asyncio/futures.py", line 361, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 296, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/climate/lyric.py", line 286, in update
    self._location = self.device.where
  File "/srv/homeassistant/lib/python3.5/site-packages/lyric/__init__.py", line 455, in where
    return self._lyric_api._location(self._locationId)['name']
  File "/srv/homeassistant/lib/python3.5/site-packages/lyric/__init__.py", line 999, in _location
    for location in self._locations:
  File "/srv/homeassistant/lib/python3.5/site-packages/lyric/__init__.py", line 1010, in _locations
    value = self._get('locations')
  File "/srv/homeassistant/lib/python3.5/site-packages/lyric/__init__.py", line 972, in _get
    response.raise_for_status()
  File "/srv/homeassistant/lib/python3.5/site-packages/requests/models.py", line 928, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api.honeywell.com/v2/locations?apikey=XXXXXXXXXXXX

Something is wrong with the authentication of the API… that’s weird, the lyric.conf file still in place? Is it like that every 5 minutes or less?

Here’s a slightly extended log https://hastebin.com/inecililat.sql

lyric.conf is still place.

I would suggest deleting the lyric.conf and a restart of hass…

Did that. Will keep you posted if I see anything else. Anything specific you want me try out?