Honeywell Lyric Thermostat

Seeing these in the logs even though the thermostat is working in HA

2017-08-18 19:03:45 ERROR (Thread-38) [lyric] Error Lyric API: 401 Client Error: Unauthorized for url: https://api.honeywell.com/v2/locations?apikey=XXX
2017-08-18 19:03:45 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 328, in update
    self._location = self.device.where
  File "/srv/homeassistant/lib/python3.5/site-packages/lyric/__init__.py", line 321, in where
    return self._location.name
  File "/srv/homeassistant/lib/python3.5/site-packages/lyric/__init__.py", line 90, in name
    return self._lyric_api._location(self._locationId)['name']
  File "/srv/homeassistant/lib/python3.5/site-packages/lyric/__init__.py", line 778, in _location
    for location in self._locations:
TypeError: 'NoneType' object is not iterable

Nothing else in the logs around that time.

I have the same errors and likewise, the Thermostat is working just fine.

I have a new version, the 401’s are not fixed, as I still don’t know what it causing them, so they will keep coming in the logs, but the rest of the errors should be catched… Not tested so fingers crossed… @tdub please also try this new version.

OK so far. Thanks.

Just wanted to share couple of scripts/switches that I wrote for the Lyric component to enable us to simulate the away feature of other thermostats.

Here’s the template switch that will allow you to turn the hold mode on/off.

  - platform: template
    switches:
      lyric_hold:
        friendly_name: Lyric Hold
        value_template: "{{(states.climate.lyric_t5_thermostat.attributes|default({})).hold_mode|default('NoHold') == 'PermanentHold'}}"
        turn_on:
          - service: homeassistant.turn_on
            entity_id: script.lyric_hold_on
        turn_off:
          - service: homeassistant.turn_on
            entity_id: script.lyric_hold_off

Here are the scripts that I am using currently, but you can modify them to your liking.

  lyric_hold_on:
    alias: 'Lyric hold on'
    sequence:
      - service: climate.set_temperature
        data_template:
          entity_id: climate.lyric_t5_thermostat
          temperature: >-
            {%- if states.sensor.pws_temp_f.state|int > 75 -%}
              83
            {%- else -%}
              66
            {%- endif -%}
      - service: climate.set_hold_mode
        data:
          entity_id: climate.lyric_t5_thermostat
          hold_mode: 'PermanentHold'

  lyric_hold_off:
    alias: 'Lyric hold off'
    sequence:
      - service: climate.lyric_resume_program
        data:
          entity_id: climate.lyric_t5_thermostat

You can find other related automations in my repo here.

1 Like

I have an other update out, that has more logging and tries to fix the 401 problem. It should not show up in the log more than once every 10 minutes and as a warning now, because it should continue with what it should be doing. Let me know how the new version goes.

1 Like

Now on the latest update. Still nothing showing in states. Here is the current log.

