Make sure that the two lyric.py files and the climate folder are owned by the homeassistant user or whatever user HA runs under. Check the current ownership of the other files in the folders with ls -l
I found that every time I restarted HA, I needed to delete the lyric.conf file in the homeassistant directory and re-authenticate. It looks like it required a token refresh. I donāt know if this is just me, but in looking through the API pages on the Honeywell developer site I saw that I could refresh the token with a curl command line string. I just set up a cron job to run the curl string every 15 minutes.
https://developer.honeywell.com/authorization-oauth2/apis/post/token-0
The curl method could be used to perform other things as well, like changing temps, going from heat to cool.
No, the problem is that when there is a refresh, the token sometimes is shorter than the last time, and it just overwrites now and does not empty the file. So there stays a char behind. I fixed this already, will push an update soon when I have also fixed the temperature set function. But still donāt have much time, unfortunatelyā¦
I was wonder if this could be combined into the main Lyric component eventually. EDIT: Scratch that, I meant Honeywell
What main Lyric component?
No, it is completely different product, so would not make sense to combine it with the Honeywell component.
I disagree that it is a completely different product. Or rather, I donāt think that access / control will be separate for long. Take a look at a few things:
- Take a look through this issue #3468. @jzwack is a Honeywell API Evangelist. Itās a very informative thread, but this is some interesting for quoted below:
Right now we have two API sets, one is completely public via developer.honeywell.com. That covers our Lyric line of products.
We are working on getting the Total Connect Comfort (TCC) line on that site as well, problem is the process of handing out API keys isnāt automated yet (itās all on me, manually).
For the Lyric API we support Auth Code only right now.
For the TCC API we support all three flows (Auth Code, Client Credentials, and ROPC).
- Take a look here as well as here. Itās my entirely unsubstantiated feeling that under the
Device ID:
LCC
andTCC
stand for Lyric Connect Comfort and Total Connect Comfort.
To me, this indicates commonality, and if not now, an eventual merger of access methods to these devices. Similar to how the Wink component/platform evolved as access methods changed.
@Bram_Kragten, I donāt want to take away anything you have done, or will be doing. This is great, essential work that will help quite a few people.
A little update (yes, taken way too long).
- Fixes the token json extra data error.
- Fixed changing the setpoint while in a schedule.
Change the requirements: (or download the new file)
REQUIREMENTS = [
āhttps://github.com/bramkragten/python-lyricā
ā/archive/v0.0.5-alpha.1.zipā
ā#python-lyric==0.0.5ā]
After successfully configuring, I see the following in the logs:
The following errors have been logged this session:
2017-08-07 12:25:25 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.6/asyncio/tasks.py", line 179, in _step
result = coro.send(None)
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py", line 125, in _async_setup_platform
self.hass, self.config, self.domain, platform_type)
File "/usr/lib/python3.6/site-packages/homeassistant/setup.py", line 242, in async_prepare_setup_platform
platform = loader.get_platform(domain, platform_name)
File "/usr/lib/python3.6/site-packages/homeassistant/loader.py", line 104, in get_platform
return get_component(PLATFORM_FORMAT.format(domain, platform))
File "/usr/lib/python3.6/site-packages/homeassistant/loader.py", line 142, in get_component
module = importlib.import_module(path)
File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 978, in _gcd_import
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 674, in exec_module
File "<frozen importlib._bootstrap_external>", line 781, in get_code
File "<frozen importlib._bootstrap_external>", line 741, in source_to_code
File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
File "/config/custom_components/climate/lyric.py", line 50
devices = [LyricThermostat(location, device, temp_unit, has_fan)
^
TabError: inconsistent use of tabs and spaces in indentation
I am using it as custom component.
You should not update /climate/lyric.py, very much a work in progress, should have done that in a different branchā¦
Just bump the version of the python-lyric package in components/lyric.py.
Will bring a bigger update soon.
Coolā¦will wait for the next update.
Not really new things in the component yet, but the code is working again.
Be sure to also grap the service.yaml file in the components/climate folder:
lyric_resume_program:
description: Resume the programmed schedule
fields:
entity_id:
description: Name(s) of entities to change
example: 'climate.kitchen'
Slightly different error this timeā¦still no climate
entity
2017-08-08 22:11:46 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform lyric
Traceback (most recent call last):
File "/usr/lib/python3.6/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.6/asyncio/tasks.py", line 352, in wait_for
return fut.result()
File "/usr/lib/python3.6/asyncio/futures.py", line 244, in result
raise self._exception
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/climate/lyric.py", line 58, in setup_platform
for location, device in hass.data[DATA_LYRIC].thermostats()]
File "/config/custom_components/climate/lyric.py", line 57, in <listcomp>
devices = [LyricThermostat(location, device, temp_unit, has_fan)
File "/config/custom_components/lyric.py", line 151, in thermostats
for device in location.thermostats:
File "/config/deps/lib/python3.6/site-packages/lyric/__init__.py", line 262, in thermostats
if 'deviceID' in self._devices[0]:
IndexError: list index out of range
Looks like it canāt find any devices, are you sure the account you are using has devices?
Yes, it does. I only have one Honeywell account and one lyric thermostat there.
I removed lyric.conf and re-authenticated the account. I could see the thermostat when I configured, but I still get that error in HA.
OK, Iāll fix the error in the next release of python-lyric. But it is working now?
Noā¦it is not working. I donāt see the climate entity.