@claytonjn Thanks! I can confirm that fixes it here too.
I replaced the file before upgrading to 0.84.0 and wound up having to delete the custom_components\switch\__pycache__ directory and restart Home Assistant again before the switch returned.
I couldn’t believe it when I got back home from the store and you had already created a fix. Thank you again! This component is amazing!
FYI the command I used to upgrade/roll-back versions is from the Hassio CLI and can be used in an SSH/IDE terminal.
Yup, you can run that to upgrade any time, so long as the content is available. I’ve also used it to downgrade back to the previous version. Thank you again!
Not sure if it’s important as the component seems to be functioning correctly but I noticed this message pops up in the logs on every reboot of Home Assistant:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 349, in _async_add_entity
await entity.async_added_to_hass()
File "/config/custom_components/switch/circadian_lighting.py", line 173, in async_added_to_hass
state = await self.sync_get_last_state()
AttributeError: 'CircadianSwitch' object has no attribute 'sync_get_last_state'
I updated to 0.84, but now I get error (I downloaded the newest versions of the circadian_lighting.py):
2018-12-12 23:47:24 ERROR (MainThread) [homeassistant.loader] Error loading custom_components.circadian_lighting. Make sure all dependencies are installed
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/loader.py", line 92, in get_component
module = importlib.import_module(path)
File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/config/custom_components/circadian_lighting.py", line 9, in <module>
from custom_components.circadian_lighting import DOMAIN, CIRCADIAN_LIGHTING_UPDATE_TOPIC, DATA_CIRCADIAN_LIGHTING
ImportError: cannot import name 'DOMAIN'
2018-12-12 23:47:24 ERROR (MainThread) [homeassistant.loader] Unable to find component circadian_lighting
2018-12-12 23:47:24 ERROR (MainThread) [homeassistant.setup] Setup failed for circadian_lighting: Component not found.
Since you already have the new file in place try stopping home assistant then deleting all of the __pycache__ directories from the custom_components folder and restart Home Assistant again.
The only thing I can guess is that you’re missing files or they’re not in the right spot. That error shows that it can’t find DOMAIN in custom_components/circadian_lighting.py but line 54 should be
My bad, I had /switch/circadian_lighting.py in /circadian_lighting.py.
I can confirm finally it’s working in 0.84 with Yeelights. Even Flux works. I think the misterious " “Improved service calling” in changelog did the job.
I have configured it under lights_ct (mired) and works well. I don’t know the reason why, but it is cool that I don’t need to config it under _xy, _rgb.
Yes, my experience is that it’s typically best to set up lights in CL as they are controlled - so if you control lights individually, they should be individually defined in CL; if you always control as a group then the group should be defined in CL.
Yes, I believe that’s what’s happening. Your configuration shows min_mireds: 153 which is equivalent to ~6,500 Kelvin and max_mireds: 370 which is equivalent to ~2,700 Kelvin. In CL you should define min_colortemp: 2700. If you want you could increase max_colortemp to 6500 to utilize the full range of the lights, but that’s past what occurs naturally so I personally wouldn’t change the max.