2017-08-20 14:46:03 DEBUG (Thread-9) [custom_components.lyric] proceeding with setup
2017-08-20 14:46:05 DEBUG (Thread-9) [custom_components.lyric] [{‘devices’: [{‘changeableValues’: {‘mode’: ‘Cool’, ‘nextPeriodTime’: ‘18:00:00’, ‘thermostatSetpointStatus’: ‘NoHold’, ‘endCoolSetpoint’: 74, ‘coolSetpoint’: 74, ‘endHeatSetpoint’: 62, ‘heatCoolMode’: ‘Cool’, ‘heatSetpoint’: 62}, ‘displayedOutdoorHumidity’: 23, ‘deviceClass’: ‘Thermostat’, ‘macID’: ‘00D02DBE737D’, ‘maxCoolSetpoint’: 90, ‘isProvisioned’: True, ‘outdoorTemperature’: 97, ‘isUpgrading’: False, ‘units’: ‘Fahrenheit’, ‘deviceType’: ‘Thermostat’, ‘deviceID’: ‘LCC-00D02DBE737D’, ‘allowedTimeIncrements’: 15, ‘maxHeatSetpoint’: 90, ‘currentSchedulePeriod’: {‘period’: ‘Away’, ‘day’: ‘Sunday’}, ‘scheduleStatus’: ‘Resume’, ‘allowedModes’: [‘Heat’, ‘Off’, ‘Cool’], ‘vacationHold’: {‘enabled’: False}, ‘deviceSettings’: {}, ‘indoorTemperature’: 74, ‘operationStatus’: {‘mode’: ‘Cool’, ‘fanRequest’: True, ‘circulationFanRequest’: False}, ‘settings’: {‘temperatureMode’: {‘air’: False}, ‘hardwareSettings’: {‘brightness’: 0, ‘maxBrightness’: 5}, ‘fan’: {‘changeableValues’: {‘mode’: ‘Auto’}, ‘allowedModes’: [‘On’, ‘Auto’, ‘Circulate’]}, ‘specialMode’: {}}, ‘isAlive’: True, ‘deadband’: 0, ‘scheduleType’: {‘scheduleSubType’: ‘NA’, ‘scheduleType’: ‘Timed’}, ‘minHeatSetpoint’: 50, ‘hasDualSetpointStatus’: False, ‘scheduleCapabilities’: {‘availableScheduleTypes’: [‘None’, ‘Geofenced’, ‘TimedNorthAmerica’], ‘schedulableFan’: False}, ‘userDefinedDeviceName’: ‘Downstairs’, ‘name’: ‘Downstairs’, ‘minCoolSetpoint’: 50}, {‘changeableValues’: {‘mode’: ‘Cool’, ‘nextPeriodTime’: ‘18:00:00’, ‘thermostatSetpointStatus’: ‘NoHold’, ‘endCoolSetpoint’: 74, ‘coolSetpoint’: 74, ‘endHeatSetpoint’: 62, ‘heatCoolMode’: ‘Cool’, ‘heatSetpoint’: 62}, ‘displayedOutdoorHumidity’: 23, ‘deviceClass’: ‘Thermostat’, ‘macID’: ‘00D02DBE72D7’, ‘maxCoolSetpoint’: 90, ‘isProvisioned’: True, ‘outdoorTemperature’: 97, ‘isUpgrading’: False, ‘units’: ‘Fahrenheit’, ‘deviceType’: ‘Thermostat’, ‘deviceID’: ‘LCC-00D02DBE72D7’, ‘allowedTimeIncrements’: 15, ‘maxHeatSetpoint’: 90, ‘currentSchedulePeriod’: {‘period’: ‘Away’, ‘day’: ‘Sunday’}, ‘scheduleStatus’: ‘Resume’, ‘allowedModes’: [‘Heat’, ‘Off’, ‘Cool’], ‘vacationHold’: {‘enabled’: False}, ‘deviceSettings’: {}, ‘indoorTemperature’: 74, ‘operationStatus’: {‘mode’: ‘EquipmentOff’, ‘fanRequest’: False, ‘circulationFanRequest’: False}, ‘settings’: {‘temperatureMode’: {‘air’: False}, ‘hardwareSettings’: {‘brightness’: 0, ‘maxBrightness’: 5}, ‘fan’: {‘changeableValues’: {‘mode’: ‘Auto’}, ‘allowedModes’: [‘On’, ‘Auto’, ‘Circulate’]}, ‘specialMode’: {}}, ‘isAlive’: True, ‘deadband’: 0, ‘scheduleType’: {‘scheduleSubType’: ‘NA’, ‘scheduleType’: ‘Timed’}, ‘minHeatSetpoint’: 50, ‘hasDualSetpointStatus’: False, ‘scheduleCapabilities’: {‘availableScheduleTypes’: [‘None’, ‘Geofenced’, ‘TimedNorthAmerica’], ‘schedulableFan’: False}, ‘userDefinedDeviceName’: ‘Upstairs’, ‘name’: ‘Upstairs’, ‘minCoolSetpoint’: 50}, {‘changeableValues’: {‘mode’: ‘Cool’, ‘nextPeriodTime’: ‘18:00:00’, ‘thermostatSetpointStatus’: ‘NoHold’, ‘endCoolSetpoint’: 74, ‘coolSetpoint’: 74, ‘endHeatSetpoint’: 62, ‘heatCoolMode’: ‘Cool’, ‘heatSetpoint’: 62}, ‘displayedOutdoorHumidity’: 23, ‘deviceClass’: ‘Thermostat’, ‘macID’: ‘00D02DBE736B’, ‘maxCoolSetpoint’: 90, ‘isProvisioned’: True, ‘outdoorTemperature’: 97, ‘isUpgrading’: False, ‘units’: ‘Fahrenheit’, ‘deviceType’: ‘Thermostat’, ‘deviceID’: ‘LCC-00D02DBE736B’, ‘allowedTimeIncrements’: 15, ‘maxHeatSetpoint’: 90, ‘currentSchedulePeriod’: {‘period’: ‘Away’, ‘day’: ‘Sunday’}, ‘scheduleStatus’: ‘Resume’, ‘allowedModes’: [‘Heat’, ‘Off’, ‘Cool’], ‘vacationHold’: {‘enabled’: False}, ‘deviceSettings’: {}, ‘indoorTemperature’: 74, ‘operationStatus’: {‘mode’: ‘EquipmentOff’, ‘fanRequest’: False, ‘circulationFanRequest’: False}, ‘settings’: {‘temperatureMode’: {‘air’: False}, ‘hardwareSettings’: {‘brightness’: 0, ‘maxBrightness’: 5}, ‘fan’: {‘changeableValues’: {‘mode’: ‘Auto’}, ‘allowedModes’: [‘On’, ‘Auto’, ‘Circulate’]}, ‘specialMode’: {}}, ‘isAlive’: True, ‘deadband’: 0, ‘scheduleType’: {‘scheduleSubType’: ‘NA’, ‘scheduleType’: ‘Timed’}, ‘minHeatSetpoint’: 50, ‘hasDualSetpointStatus’: False, ‘scheduleCapabilities’: {‘availableScheduleTypes’: [‘None’, ‘Geofenced’, ‘TimedNorthAmerica’], ‘schedulableFan’: False}, ‘userDefinedDeviceName’: ‘Master Bedroom’, ‘name’: ‘Master Bedroom’, ‘minCoolSetpoint’: 50}], ‘state’: ‘AZ’, ‘city’: ‘Gilbert’, ‘streetAddress’: ‘xxx’, ‘comfortLevel’: 0, ‘users’: [{‘isCurrentUser’: True, ‘locationRoleMapping’: [{‘status’: 1, ‘role’: ‘Adult’, ‘locationID’: 273900, ‘locationName’: ‘Home’}], ‘lastname’: ‘Xxx’, ‘firstname’: ‘Tyler’, ‘deleted’: -62135596800, ‘connectedHomeAccountExists’: True, ‘username’: ‘xxx’, ‘created’: 1496698511, ‘userID’: 314105, ‘activated’: True}, {‘isCurrentUser’: False, ‘locationRoleMapping’: [{‘status’: 1, ‘role’: ‘Adult’, ‘locationID’: 273900, ‘locationName’: ‘Home’}], ‘lastname’: ‘xxx’, ‘firstname’: ‘xxx’, ‘deleted’: -62135596800, ‘connectedHomeAccountExists’: True, ‘username’: ‘xxx’, ‘created’: 1496844678, ‘userID’: 316080, ‘activated’: True}], ‘geoFenceEnabled’: False, ‘timeZone’: ‘Mountain Standard Time’, ‘country’: ‘Usa’, ‘predictiveAIREnabled’: False, ‘timeZoneId’: ‘Mountain’, ‘daylightSavingTimeEnabled’: False, ‘name’: ‘Home’, ‘locationID’: 273900, ‘zipcode’: ‘85295’}, {‘users’: [{‘isCurrentUser’: True, ‘locationRoleMapping’: [{‘status’: 1, ‘role’: ‘Adult’, ‘locationID’: 273905, ‘locationName’: ‘Master Bedroom’}], ‘lastname’: ‘Xxx’, ‘firstname’: ‘Tyler’, ‘deleted’: -62135596800, ‘connectedHomeAccountExists’: True, ‘username’: ‘xxx’, ‘created’: 1496698511, ‘userID’: 314105, ‘activated’: True}], ‘geoFenceEnabled’: False, ‘timeZone’: ‘Mountain Standard Time’, ‘country’: ‘Usa’, ‘predictiveAIREnabled’: False, ‘timeZoneId’: ‘Mountain’, ‘daylightSavingTimeEnabled’: False, ‘name’: ‘Master Bedroom’, ‘locationID’: 273905, ‘zipcode’: ‘85295’, ‘comfortLevel’: 0}]
2017-08-20 14:46:05 DEBUG (Thread-9) [custom_components.lyric] proceeding with discovery of platforms
2017-08-20 14:46:05 DEBUG (Thread-9) [custom_components.lyric] setup done of component
2017-08-20 14:46:05 DEBUG (Thread-19) [custom_components.climate.lyric] climate discovery_info: OrderedDict([(‘client_id’, ‘hrjN4OEtpILLscAS7dpcQ4sUUiX0nqcv’), (‘client_secret’, ‘uCk8ZrARwV624uzG’), (‘fan’, False)])
2017-08-20 14:46:05 DEBUG (Thread-19) [custom_components.climate.lyric] climate config: {}
2017-08-20 14:46:05 DEBUG (Thread-19) [custom_components.climate.lyric] Set up Lyric climate platform
2017-08-20 14:46:05 DEBUG (Thread-19) [custom_components.climate.lyric] away periods:
2017-08-20 14:46:05 DEBUG (Thread-19) [custom_components.climate.lyric] away periods:
2017-08-20 14:46:05 DEBUG (Thread-19) [custom_components.climate.lyric] away periods:
2017-08-20 14:46:05 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform lyric
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py”, line 164, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
File “/usr/lib/python3.5/asyncio/tasks.py”, line 392, in wait_for
return fut.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 64, in setup_platform
for location, device in hass.data[DATA_LYRIC].thermostats()]
File “/home/homeassistant/.homeassistant/custom_components/climate/lyric.py”, line 63, in
devices = [LyricThermostat(location, device, hass, temp_unit, has_fan, away_periods)
File “/home/homeassistant/.homeassistant/custom_components/lyric.py”, line 163, in thermostats
for device in location.thermostats:
File “/srv/homeassistant/lib/python3.5/site-packages/lyric/init.py”, line 194, in thermostats
for device in self._devices:
File “/srv/homeassistant/lib/python3.5/site-packages/lyric/init.py”, line 161, in _devices
return self._lyric_api._devices(self._locationId, forceGet)
File “/srv/homeassistant/lib/python3.5/site-packages/lyric/init.py”, line 868, in _devices
return self._location(locationId)[‘devices’]
KeyError: ‘devices’

FWIW, I am not seeing the 401 errors after the update.

Sorry, my bad.

Try the newest version.

Just did a major overhaul of the code, to get close to a final release…

Is there anyone who has a water/freeze detector or camera from Honeywell Lyric?

@Bram_Kragten something odd happened when setting this up…maybe @tdub and I were missing something but I WAS able to get all three to now show up on his HASS. I will explain what I did just so you know and maybe it was something that was fixed (as I was out of town for last 4 days) by yourself or the process that I added them that made it work.

I deleted all files and reinstalled all py files and remove configuration file for lyric. Removed __pycache__folders also. I redid the configuration but only added one thermostat and got that to show up. I did the same thing over again but did it with 2 thermostats and both showed up. I ran through the removing of the pycache and lyric.conf file and ran through setup for 3rd time but this time added all three lyric thermo’s and now all three are showing.

I am not sure if it helped by adding 1 or 2 at a time or if you changed something in the code recently that fixed it but they are now showing up normally like my sensi thermo’s show up on my hass. I will test them out with tdub and see if we run into any issues along the way.

Thanks again for all your help on this! You have been quick to respond and very helpful. Really appreciate it.

That would be the fixes on the code! The setup of the account was a bit weird with a location without devices, didnt think that was possible, but now it handles that well.

Great to hear that it is working!

I’m not aware of any problems anymore, so I just pushed a release candidate. Please test it and if all goes well I can make a PR. :tada:

Has been working very well for me since the last few updates. Just updated to the release candidate and will let you know if I encounter anything.

Did the code move on github?

It’s here…see the last commit about Lyric component

Thank you kind Sir!

With the exception of some errors a couple days ago when trying to adjust the temperature, it has been running great. I didn’t save the logs but it was showing user input error and I also had a 400 error. Tried it about an hour later and it worked fine and has worked since then. Thanks for your hard work.

I am seeing something strange on the temp tracker. The temp seems to hold pretty consistently but the graph shows it dropping 2 degrees and coming back up. Doesn’t really bother me, just thought I would let you know.

I am a Noob to HA and would like to add my two Honeywell Lyric T5 thermostats. I see the above post

arsaboo
It’s here4…see the last commit about Lyric component

but I don’t fully understand how to implement this, is there a guide somewhere that will tell me how to implement what is necessary for the Lyric thermostats?

I did try;
https://home-assistant.io/components/climate.lyric/
https://home-assistant.io/components/lyric/
as suggested in the top of the codes… but got 404 error for both pages. Can someone clarify what is necessary to add these components? Please.

Thanks a Lot.

See this post for an explanation Honeywell Lyric Thermostat

You just put the 2 python files in the custom_components and custom_components /climate folder (if you don’t have it, create it in your config directory)