hass-circadian_lighting icon indicating copy to clipboard operation
hass-circadian_lighting copied to clipboard

2021.5.0

Open matteos1 opened this issue 3 years ago • 36 comments

not work with new version 2021.5.0

matteos1 avatar May 05 '21 20:05 matteos1

Same as #148

cdemi avatar May 05 '21 20:05 cdemi

I love this integration, I can't live without it! :-) Wat can I do to help? Also not working in 2021.5:

Error during setup of component circadian_lighting:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 248, in _async_setup_component
    result = await task
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/circadian_lighting/__init__.py", line 109, in setup
    cl = CircadianLighting(hass, min_colortemp, max_colortemp,
  File "/config/custom_components/circadian_lighting/__init__.py", line 139, in __init__
    self.data['percent'] = self.calc_percent()
  File "/config/custom_components/circadian_lighting/__init__.py", line 210, in calc_percent
    today_sun_times = self.get_sunrise_sunset(now)
  File "/config/custom_components/circadian_lighting/__init__.py", line 174, in get_sunrise_sunset
    location = astral.Location()
AttributeError: module 'astral' has no attribute 'Location'

Traceback (most recent call last):

File "/usr/src/homeassistant/homeassistant/setup.py", line 248, in _async_setup_component
result = await task
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/circadian_lighting/__init__.py", line 109, in setup
cl = CircadianLighting(hass, min_colortemp, max_colortemp,
File "/config/custom_components/circadian_lighting/__init__.py", line 139, in __init__
self.data['percent'] = self.calc_percent()
File "/config/custom_components/circadian_lighting/__init__.py", line 210, in calc_percent
today_sun_times = self.get_sunrise_sunset(now)
File "/config/custom_components/circadian_lighting/__init__.py", line 174, in get_sunrise_sunset
location = astral.Location()
AttributeError: module 'astral' has no attribute 'Location'

And concerning the version number: (that's easy to fix) ;-)

2021-05-05 23:56:20 ERROR (MainThread) [homeassistant.loader] No 'version' key in the manifest file for custom integration 'circadian_lighting'. As of Home Assistant 2021.6, this integration will no longer be loaded. Please report this to the maintainer of 'circadian_lighting'

filmgarage avatar May 05 '21 22:05 filmgarage

I found a temporary solution until the issue with astral is fixed. Just need to add the next lines into circadian_lighting config:

  sunrise_time: '06:00:00'
  sunset_time: '20:00:00'

(change the time to average sunrise and sunset time in your area)

aksyonov avatar May 05 '21 22:05 aksyonov

Thanks @aksyonov that works for now!

filmgarage avatar May 05 '21 23:05 filmgarage

not a solution for countries in the north regions, light changes so fast most of the time, light extending 15-30 minutes pr day now

dartfrogdk avatar May 06 '21 07:05 dartfrogdk

I tried this, but unfortunately it seems configuration.yaml does not support variables here:

sunrise_time: '{{ as_timestamp(strptime(state_attr("sun.sun", "next_dawn"), "")) | timestamp_custom("%H:%M:%S")}}' sunset_time: '{{ as_timestamp(strptime(state_attr("sun.sun", "next_dusk"), "")) | timestamp_custom("%H:%M:%S")}}'

sevorl avatar May 06 '21 07:05 sevorl

Best addon and not working 😢

dartfrogdk avatar May 06 '21 07:05 dartfrogdk

I tried this, but unfortunately it seems configuration.yaml does not support variables here:

sunrise_time: '{{ as_timestamp(strptime(state_attr("sun.sun", "next_dawn"), "")) | timestamp_custom("%H:%M:%S")}}' sunset_time: '{{ as_timestamp(strptime(state_attr("sun.sun", "next_dusk"), "")) | timestamp_custom("%H:%M:%S")}}'

Yup, got an error as well. I hope we can work this out soon. This integration is a life saver!

cybershadow1 avatar May 06 '21 10:05 cybershadow1

For the time being you might try out the adaptive-lighting integration (see this PR in core.)

The code also lives here https://github.com/basnijholt/adaptive-lighting (add as custom repo to HACS).

This code is based on this integration and has some extra features.

basnijholt avatar May 06 '21 10:05 basnijholt

For the time being you might try out the adaptive-lighting integration (see this PR in core.)

The code also lives here https://github.com/basnijholt/adaptive-lighting (add as custom repo to HACS).

This code is based on this integration and has some extra features.

@basnijholt How easy is it to migrate from hass-circadian_lighting into adaptive-lighting, or does it mean I have to configure everything from the scratch?

Kirbo avatar May 07 '21 10:05 Kirbo

@kirbo

Depends on how heavily your configuration relies on certain concepts that differ between the two implementations. I read the documentation of adaptive-lighting and some concepts are different from circadian lighting - e.g. the "talking back control" thingy.

I implemented different automations/scenes/events to implement this feature with circadian lighting in my home assistant config, because this project just offers you the one switch to disable the automation. I think https://github.com/basnijholt/adaptive-lighting has put more effort in those use cases and you can control it better and more differentiated. I guess as adaptive-lighting will probably make it to core is one more reason to switch.

And finally this project seems to be unmaintained at the moment, because the issue is not really addressed. No front to @claytonjn though - we all know real life and work can make maintaining open source projects hard from time to time - so thank you very much for the idea & base implementation ❤️

flecmart avatar May 07 '21 10:05 flecmart

I don't think this project has been updated in a very long time. I made the switch to Adaptive lighting, but I only was in trialing stage. The ability for Adaptive Lighting to disable itself based on manual control is helpful. Even if you use a voice assistant to change a light, there is a setting to stop Adaptive Lighting taking over again.

austwhite avatar May 07 '21 11:05 austwhite

I will definitely give adaptive-lighting a try. Does anyone have experience using this with Ikea Tradfri bulbs? These have a known issue, that color temp and brightness can not be set in the same call.

sevorl avatar May 07 '21 12:05 sevorl

I will definitely give adaptive-lighting a try. Does anyone have experience using this with Ikea Tradfri bulbs? These have a known issue, that color temp and brightness can not be set in the same call.

I figured it out myself: There is an option to control temp and brightness in two steps. Awesome!

sevorl avatar May 07 '21 13:05 sevorl

I don't think this project has been updated in a very long time.

The dev has a Twitter account (https://twitter.com/claytonjn) which also shows a Facebook account (https://www.facebook.com/claytonjn). I don't have either but perhaps it's worth someone contacting him there directly.

masterfish1 avatar May 08 '21 15:05 masterfish1

Just use adaptive - lightning it is working perfectly

dartfrogdk avatar May 08 '21 15:05 dartfrogdk

Replace init.py with this fix https://github.com/robertomano24/circadian_lighting/blob/master/custom_components/circadian_lighting/init.py until a new version is released.

RobertDWhite avatar May 09 '21 00:05 RobertDWhite

Replace init.py with this fix https://github.com/robertomano24/circadian_lighting/blob/master/custom_components/circadian_lighting/init.py until a new version is released.

Thanks, but how to fix this issue: ModuleNotFoundError: No module named 'timezonefinder'

Xitro01 avatar May 09 '21 12:05 Xitro01

@robertomano24's solution works for me. Thanks!

@Xitro01: This should have been installed by HACS with the Circadian Lighting add-in. timezonefinder is listed as a dependency in manifest.json. Try this: remove the add-in (through HACS and config.yaml), restart Home Assistant, re-install the add-in (via HACS and config.yaml), replace __init__.py with robertomano24's version, then restart hass again.

elahd avatar May 11 '21 13:05 elahd

Replace init.py with this fix https://github.com/robertomano24/circadian_lighting/blob/master/custom_components/circadian_lighting/init.py until a new version is released.

Thanks, but how to fix this issue: ModuleNotFoundError: No module named 'timezonefinder'

Yes, unfortunaly not working with docker out of the box.

cwildfoerster avatar May 12 '21 07:05 cwildfoerster

@robertomano24's solution works for me. Thanks!

@Xitro01: This should have been installed by HACS with the Circadian Lighting add-in. timezonefinder is listed as a dependency in manifest.json. Try this: remove the add-in (through HACS and config.yaml), restart Home Assistant, re-install the add-in (via HACS and config.yaml), replace init.py with robertomano24's version, then restart hass again.

Replacing the manifest and restarting hass was enough, thanks!

Xitro01 avatar May 12 '21 07:05 Xitro01

I found a temporary solution until the issue with astral is fixed. Just need to add the next lines into circadian_lighting config:

  sunrise_time: '06:00:00'
  sunset_time: '20:00:00'

(change the time to average sunrise and sunset time in your area)

Worked for me! Would be great if we can get it working without the hack.

JaimeZX avatar May 18 '21 11:05 JaimeZX

just use adaptive lightning, much better solution

dartfrogdk avatar May 18 '21 11:05 dartfrogdk

Unfortunately, this repo looks like it's dead and abandoned

MTrab avatar May 19 '21 13:05 MTrab

Here is a fork that works: https://github.com/robertomano24/circadian_lighting I will do my best to keep this fork updated to work with HA. It should be working now. You will need to add the files to your custom_components folder manually.

If you use Hue and want the Hue scenes you make to update with CL values for a seamless integration, check out my repo here: https://github.com/robertomano24/circadian_lighting-hue

RobertDWhite avatar May 23 '21 20:05 RobertDWhite

Sorry for my absence, I have a new puppy and job that have been keeping me busy!

This has been implemented in version 2.0.4-beta, which also changes the component to be async along with a couple other changes. Please test and let me know if everything is working properly - if so I will push to a general release. Thanks!

claytonjn avatar May 28 '21 19:05 claytonjn

2.0.4-beta worked for me. As soon as HA finished restarting it picked up the lights again. Thanks for your work and congrats on the new puppy and job!

techguydave avatar May 28 '21 20:05 techguydave

I'm out of town right now but I'll try it when I get home. Thanks!

Jim

Sent from my stupid work iPhone

On May 29, 2021, at 5:19 AM, David Thomas @.***> wrote:

 2.0.4-beta worked for me. As soon as HA finished restarting it picked up the lights again. Thanks for your work and congrats on the new puppy and job!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

JaimeZX avatar May 29 '21 07:05 JaimeZX

2.0.4 fixed it for me.

davidclemens avatar May 31 '21 22:05 davidclemens

Got a handful of people confirming that 2.0.4 is working properly and no complaints about compatibility with HA Core 2015.5.x so I'm going to close this issue. Thanks everyone!

claytonjn avatar Jun 01 '21 13:06 claytonjn