Let’s find out. Try it, if it works great, if it doesn’t share the error and the data
That did work!! Now I can set the values as well change the different modes
17-08-11 09:41:48 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 4466477376: Sending {‘id’: 2, ‘type’: ‘event’, ‘event’: {‘event_type’: ‘state_changed’, ‘data’: {‘entity_id’: ‘climate.lyric’, ‘old_state’: <state climate.lyric=cool; current_temperature=73, min_temp=40, max_temp=99, temperature=73, operation_mode=cool, operation_list=[‘off’, ‘heat’, ‘cool’, ‘auto’], schedule=None, schedule_sub=None, vacation=None, current_schedule_day=None, current_schedule_period=None, unit_of_measurement=°F, friendly_name=Lyric @ 2017-08-11T09:41:36.442976-07:00>, ‘new_state’: <state climate.lyric=cool; current_temperature=73, min_temp=40, max_temp=99, temperature=66, operation_mode=cool, operation_list=[‘off’, ‘heat’, ‘cool’, ‘auto’], schedule=None, schedule_sub=None, vacation=None, current_schedule_day=None, current_schedule_period=None, unit_of_measurement=°F, friendly_name=Lyric @ 2017-08-11T09:41:36.442976-07:00>}, ‘origin’: ‘LOCAL’, ‘time_fired’: datetime.datetime(2017, 8, 11, 16, 41, 48, 793497, tzinfo=)}}
17-08-11 09:41:48 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 4466598408: Sending {‘id’: 2, ‘type’: ‘event’, ‘event’: {‘event_type’: ‘state_changed’, ‘data’: {‘entity_id’: ‘climate.lyric’, ‘old_state’: <state climate.lyric=cool; current_temperature=73, min_temp=40, max_temp=99, temperature=73, operation_mode=cool, operation_list=[‘off’, ‘heat’, ‘cool’, ‘auto’], schedule=None, schedule_sub=None, vacation=None, current_schedule_day=None, current_schedule_period=None, unit_of_measurement=°F, friendly_name=Lyric @ 2017-08-11T09:41:36.442976-07:00>, ‘new_state’: <state climate.lyric=cool; current_temperature=73, min_temp=40, max_temp=99, temperature=66, operation_mode=cool, operation_list=[‘off’, ‘heat’, ‘cool’, ‘auto’], schedule=None, schedule_sub=None, vacation=None, current_schedule_day=None, current_schedule_period=None, unit_of_measurement=°F, friendly_name=Lyric @ 2017-08-11T09:41:36.442976-07:00>}, ‘origin’: ‘LOCAL’, ‘time_fired’: datetime.datetime(2017, 8, 11, 16, 41, 48, 793497, tzinfo=)}}
17-08-11 09:41:48 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 4471244728: Sending {‘id’: 2, ‘type’: ‘event’, ‘event’: {‘event_type’: ‘state_changed’, ‘data’: {‘entity_id’: ‘climate.lyric’, ‘old_state’: <state climate.lyric=cool; current_temperature=73, min_temp=40, max_temp=99, temperature=73, operation_mode=cool, operation_list=[‘off’, ‘heat’, ‘cool’, ‘auto’], schedule=None, schedule_sub=None, vacation=None, current_schedule_day=None, current_schedule_period=None, unit_of_measurement=°F, friendly_name=Lyric @ 2017-08-11T09:41:36.442976-07:00>, ‘new_state’: <state climate.lyric=cool; current_temperature=73, min_temp=40, max_temp=99, temperature=66, operation_mode=cool, operation_list=[‘off’, ‘heat’, ‘cool’, ‘auto’], schedule=None, schedule_sub=None, vacation=None, current_schedule_day=None, current_schedule_period=None, unit_of_measurement=°F, friendly_name=Lyric @ 2017-08-11T09:41:36.442976-07:00>}, ‘origin’: ‘LOCAL’, ‘time_fired’: datetime.datetime(2017, 8, 11, 16, 41, 48, 793497, tzinfo=)}}
17-08-11 09:41:48 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=4385765696-3>
17-08-11 09:41:48 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 4466477376: Sending {‘id’: 12, ‘type’: ‘result’, ‘success’: True, ‘result’: None}
Followed the instructions above, deleted lyric.conf, reauthorized…
2017-08-11 13:20:28 DEBUG (Thread-5) [custom_components.lyric] proceeding with discovery of platforms
2017-08-11 13:20:28 DEBUG (Thread-5) [custom_components.lyric] setup done of component
2017-08-11 13:20:28 DEBUG (Thread-7) [custom_components.climate.lyric] climate discovery_info: OrderedDict([('client_id', 'redacted'), ('client_secret', 'redacted'), ('fan', False)])
2017-08-11 13:20:28 DEBUG (Thread-7) [custom_components.climate.lyric] climate config: {}
2017-08-11 13:20:28 DEBUG (Thread-7) [custom_components.climate.lyric] Set up Lyric climate platform
2017-08-11 13:20:28 DEBUG (Thread-7) [custom_components.climate.lyric] away periods: []
2017-08-11 13:20:28 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 308, in update
self._vacationHold = self.device.vacationHold
File "/srv/homeassistant/lib/python3.4/site-packages/lyric/__init__.py", line 459, in vacationHold
return self._lyric_api._device(self._locationId, self._deviceId)['vacationHold']['enabled']
KeyError: 'vacationHold'
Yes I had the same issue…since those files are not in the son string , thats why its throwing an issue. Please commend out the lines
# self._vacationHold = self.device.vacationHold
# self._currentSchedulePeriod = self.device.currentSchedulePeriod[‘period’]
# self._currentSchedulePeriodDay = self.device.currentSchedulePeriod[‘day’]
and that should solve the issue
So you probably have a Lyric Round?
Please, can someone share the JSON string of a round?
{
‘settings’: {
‘homeSetPoints’: {
‘homeHeatSP’: 70,
‘homeCoolSP’: 78,
‘units’: ‘Fahrenheit’
},
‘awaySetPoints’: {
‘awayHeatSP’: 62,
‘awayCoolSP’: 85,
‘smartCoolSP’: 80,
‘smartHeatSP’: 55,
‘useAutoSmart’: True,
‘units’: ‘Fahrenheit’
},
‘hardwareSettings’: {
‘brightness’: 10,
‘volume’: 5,
‘maxBrightness’: 10,
‘maxVolume’: 10
},
‘fan’: {
‘allowedModes’: [‘Auto’, ‘On’, ‘Circulate’],
‘changeableValues’: {
‘mode’: ‘Circulate’
},
‘fanRunning’: True
},
‘temperatureMode’: {
‘feelsLike’: True,
‘air’: True
},
‘specialMode’: {
‘autoChangeoverActive’: False
}
},
‘isAlive’: True,
‘isUpgrading’: False,
‘macID’: ‘00D02D976572’,
‘thermostatVersion’: ‘02.02.20.00’,
‘scheduleStatus’: ‘Resume’,
‘allowedTimeIncrements’: 15,
‘deviceClass’: ‘Thermostat’,
‘deviceType’: ‘Thermostat’,
‘deviceID’: ‘TCC-2494541’,
‘userDefinedDeviceName’: ‘Lyric’,
‘name’: ‘Lyric’,
‘schedule’: {
‘scheduleType’: ‘Geofence’
},
‘isProvisioned’: False,
‘deviceSettings’: {},
‘units’: ‘Fahrenheit’,
‘indoorTemperature’: 75,
‘outdoorTemperature’: 81,
‘allowedModes’: [‘Cool’, ‘Heat’, ‘Off’],
‘deadband’: 0,
‘hasDualSetpointStatus’: False,
‘minHeatSetpoint’: 40,
‘maxHeatSetpoint’: 99,
‘minCoolSetpoint’: 40,
‘maxCoolSetpoint’: 99,
‘changeableValues’: {
‘mode’: ‘Cool’,
‘autoChangeoverActive’: False,
‘heatSetpoint’: 55,
‘coolSetpoint’: 71,
‘heatCoolMode’: ‘Cool’
},
‘operationStatus’: {
‘mode’: ‘Cool’
},
‘smartAway’: {
‘active’: False,
‘timeOfDay’: ‘00:00:00’,
‘durationInHours’: 2,
‘durationInDays’: 0,
‘lastUsedFormat’: ‘TimeOfDay’,
‘endsIn’: ‘2000-01-01T00:00:00-08:00’
},
‘indoorHumidity’: 54,
‘indoorHumidityStatus’: ‘Measured’
}
An update is ready for you to try, please let me know if it works.
Just to to confirm…the home
and away
automations work perfectly. I can now change the setpoint when everyone is away and resume schedule when we are home.
First I fixed this by hand:
2017-08-11 16:37:30 ERROR (MainThread) [homeassistant.setup] Error during setup of component lyric
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/setup.py", line 194, in _async_setup_component
component.setup, hass, processed_config)
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/lyric.py", line 118, in setup
import lyric
File "/srv/homeassistant/lib/python3.4/site-packages/lyric/__init__.py", line 703
elif 'schedule' in self._lyric_api._device(self._locationId, self._deviceId) and 'scheduleType' in self._lyric_api._device(self._locationId, self._deviceId)['schedule']:
^
TabError: inconsistent use of tabs and spaces in indentation
Moving on I then got this:
2017-08-11 16:40:59 DEBUG (Thread-8) [custom_components.lyric] proceeding with discovery of platforms
2017-08-11 16:40:59 DEBUG (Thread-8) [custom_components.lyric] setup done of component
2017-08-11 16:40:59 DEBUG (Thread-2) [custom_components.climate.lyric] climate discovery_info: OrderedDict([('client_id', 'REDACTED'), ('client_secret', 'REDACTED'), ('fan', False)])
2017-08-11 16:40:59 DEBUG (Thread-2) [custom_components.climate.lyric] climate config: {}
2017-08-11 16:40:59 DEBUG (Thread-2) [custom_components.climate.lyric] Set up Lyric climate platform
2017-08-11 16:40:59 DEBUG (Thread-2) [custom_components.climate.lyric] away periods: []
2017-08-11 16:40:59 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 237, in _step
result = next(coro)
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 238, in async_add_entity
yield from entity.async_update_ha_state()
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/helpers/entity.py", line 247, in async_update_ha_state
device_attr = self.device_state_attributes
File "/home/homeassistant/.homeassistant/custom_components/climate/lyric.py", line 284, in device_state_attributes
"current_schedule_day": self._currentSchedulePeriodDay,
AttributeError: 'LyricThermostat' object has no attribute '_currentSchedulePeriodDay'
Fixed both
It works! In quick testing the temperature change finally functions, but away mode does not.
2017-08-11 17:34:10 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/core.py", line 1025, in _event_to_service_call
yield from service_handler.func(service_call)
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/climate/__init__.py", line 256, in async_away_mode_set_service
yield from climate.async_turn_away_mode_on()
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 "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/climate/__init__.py", line 628, in turn_away_mode_on
raise NotImplementedError()
NotImplementedError
I keep seeing Away mode being off. Not my understanding of Away mode. Away mode is the setback temperature if no one is home. If I am not home, allow the temperature to go up to a certain point before turning on the AC or let the temperature drop to a certain point before turning on the heat.
Both your thermostats are set on geofence, the component then checks if someone is in the geofence en reports that as the away state. Should be the same for the round and T5.
The Lyric has no possibilities to set the away mode. You would have to write your own automations for that like the one @arsaboo posted above. I’ll see if I can fire an event when you change the away mode in the UI so it can trigger an automation. The away mode of the thermostat will not change with this however.
OK, new version with away mode override possibility, not sure if I’m happy with the current approach, let me know what you think.
It now works as follows:
- When you turn away mode on or off in the ui (or by a service call) an event is fired:
override_away_on
&override_away_off
- You can use this event for any automation you want to do
- The away state of the component is also updated and will stay like this until you call the service
climate.lyric_reset_away
- When the service is called it will go back to it’s old normal behavior
So also update the services.yaml
file, should now be:
lyric_resume_program:
description: Resume the programmed schedule
fields:
entity_id:
description: Name(s) of entities to change
example: 'climate.kitchen'
lyric_reset_away:
description: Reset a overridden away mode
fields:
entity_id:
description: Name(s) of entities to change
example: 'climate.kitchen'
The confusion is because of the way away
mode is used in Lyric. Unlike other thermostats, we cannot change to away
mode. To be consistent with other thermostats, I like this approach (or some version of it). User can trigger away
and change settings based on presence and turn it off when they are back. Instead of calling these services override_away_on
and override_away_off
, can we call the two services lyric_away_on
and lyric_away_off
? Also, not sure if we need two separate services lyric_reset_away
and lyric_resume_program
. May be we can use lyric_resume_program
to also reset away
mode.
Seeing these in the logs
2017-08-12 10:06:41 ERROR (Thread-12) [lyric] Error Lyric API: 401 Client Error: Unauthorized for url: https://api.honeywell.com/v2/locations?apikey=XXXXXXX
2017-08-12 10:06:41 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.lyricmaster 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
Given that these are appearing exactly at the same time, I am guessing that HA fails to communicate occasionally and gives that error. Extended logs here…you can see there are two different types of errors that keep appearing.
Even if away mode isn’t available, we can still at least force it to a new temperature setting and emulate away. That’s basically what I’ve been doing with IFTTT to more conveniently and reliably control it than the native application anyway.
That is exactly what the event override_away_on
will allow you to do.
Seeing these when I restart HA after some time:
2017-08-13 14:56:01 ERROR (Thread-25) [lyric] Error Lyric API: 401 Client Error: Unauthorized for url: https://api.honeywell.com/v2/locations?apikey=Fl0bTaVUA4QVCTAZTP4GhQ0vjT9xy48v
2017-08-13 14:56:01 ERROR (MainThread) [homeassistant.setup] Error during setup of component lyric
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 194, in _async_setup_component
component.setup, hass, processed_config)
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/lyric.py", line 136, in setup
setup_lyric(hass, lyric, config)
File "/home/homeassistant/.homeassistant/custom_components/lyric.py", line 102, in setup_lyric
hass.data[DATA_LYRIC] = LyricDevice(hass, conf, lyric)
File "/home/homeassistant/.homeassistant/custom_components/lyric.py", line 150, in __init__
self._location = [location.name for location in lyric.locations]
File "/srv/homeassistant/lib/python3.5/site-packages/lyric/__init__.py", line 841, in locations
for location in self._locations]
TypeError: 'NoneType' object is not iterable
I have to then delete the lyric.conf and reauthorize it. I am using the python-lyric==0.0.12
version.
Not sure if I missed it but I am having a problem helping a buddy add his three T6 Pro to his HASS. He is running it on virtualenv running Ubuntu 16.04.
We are able to add and see the configure button on HASS and we are a able to authorize and select his three thermostats on the Honeywell websites. After clicking continue everything goes fine but we are not seein any new entities. There seem to be some errors and here is what we are seeing…
Any help would be appreciated. Also, we used the most current lyric.py files. Here are the logs…
2017-08-13 18:21:38 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 <listcomp>
devices = [LyricThermostat(location, device, hass, temp_unit, has_fan, away_periods)
File "/home/homeassistant/.homeassistant/custom_components/lyric.py", line 159, in thermostats
for device in location.thermostats:
File "/srv/homeassistant/lib/python3.5/site-packages/lyric/__init__.py", line 193, in thermostats
for device in self._devices:
File "/srv/homeassistant/lib/python3.5/site-packages/lyric/__init__.py", line 160, in _devices
return self._lyric_api._devices(self._locationId, forceGet)
File "/srv/homeassistant/lib/python3.5/site-packages/lyric/__init__.py", line 818, in _devices
value = self._location(locationId)['devices']
KeyError: 'devices'