place the elevation-line in configuration.yaml, restart HA
After this, it works.
I just updated to the new versions. HA version: 0.91.0
Result:
019-04-05 15:17:07 ERROR (MainThread) [homeassistant.setup] Error during setup of component circadian_lighting
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/homeassistant/setup.py", line 154, in _async_setup_component
component.setup, hass, processed_config) # type: ignore
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/circadian_lighting/__init__.py", line 111, in setup
interval, transition)
File "/config/custom_components/circadian_lighting/__init__.py", line 137, in __init__
self.data['percent'] = self.calc_percent()
File "/config/custom_components/circadian_lighting/__init__.py", line 202, in calc_percent
today_sun_times = self.get_sunrise_sunset(now)
File "/config/custom_components/circadian_lighting/__init__.py", line 170, in get_sunrise_sunset
location.elevation = self.data['elevation']
File "/usr/local/lib/python3.7/site-packages/astral.py", line 678, in elevation
self._elevation = int(elevation)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
2019-04-05 15:17:08 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of circadian_lighting.switch. Setup failed for dependencies: circadian_lighting
2019-04-05 15:17:08 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform circadian_lighting.switch: Could not set up all dependencies.
2019-04-05 15:17:08 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of circadian_lighting.switch. Setup failed for dependencies: circadian_lighting
2019-04-05 15:17:08 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform circadian_lighting.switch: Could not set up all dependencies.
2019-04-05 15:17:08 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of circadian_lighting.switch. Setup failed for dependencies: circadian_lighting
2019-04-05 15:17:08 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform circadian_lighting.switch: Could not set up all dependencies.
2019-04-05 15:17:08 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of circadian_lighting.switch. Setup failed for dependencies: circadian_lighting
2019-04-05 15:17:08 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform circadian_lighting.switch: Could not set up all dependencies.
2019-04-05 15:17:08 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of circadian_lighting.switch. Setup failed for dependencies: circadian_lighting
2019-04-05 15:17:08 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform circadian_lighting.switch: Could not set up all dependencies.
2019-04-05 15:17:08 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of circadian_lighting.switch. Setup failed for dependencies: circadian_lighting
2019-04-05 15:17:08 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform circadian_lighting.switch: Could not set up all dependencies.
2019-04-05 15:17:08 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of circadian_lighting.switch. Setup failed for dependencies: circadian_lighting
2019-04-05 15:17:08 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform circadian_lighting.switch: Could not set up all dependencies.
2019-04-05 15:17:08 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of circadian_lighting.switch. Setup failed for dependencies: circadian_lighting
2019-04-05 15:17:08 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform circadian_lighting.switch: Could not set up all dependencies.
2019-04-05 15:17:08 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of circadian_lighting.switch. Setup failed for dependencies: circadian_lighting
2019-04-05 15:17:08 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform circadian_lighting.switch: Could not set up all dependencies.
2019-04-05 15:17:08 WARNING (MainThread) [homeassistant.loader] You are using a custom component for circadian_lighting.sensor which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-04-05 15:17:08 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of circadian_lighting.sensor. Setup failed for dependencies: circadian_lighting
2019-04-05 15:17:08 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform circadian_lighting.sensor: Could not set up all dependencies.
Indeed it is! It appears that just because it has latitude and longitude attributes it shows up. Are you sure this is new behavior though? The CL sensor has has latitude and longitude attributes since inception.
The way I built the component it includes all configuration options as attributes of the sensor; mostly just for easy reference in the front end. If Iâm going to rework the code so that lat/long arenât included (so the sensor doesnât show up on the map) Iâll probably change the behavior so that only calculated values are exposed as attributes. Iâm interested in everyoneâs thoughts on this.
Keep all configuration options as attributes (CL sensor will be included in HA Map)
Only include calculated values as attributes (percent, colortemp, rgb_color, xy_color, hs_color, unit_of_measurement, friendly_name, icon)
Sorry, I should have mentioned that this isnât linked to the updated code but I only just got around to mentioning it. Itâs not a big deal so it might not be worth it to re-work the whole thing just to remove the lat/long if itâs too much effort.
That said, the lat/long might not be worth including if theyâre just part of the setup and donât need to be read by users (though as you wrote in the OP some people might want to configure it for different locations and keep track of that. Seems like a bit of an edge case though).
Has anyone try this component with a philips downlight? It can change brightness, but I cannot make it to change its temperature. What am I doing wrong? I tried with rgb, xy and ct modes with no luck.
EDIT: With an Aqara led bulb happens the same, only brightness, no color temperature.
With yeelights and rgb mode is working great.
after a few hours of playing with this, i am so impressed and thankful for this addition to my home assistant setup. i have noticed in my setup and others screen shots that sunset doesnât seem to display in the sensor. does that mean itâs not detecting the sunrise / sunset time from ha?
Are you able to set color temperature or color with the light.turn_on service call?
Are you referring to sunrise time and sunset time? If so, that just displays your hard-coded values if you have them set. Iâm thinking about removing the manually configured variables from attributes and posts a poll asking for opinions here: Circadian Lighting [Custom Component] - #355 by claytonjn. Iâm going to give it a bit more time but it looks like Iâll probably be cleaning it up.
my vote would be to show all the values in the sensor and then have the hard coded overrides be there only if used. i am using this sensor report to see if my configuration.yaml is coded and formatted correctly, so i have made several changes and then check the results here. it definitely helped me know what was working and what wasnât, so please donât remove the location info. it does not bother me that it shows up in the map, unless itâs doing some harm that i canât perceive.
a feature request from my perspective would be the ability to configure the temperature color and other values in the gui, in the same way i now control the color led bulbs and group lights.
thanks again, this is really great stuff. i also vote for integrating this into home assistant.
Yes, I just tried it and it works without problems with âkelvinâ and âbrightness_pctâ
Two more questions:
How can I set up min and max color temperature if I have different bulbs? Because they are declared as global variables when declaring circadian_lighting right? (my yeelight have a wide range color temperature than philips downlights)
I have an aqara led bulb (ZNLDP12LM) controlled with zigbee2mqtt and if I have enabled your component, I cannot turn off the light. It is like the component is always sending turn_on commands, so if I try to switch it of, it tries but then turn on again. What can I do with that?
Thanks for your time developing and answering all this, I came from flux and this is waaaay better.
now i am really getting into this, and i see the limitation of what i want this to do. i am wondering if possibly there is an easy fix? using lights_rgb, i seem to get almost perfect output on my lights from daylight to night, and i can tweak color output with min/max colortemp and min/max brightness.
the brightness and color are perfect at the bottom of the spectrum around midnight - rgb=255,0,0. but not in the top of the spectrum around noon. i would greatly prefer rgb=255,255,153 - a shift to much warmer daytime color.
my lights are 5 channel so it may be ideal to be able to set the color and brightness directly with my own custom ranges on each channel. the channels of the lohas color rgb bulbs i am working with are R,G,B,CW,WW, expressed in a range from 0-200, so the daytime color recipe is 200,200,0,0,100, and i think the night time recipe is something like 50,0,0,0,0.
the limitation imho, seems to be from the use of mired light calculations. to be fair, it is the most accurate way to do what you set out to do, but i want to override that on my setup so that i can shift between red and yellow instead of red and blue, as mired does. (the planet i live on shifts between red and yellow, instead of the red and blue on your planet, lol. simple, right? lol. hopefully. thanks!
Your color temperature range is determined by the âweakest linkâ. In order to keep color temperature of all lights in sync, if you have light A that has range 2000-5500 and light B with range 2500-6000, you should set your min_colortemp to 2500 and max_colortemp to 5500.
You must have a very small min_colortemp (less than 6?) to get pure red ([255, 0, 0]). Even with max_colortemp at 6500 the red and green channels should still be maxed out, so you wouldnât be in the blue range yet (6500 should be close to pure white, anything less and youâre still red/yellow).
With that configuration your lights should go from ~ [255, 108, 0] to [255, 198, 151]. Are you sure CL is setting your lights to [255, 0, 0]?
Regardless, Iâm not sure exactly what you want or how it could be implemented in CL. The whole basis of CL is to follow the kelvin/mired CT scale - if you want something different this probably isnât the best solution.