GithubHelp home page GithubHelp logo

basnijholt / adaptive-lighting Goto Github PK

View Code? Open in Web Editor NEW
1.6K 1.6K 123.0 1.35 MB

Adaptive Lighting custom component for Home Assistant

Home Page: https://basnijholt.github.io/adaptive-lighting/

License: Apache License 2.0

Python 98.83% Dockerfile 0.59% Shell 0.58%
adaptive-lighting automation home-assistant hue iot lights sunrise sunset zigbee

adaptive-lighting's Introduction

Bas Nijholt 👋

  • 👷🏻‍♂️ Currently at IonQ, doing my bit in building a quantum computer, before that I was at Microsoft Quantum.
  • 🌟 A deep dive into computational topological quantum mechanics earned me my PhD.
  • 🎨 I've crafted a few libraries for Home Assistant, making home automation a bit more fun.
  • ⚒️ Made other tools speed up and massively parallelize numerical simulations.
  • 🏅 Very passionate about open-source, software quality, user experience, and smooth performance.
  • 🐍 Python is my go-to language in most of my projects.
  • Some of my favorite creations:
    • 📈 python-adaptive/adaptive: Parallel active learning of mathematical functions? Check!
    • 🧬 unidep: Unifying pip and conda requirements, single command to set up a full dev environment.
    • 💡 adaptive-lighting: A custom component for Home Assistant to keep your lighting in synn with the sun.
    • 📝 markdown-code-runner: Run (hidden) code blocks right within your Markdown files - keep simple README.mds in sync!
    • 🕒 rsync-time-machine.py: Time Machine-style backups with rsync for the minimalists.
    • 🏠 home-assistant-config: Over 100 documented automations in my Home Assistant config

Below are some (automatically generated) statistics about my activity on GitHub. For more info check out my website www.nijho.lt or talk to me on Mastodon.

Ask me about:

Last updated at 2024-04-30 12:10:31.008276.

GitHub statistics — my top 20

number of GitHub stars ⭐️

  1. basnijholt/home-assistant-config, 1645 ⭐️s
  2. basnijholt/adaptive-lighting, 1608 ⭐️s
  3. python-adaptive/adaptive, 1113 ⭐️s
  4. python-kasa/python-kasa, 1094 ⭐️s
  5. basnijholt/lovelace-ios-themes, 563 ⭐️s
Click to expand!
  1. basnijholt/lovelace-ios-dark-mode-theme, 441 ⭐️s
  2. basnijholt/rsync-time-machine.py, 366 ⭐️s
  3. basnijholt/miflora, 360 ⭐️s
  4. topocm/topocm_content, 267 ⭐️s
  5. basnijholt/home-assistant-streamdeck-yaml, 206 ⭐️s
  6. basnijholt/unidep, 205 ⭐️s
  7. basnijholt/home-assistant-macbook-touch-bar, 95 ⭐️s
  8. kwant-project/kwant, 84 ⭐️s
  9. basnijholt/markdown-code-runner, 81 ⭐️s
  10. basnijholt/home-assistant-streamdeck-yaml-addon, 62 ⭐️s
  11. basnijholt/aiokef, 37 ⭐️s
  12. basnijholt/thesis-cover, 34 ⭐️s
  13. basnijholt/adaptive-scheduler, 26 ⭐️s
  14. basnijholt/instacron, 20 ⭐️s
  15. kwant-project/kwant-tutorial-2016, 19 ⭐️s

number of commits :octocat:

  1. python-adaptive/adaptive, 1427 commits :octocat:
  2. basnijholt/adaptive-scheduler, 755 commits :octocat:
  3. basnijholt/thesis, 452 commits :octocat:
  4. basnijholt/supercurrent-majorana-nanowire, 282 commits :octocat:
  5. conda-forge/staged-recipes, 279 commits :octocat:
Click to expand!
  1. basnijholt/net-worth-tracker, 228 commits :octocat:
  2. python-adaptive/paper, 198 commits :octocat:
  3. home-assistant/core, 192 commits :octocat:
  4. basnijholt/spin-orbit-nanowires, 191 commits :octocat:
  5. ohld/igbot, 191 commits :octocat:
  6. basnijholt/instacron, 115 commits :octocat:
  7. microsoft/Qcodes, 109 commits :octocat:
  8. basnijholt/yaml2bib, 91 commits :octocat:
  9. basnijholt/home-assistant-streamdeck-yaml-addon, 80 commits :octocat:
  10. basnijholt/home-assistant-macbook-touch-bar, 69 commits :octocat:
  11. conda-forge/kwant-feedstock, 65 commits :octocat:
  12. basnijholt/miflora, 57 commits :octocat:
  13. AppDaemon/appdaemon, 52 commits :octocat:
  14. conda-forge/hpc05-feedstock, 49 commits :octocat:
  15. basnijholt/conda-recipes, 48 commits :octocat:

These plots and stats are generated by this Jupyter notebook using this GitHub Action.

adaptive-lighting's People

Contributors

allcontributors[bot] avatar badboybeyer avatar basnijholt avatar baylanger avatar bedaes avatar brebtatv avatar claytonjn avatar covid10 avatar danaues avatar davst avatar djelibeybi avatar hudsonbrendon avatar hypfer avatar itssimon avatar lejoui avatar mangoscango avatar mark-niemeyer avatar matt-forster avatar pre-commit-ci[bot] avatar protyposis avatar rubenkelevra avatar shulyaka avatar sindrebroch avatar skycarl avatar spar34vi avatar th3w1zard1 avatar travisp avatar weblate avatar willpuckett avatar wrt54g avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adaptive-lighting's Issues

set_manual_control: Make `lights` attribute optional

Per your request I am officially making a feature request.

Proposed adaptive_lighting.set_manual_control changes:

  1. Make lights optional.
  2. Apply the change to all lights in represented by the entity_id when lights is not set.

I think it is safe to assume if a user chooses to omit the lights attribute that they expect the effect to be applied to all lights in that group.

Here is an mock-up of a situation where I am currently being forced to attempt to use an (as yet untested) template to expand a list of entities in a group, to set manual_control to false.

# Set the example value of the area variable.
- variables:
    area: 'play_room'

# Restore Adaptive Lighting for all lights in this area.
- service: adaptive_lighting.set_manual_control
  data:
    entity_id: 'switch.adaptive_lighting_{{ area }}'
    lights: '{{ expand("group." ~ area ~ "lights") | map(attribute="entity_id") | list }}'
    manual_control: false

Adaptive lighting doesn't resume control after lights turn off and on outside of HA

Firstly, thanks for putting in the effort make this, its really cool so far.

I have a deconz with a conbee II controlling a mixture of Hue and innr bulbs. My primary control device is my hue dimmer switch which is hooked up directly to deconz/phoscon.

This is my settings used in Adaptive lighting

image

I have run some tests and found that if i change the lights with either HA or the hue remote adaptive lighting notices and stops adjusting the light. This is great.

The problem is if i turn the light off and on with the hue remote adaptive lighting doesnt spot this and kick in again. However If i turn the light off and on from the home assistant UI it correctly starts adjusting the light again.

Therefore it looks like there is a bug in the last option (detect non HA changes). Deconz is local push so it should be possible to detect the off/on cycle however i am not familiar with internals of homeassistant / adaptive lighting

Let me know if theres any more info i can provide or if i can help with debugging as im really keen to use adaptive lighting in place of circadian for this feature. For example is there a logs i can share (not sure where to find them)

PS I have just updated to the latest version of adaptive lighting (4d24249) and i still see all the above behaviour.

Some lights change color temperature on plain white

Some lights have a warm white when they're not in color mode, and then when they're slightly off white they're a cooler white (R + G + B instead of Warm White). Can adaptive lighting work with this behavior?

Some instances adapting, others are not

Hello! I seem to be having a slew of problems this morning, so apologies for the generic nature of the subject here. I’ll try to enumerate everything that’s going on. So far I have enabled logging but can’t seem to figure out where it’s spit out.

So as far as my current setup, here is my AL configuration:

- name: "Default"
  lights:
    - light.kitchen_cabinets
    - light.family_room_mantle
    - light.family_room_console
    - light.living_room_lamp
  min_brightness: 30
  take_over_control: true
  detect_non_ha_changes: true

- name: "Office"
  lights:
    - light.office_hue_play
    - light.office_ceiling_light
    - light.office_accent
  min_brightness: 30
  take_over_control: true
  detect_non_ha_changes: true

- name: "Bedroom"
  lights:
    - light.bedroom_nightstands
    - light.bedroom_bed_light
    - light.bedroom_dresser_lamp
  take_over_control: true
  detect_non_ha_changes: true

- name: "Landing"
  lights:
    - light.landing_ceiling_light
  take_over_control: true
  detect_non_ha_changes: true

- name: "Nash's Bedroom"
  lights:
    - light.nashs_dresser_lamp

Then here’s what I have in configuration.yaml:

logger:
  default: warning
  logs:
    homeassistant.components.homekit: debug
    custom_components.adaptive_lighting: debug

…

adaptive_lighting: !include adaptive-lighting.yaml

Note: the is not in the actual file.

A couple of unordered things from this morning:

  • The Default lights do seem to be adapting the color just fine, but nothing else is adapting color right now (stuck at peak warmness). I checked and the color toggle does indeed seem to be set to On for those instances.
  • Also note with the above: I know AL is in control, because when I toggle Sleep mode in the office, it does change the lights.
  • The brightness on the lights in every instance were at nearly 80% even an hour before sunrise. The sun crossed over the horizon at 7:07am, and everything was 100% before that. Is that expected behavior?
  • I’ve tried to set up for manual control as mentioned in your readme, but it too doesn’t seem to be working at all. Any thoughts?
alias: 'AL: On manual light change, reset Adaptive Lighting after 1 hour'
description: ''
trigger:
  - platform: event
    event_type: adaptive_lighting.manual_control
condition: []
action:
  - delay: '01:00:00'
  - condition: template
    value_template: '{{ light in state_attr(switch, ''manual_control'') }}'
  - service: adaptive_lighting.set_manual_control
    data:
      entity_id: '{{ switch }}'
      lights: '{{ light }}'
      manual_control: false
mode: parallel
variables:
  light: '{{ trigger.event.data.entity_id }}'
  switch: '{{ trigger.entity_id }}'
max: 10

Any help would be wonderful! And hopefully this is helpful to you as well.

Transition in adaptive_lighting.apply only works once

Hi,

thanks for these great updates to this component.

I'm trying to use adaptive_lighting.apply with turn_on_lights: yes to turn on my lights in the evening using a long transition (30s) while smoothly fading directly to the current switch brightness / color temp.

However, the transition only works once (after HA (re)start) and gets overriden on all consecutive service calls (meaning the lights immediately adjust according to the switch configured transition, 1s in my case).
I checked the logs and found Detected an 'off' → 'on' event for the non-working apply/turn on calls.

See the following log snippets, where the first one is an instance of a working transition, and the second one where the lights immediately adjusted:

2020-10-18 20:28:20 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Living Room Spots: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.living_room_spot2', 'transition': 30.0, 'brightness': 138, 'color_temp': 500} with context.id='adapt_lgt_2f7e_adapt_lights_2'
2020-10-18 20:28:20 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Living Room Spots: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.living_room_spot3', 'transition': 30.0, 'brightness': 138, 'color_temp': 500} with context.id='adapt_lgt_2f7e_adapt_lights_3'
2020-10-18 20:28:20 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Living Room Spots: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.living_room_spot1', 'transition': 30.0, 'brightness': 138, 'color_temp': 500} with context.id='adapt_lgt_2f7e_adapt_lights_4'
2020-10-18 20:28:20 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Living Room Spots: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.living_room_spot4', 'transition': 30.0, 'brightness': 138, 'color_temp': 500} with context.id='adapt_lgt_2f7e_adapt_lights_5'
2020-10-18 20:28:20 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.living_room_spot2']')' event with context.id='adapt_lgt_2f7e_adapt_lights_2'
2020-10-18 20:28:20 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.living_room_spot3']')' event with context.id='adapt_lgt_2f7e_adapt_lights_3'
2020-10-18 20:28:20 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.living_room_spot1']')' event with context.id='adapt_lgt_2f7e_adapt_lights_4'
2020-10-18 20:28:20 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.living_room_spot4']')' event with context.id='adapt_lgt_2f7e_adapt_lights_5'
2020-10-18 20:28:20 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.living_room_spot2' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 1, 'color_temp': 500, 'hs_color': (0, 0), 'rgb_color': (255, 255, 255), 'xy_color': (0.323, 0.329), 'off_brightness': None, 'friendly_name': 'Spot 2', 'supported_features': 63}' with context.id='adapt_lgt_2f7e_adapt_lights_2'
2020-10-18 20:28:20 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.living_room_spot4' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 1, 'color_temp': 500, 'hs_color': (0, 0), 'rgb_color': (255, 255, 255), 'xy_color': (0.323, 0.329), 'off_brightness': None, 'friendly_name': 'Spot 4', 'supported_features': 63}' with context.id='adapt_lgt_2f7e_adapt_lights_5'
2020-10-18 20:28:21 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Living Room Spots: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt_2f7e_interval_6'
2020-10-18 20:28:21 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting: Living Room Spots: '_adapt_lights(['light.living_room_spots'], None, force=False, context.id=adapt_lgt_2f7e_interval_6)' called
2020-10-18 20:28:21 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Living Room Spots: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.living_room_spots', 'transition': 45.0, 'brightness': 137, 'color_temp': 500} with context.id='adapt_lgt_2f7e_interval_6'

2020-10-18 20:30:26 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Living Room Spots: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.living_room_spot2', 'transition': 30.0, 'brightness': 136, 'color_temp': 500} with context.id='adapt_lgt_2f7e_adapt_lights_8'
2020-10-18 20:30:26 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Living Room Spots: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.living_room_spot3', 'transition': 30.0, 'brightness': 136, 'color_temp': 500} with context.id='adapt_lgt_2f7e_adapt_lights_9'
2020-10-18 20:30:26 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Living Room Spots: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.living_room_spot1', 'transition': 30.0, 'brightness': 136, 'color_temp': 500} with context.id='adapt_lgt_2f7e_adapt_lights_10'
2020-10-18 20:30:26 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Living Room Spots: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.living_room_spot4', 'transition': 30.0, 'brightness': 136, 'color_temp': 500} with context.id='adapt_lgt_2f7e_adapt_lights_11'
2020-10-18 20:30:26 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.living_room_spot2']')' event with context.id='adapt_lgt_2f7e_adapt_lights_8'
2020-10-18 20:30:26 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.living_room_spot3']')' event with context.id='adapt_lgt_2f7e_adapt_lights_9'
2020-10-18 20:30:26 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.living_room_spot1']')' event with context.id='adapt_lgt_2f7e_adapt_lights_10'
2020-10-18 20:30:26 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.living_room_spot4']')' event with context.id='adapt_lgt_2f7e_adapt_lights_11'
2020-10-18 20:30:26 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.living_room_spot2' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 1, 'color_temp': 500, 'hs_color': (0, 0), 'rgb_color': (255, 255, 255), 'xy_color': (0.323, 0.329), 'off_brightness': None, 'friendly_name': 'Spot 2', 'supported_features': 63}' with context.id='adapt_lgt_2f7e_adapt_lights_8'
2020-10-18 20:30:26 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Living Room Spots: Detected an 'off' → 'on' event for 'light.living_room_spots' with context.id='adapt_lgt_2f7e_adapt_lights_8'
2020-10-18 20:30:26 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Living Room Spots: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt_2f7e_light_event_12'
2020-10-18 20:30:26 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting: Living Room Spots: '_adapt_lights(['light.living_room_spots'], 1.0, force=True, context.id=adapt_lgt_2f7e_light_event_12)' called
2020-10-18 20:30:26 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Living Room Spots: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.living_room_spots', 'transition': 1.0, 'brightness': 136, 'color_temp': 500} with context.id='adapt_lgt_2f7e_light_event_12'
2020-10-18 20:30:26 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.living_room_spot1', 'light.living_room_spot2', 'light.living_room_spot3', 'light.living_room_spot4']')' event with context.id='adapt_lgt_2f7e_light_event_12'
2020-10-18 20:30:26 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.living_room_spot3' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 136, 'color_temp': 500, 'hs_color': (0, 0), 'rgb_color': (255, 255, 255), 'xy_color': (0.323, 0.329), 'off_brightness': None, 'friendly_name': 'Spot 3', 'supported_features': 63}' with context.id='adapt_lgt_2f7e_light_event_12'
2020-10-18 20:30:26 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.living_room_spot4' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 136, 'color_temp': 500, 'hs_color': (0, 0), 'rgb_color': (255, 255, 255), 'xy_color': (0.323, 0.329), 'off_brightness': None, 'friendly_name': 'Spot 4', 'supported_features': 63}' with context.id='adapt_lgt_2f7e_light_event_12'
2020-10-18 20:30:27 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.living_room_spot2' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 120, 'color_temp': 500, 'hs_color': (0, 0), 'rgb_color': (255, 255, 255), 'xy_color': (0.323, 0.329), 'off_brightness': None, 'friendly_name': 'Spot 2', 'supported_features': 63}' with context.id='adapt_lgt_2f7e_light_event_12'
2020-10-18 20:30:27 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.living_room_spot3' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 120, 'color_temp': 500, 'hs_color': (0, 0), 'rgb_color': (255, 255, 255), 'xy_color': (0.323, 0.329), 'off_brightness': None, 'friendly_name': 'Spot 3', 'supported_features': 63}' with context.id='adapt_lgt_2f7e_light_event_12'
2020-10-18 20:30:27 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State change event of 'light.living_room_spot3' is already in 'self.last_state_change' (adapt_lgt_2f7e_light_event_12) adding this state also
2020-10-18 20:30:27 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.living_room_spot1' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 118, 'color_temp': 500, 'hs_color': (0, 0), 'rgb_color': (255, 255, 255), 'xy_color': (0.323, 0.329), 'off_brightness': None, 'friendly_name': 'Spot 1', 'supported_features': 63}' with context.id='adapt_lgt_2f7e_light_event_12'
2020-10-18 20:30:27 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.living_room_spot4' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 120, 'color_temp': 500, 'hs_color': (0, 0), 'rgb_color': (255, 255, 255), 'xy_color': (0.323, 0.329), 'off_brightness': None, 'friendly_name': 'Spot 4', 'supported_features': 63}' with context.id='adapt_lgt_2f7e_light_event_12'
2020-10-18 20:30:27 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State change event of 'light.living_room_spot4' is already in 'self.last_state_change' (adapt_lgt_2f7e_light_event_12) adding this state also
2020-10-18 20:30:28 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.living_room_spot2' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 136, 'color_temp': 500, 'hs_color': (0, 0), 'rgb_color': (255, 255, 255), 'xy_color': (0.323, 0.329), 'off_brightness': None, 'friendly_name': 'Spot 2', 'supported_features': 63}' with context.id='adapt_lgt_2f7e_light_event_12'
2020-10-18 20:30:28 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State change event of 'light.living_room_spot2' is already in 'self.last_state_change' (adapt_lgt_2f7e_light_event_12) adding this state also
2020-10-18 20:30:28 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.living_room_spot3' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 136, 'color_temp': 500, 'hs_color': (0, 0), 'rgb_color': (255, 255, 255), 'xy_color': (0.323, 0.329), 'off_brightness': None, 'friendly_name': 'Spot 3', 'supported_features': 63}' with context.id='adapt_lgt_2f7e_light_event_12'
2020-10-18 20:30:28 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State change event of 'light.living_room_spot3' is already in 'self.last_state_change' (adapt_lgt_2f7e_light_event_12) adding this state also
2020-10-18 20:30:28 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.living_room_spot1' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 136, 'color_temp': 500, 'hs_color': (0, 0), 'rgb_color': (255, 255, 255), 'xy_color': (0.323, 0.329), 'off_brightness': None, 'friendly_name': 'Spot 1', 'supported_features': 63}' with context.id='adapt_lgt_2f7e_light_event_12'
2020-10-18 20:30:28 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State change event of 'light.living_room_spot1' is already in 'self.last_state_change' (adapt_lgt_2f7e_light_event_12) adding this state also
2020-10-18 20:30:28 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.living_room_spot4' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 136, 'color_temp': 500, 'hs_color': (0, 0), 'rgb_color': (255, 255, 255), 'xy_color': (0.323, 0.329), 'off_brightness': None, 'friendly_name': 'Spot 4', 'supported_features': 63}' with context.id='adapt_lgt_2f7e_light_event_12'
2020-10-18 20:30:28 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State change event of 'light.living_room_spot4' is already in 'self.last_state_change' (adapt_lgt_2f7e_light_event_12) adding this state also
2020-10-18 20:31:21 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Living Room Spots: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt_2f7e_interval_13'
2020-10-18 20:31:21 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting: Living Room Spots: '_adapt_lights(['light.living_room_spots'], None, force=False, context.id=adapt_lgt_2f7e_interval_13)' called
2020-10-18 20:31:21 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Living Room Spots: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.living_room_spots', 'transition': 45.0, 'brightness': 135, 'color_temp': 500} with context.id='adapt_lgt_2f7e_interval_13'

Yeelight Xiaomi desk lamp potential incompatibility

I'm getting this error when adaptive_lighting is attempting to set the color temp

Error when calling <function YeelightGenericLight.set_colortemp at 0x8dfe8858>: {'code': -5001, 'message': 'invalid params'}

If I manually set the color temp, I'm able that the transitions work over time.

N.B. This is also an issue with Circadian Lighting (#44).

[bug] Light brightness being set in HA, but light itself does not change

Hi,

I am a Circadian Lighting user and decided to give this component a go. I installed it via HACS, commented the CL config for one light out and put this in my config.yaml:

adaptive_lighting:
  name: Office
  detect_non_ha_changes: true
  transition: 1
  initial_transition: 1
  lights:
    - light.office_lights    

#  - platform: circadian_lighting
#    name: Office
#    lights_ct:
#      - light.office_lights
#    initial_transition: 0
#    sleep_entity: input_boolean.sleepmode_office
#    sleep_state: 'on'
#    sleep_brightness: 1
#    sleep_colortemp: 1000

After restarting HA, the light turned on as expected, brightness/ct were set as I expected. Then I changed the brightness in HA to 1 and turned the light off (in HA) and back on. What happened was rather unexpected: the brightness for this light in HA showed the expected value (max.), but the light itself stayed on brightness 1.

The light is an IKEA Floalt 60x60.

My system:
Raspberry Pi4 4GB
Raspbian
Conbee II
DeCONZ

As I was writing this, I was playing around with the settings a bit. When using following parameters, everything works fine:

  transition: 1
  initial_transition: 1

Log:

2020-11-20 06:36:26 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for badnest which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-11-20 06:36:26 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for circadian_lighting which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-11-20 06:36:26 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for garbage_collection which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-11-20 06:36:26 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-11-20 06:36:26 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for adaptive_lighting which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-11-20 06:36:31 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: Setting up with '['light.office_lights']', config_entry.data: '{'name': 'Office', 'detect_non_ha_changes': True, 'transition': 1.0, 'initial_transition': 1.0, 'lights': ['light.office_lights'], 'max_color_temp': 5500, 'sunrise_offset': 0.0, 'min_brightness': 1, 'min_color_temp': 2000, 'sleep_brightness': 1, 'only_once': False, 'sleep_color_temp': 1000, 'max_brightness': 100, 'separate_turn_on_commands': False, 'sunset_offset': 0.0, 'take_over_control': True, 'prefer_rgb_color': False, 'interval': 90.0}', config_entry.options: '{}', converted to '{'lights': ['light.office_lights'], 'prefer_rgb_color': False, 'initial_transition': 1.0, 'transition': 1.0, 'interval': datetime.timedelta(seconds=90), 'min_brightness': 1, 'max_brightness': 100, 'min_color_temp': 2000, 'max_color_temp': 5500, 'sleep_brightness': 1, 'sleep_color_temp': 1000, 'sunrise_time': None, 'sunrise_offset': datetime.timedelta(0), 'sunset_time': None, 'sunset_offset': datetime.timedelta(0), 'only_once': False, 'take_over_control': True, 'detect_non_ha_changes': True, 'separate_turn_on_commands': False, 'name': 'Office'}'.
2020-11-20 06:36:32 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for attributes which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-11-20 06:36:32 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for wundergroundpws which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-11-20 06:36:33 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: Called 'async_turn_on', current state is 'None'
2020-11-20 06:36:33 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: Called '_setup_listeners'
2020-11-20 06:36:33 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: Cancelled '_setup_listeners'
2020-11-20 06:36:33 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt_6c3a_turn_on_0'
2020-11-20 06:36:33 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting: Office: '_adapt_lights(['light.office_lights'], 1.0, force=True, context.id=adapt_lgt_6c3a_turn_on_0)' called
2020-11-20 06:36:33 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting Sleep Mode: Office: last state is <state switch.adaptive_lighting_sleep_mode_office=off; friendly_name=Adaptive Lighting Sleep Mode: Office, icon=mdi:theme-light-dark @ 2020-11-20T07:26:09.684371+01:00>
2020-11-20 06:36:33 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting Adapt Color: Office: last state is <state switch.adaptive_lighting_adapt_color_office=on; friendly_name=Adaptive Lighting Adapt Color: Office, icon=mdi:theme-light-dark @ 2020-11-20T07:26:09.685082+01:00>
2020-11-20 06:36:33 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting Adapt Brightness: Office: last state is <state switch.adaptive_lighting_adapt_brightness_office=on; friendly_name=Adaptive Lighting Adapt Brightness: Office, icon=mdi:theme-light-dark @ 2020-11-20T07:26:09.685499+01:00>
2020-11-20 06:36:34 ERROR (SyncWorker_6) [homeassistant.components.qnap.sensor] Failed to fetch QNAP stats from the NAS
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 169, in _new_conn
conn = connection.create_connection(
File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 96, in create_connection
raise err
File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 86, in create_connection
sock.connect(sa)
OSError: [Errno 113] Host is unreachable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 394, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 234, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "/usr/local/lib/python3.8/http/client.py", line 1255, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/local/lib/python3.8/http/client.py", line 1301, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.8/http/client.py", line 1250, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.8/http/client.py", line 1010, in _send_output
self.send(msg)
File "/usr/local/lib/python3.8/http/client.py", line 950, in send
self.connect()
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 200, in connect
conn = self._new_conn()
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 181, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0xad354160>: Failed to establish a new connection: [Errno 113] Host is unreachable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 573, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='192.168.68.110', port=8080): Max retries exceeded with url: /cgi-bin/authLogin.cgi (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0xad354160>: Failed to establish a new connection: [Errno 113] Host is unreachable'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/qnap/sensor.py", line 194, in update
self.data["system_stats"] = self._api.get_system_stats()
File "/usr/local/lib/python3.8/site-packages/qnapstats/qnap_stats.py", line 205, in get_system_stats
resp = self._get_url(
File "/usr/local/lib/python3.8/site-packages/qnapstats/qnap_stats.py", line 67, in _get_url
self._init_session()
File "/usr/local/lib/python3.8/site-packages/qnapstats/qnap_stats.py", line 49, in _init_session
if self._login() is False:
File "/usr/local/lib/python3.8/site-packages/qnapstats/qnap_stats.py", line 57, in _login
result = self._execute_post_url("authLogin.cgi", data, False)
File "/usr/local/lib/python3.8/site-packages/qnapstats/qnap_stats.py", line 97, in _execute_post_url
resp = self._session.post(url, data, timeout=self._timeout, verify=self._verify_ssl)
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 590, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='192.168.68.110', port=8080): Max retries exceeded with url: /cgi-bin/authLogin.cgi (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0xad354160>: Failed to establish a new connection: [Errno 113] Host is unreachable'))
2020-11-20 06:36:34 WARNING (MainThread) [homeassistant.components.sensor] Platform qnap not ready yet. Retrying in 30 seconds.
2020-11-20 06:36:45 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: Called '_setup_listeners'
2020-11-20 06:37:07 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.office_lights']')' event with context.id='dd89d995cf818bfbf4d527cb0386f24f'
2020-11-20 06:37:07 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.office_lights' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 255, 'color_temp': 359, 'is_deconz_group': True, 'all_on': True, 'friendly_name': 'Office Lights', 'supported_features': 47, 'icon': 'mdi:desktop-tower-monitor'}' with context.id='dd89d995cf818bfbf4d527cb0386f24f'
2020-11-20 06:37:07 ERROR (SyncWorker_31) [homeassistant.components.qnap.sensor] Failed to fetch QNAP stats from the NAS
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 169, in _new_conn
conn = connection.create_connection(
File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 96, in create_connection
raise err
File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 86, in create_connection
sock.connect(sa)
OSError: [Errno 113] Host is unreachable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 394, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 234, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "/usr/local/lib/python3.8/http/client.py", line 1255, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/local/lib/python3.8/http/client.py", line 1301, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.8/http/client.py", line 1250, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.8/http/client.py", line 1010, in _send_output
self.send(msg)
File "/usr/local/lib/python3.8/http/client.py", line 950, in send
self.connect()
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 200, in connect
conn = self._new_conn()
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 181, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0xaf6f5610>: Failed to establish a new connection: [Errno 113] Host is unreachable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 573, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='192.168.68.110', port=8080): Max retries exceeded with url: /cgi-bin/authLogin.cgi (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0xaf6f5610>: Failed to establish a new connection: [Errno 113] Host is unreachable'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/qnap/sensor.py", line 194, in update
self.data["system_stats"] = self._api.get_system_stats()
File "/usr/local/lib/python3.8/site-packages/qnapstats/qnap_stats.py", line 205, in get_system_stats
resp = self._get_url(
File "/usr/local/lib/python3.8/site-packages/qnapstats/qnap_stats.py", line 67, in _get_url
self._init_session()
File "/usr/local/lib/python3.8/site-packages/qnapstats/qnap_stats.py", line 49, in _init_session
if self._login() is False:
File "/usr/local/lib/python3.8/site-packages/qnapstats/qnap_stats.py", line 57, in _login
result = self._execute_post_url("authLogin.cgi", data, False)
File "/usr/local/lib/python3.8/site-packages/qnapstats/qnap_stats.py", line 97, in _execute_post_url
resp = self._session.post(url, data, timeout=self._timeout, verify=self._verify_ssl)
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 590, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='192.168.68.110', port=8080): Max retries exceeded with url: /cgi-bin/authLogin.cgi (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0xaf6f5610>: Failed to establish a new connection: [Errno 113] Host is unreachable'))
2020-11-20 06:37:07 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: Detected an 'off' → 'on' event for 'light.office_lights' with context.id='dd89d995cf818bfbf4d527cb0386f24f'
2020-11-20 06:37:07 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt_6c3a_light_event_1'
2020-11-20 06:37:07 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting: Office: '_adapt_lights(['light.office_lights'], 1.0, force=True, context.id=adapt_lgt_6c3a_light_event_1)' called
2020-11-20 06:37:07 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.office_lights', 'transition': 1.0, 'brightness': 255, 'color_temp': 354} with context.id='adapt_lgt_6c3a_light_event_1'
2020-11-20 06:37:07 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.office_lights']')' event with context.id='adapt_lgt_6c3a_light_event_1'
2020-11-20 06:37:07 WARNING (MainThread) [homeassistant.components.sensor] Platform qnap not ready yet. Retrying in 60 seconds.
2020-11-20 06:37:07 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.office_lights' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 255, 'color_temp': 354, 'is_deconz_group': True, 'all_on': True, 'friendly_name': 'Office Lights', 'supported_features': 47, 'icon': 'mdi:desktop-tower-monitor'}' with context.id='adapt_lgt_6c3a_light_event_1'
2020-11-20 06:37:53 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.office_lights']')' event with context.id='6502470f9454a323d39f00d09922bd29'
2020-11-20 06:37:53 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.office_lights' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 181, 'color_temp': 354, 'is_deconz_group': True, 'all_on': True, 'friendly_name': 'Office Lights', 'supported_features': 47, 'icon': 'mdi:desktop-tower-monitor'}' with context.id='6502470f9454a323d39f00d09922bd29'
2020-11-20 06:37:55 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.office_lights']')' event with context.id='6a16a419e861f4e833d2a159b9fb2a93'
2020-11-20 06:37:55 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.office_lights' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 255, 'color_temp': 354, 'is_deconz_group': True, 'all_on': True, 'friendly_name': 'Office Lights', 'supported_features': 47, 'icon': 'mdi:desktop-tower-monitor'}' with context.id='6a16a419e861f4e833d2a159b9fb2a93'
2020-11-20 06:37:57 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_off('['light.office_lights']', transition=None)' event with context.id='b6ce6eabe45d7ad13b507ade638463a2'
2020-11-20 06:38:00 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.office_lights']')' event with context.id='a3175f209e2cd3e4194047b211937cad'
2020-11-20 06:38:00 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.office_lights' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 254, 'color_temp': 354, 'is_deconz_group': True, 'all_on': True, 'friendly_name': 'Office Lights', 'supported_features': 47, 'icon': 'mdi:desktop-tower-monitor'}' with context.id='a3175f209e2cd3e4194047b211937cad'
2020-11-20 06:38:00 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: Detected an 'off' → 'on' event for 'light.office_lights' with context.id='a3175f209e2cd3e4194047b211937cad'
2020-11-20 06:38:00 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt_6c3a_light_event_2'
2020-11-20 06:38:00 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting: Office: '_adapt_lights(['light.office_lights'], 1.0, force=True, context.id=adapt_lgt_6c3a_light_event_2)' called
2020-11-20 06:38:00 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.office_lights', 'transition': 1.0, 'brightness': 255, 'color_temp': 352} with context.id='adapt_lgt_6c3a_light_event_2'
2020-11-20 06:38:00 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.office_lights']')' event with context.id='adapt_lgt_6c3a_light_event_2'
2020-11-20 06:38:00 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.office_lights' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 255, 'color_temp': 352, 'is_deconz_group': True, 'all_on': True, 'friendly_name': 'Office Lights', 'supported_features': 47, 'icon': 'mdi:desktop-tower-monitor'}' with context.id='adapt_lgt_6c3a_light_event_2'
2020-11-20 06:38:02 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.office_lights']')' event with context.id='c2528586131b0c2bfd36b7ddd9bb5c0b'
2020-11-20 06:38:02 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.office_lights' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 3, 'color_temp': 352, 'is_deconz_group': True, 'all_on': True, 'friendly_name': 'Office Lights', 'supported_features': 47, 'icon': 'mdi:desktop-tower-monitor'}' with context.id='c2528586131b0c2bfd36b7ddd9bb5c0b'
2020-11-20 06:38:05 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_off('['light.office_lights']', transition=None)' event with context.id='43e2bd31c7193e3948b4cbc18f4aed77'
2020-11-20 06:38:10 ERROR (SyncWorker_17) [homeassistant.components.qnap.sensor] Failed to fetch QNAP stats from the NAS
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 169, in _new_conn
conn = connection.create_connection(
File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 96, in create_connection
raise err
File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 86, in create_connection
sock.connect(sa)
OSError: [Errno 113] Host is unreachable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 394, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 234, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "/usr/local/lib/python3.8/http/client.py", line 1255, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/local/lib/python3.8/http/client.py", line 1301, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.8/http/client.py", line 1250, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.8/http/client.py", line 1010, in _send_output
self.send(msg)
File "/usr/local/lib/python3.8/http/client.py", line 950, in send
self.connect()
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 200, in connect
conn = self._new_conn()
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 181, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0xa782bee0>: Failed to establish a new connection: [Errno 113] Host is unreachable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 573, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='192.168.68.110', port=8080): Max retries exceeded with url: /cgi-bin/authLogin.cgi (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0xa782bee0>: Failed to establish a new connection: [Errno 113] Host is unreachable'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/qnap/sensor.py", line 194, in update
self.data["system_stats"] = self._api.get_system_stats()
File "/usr/local/lib/python3.8/site-packages/qnapstats/qnap_stats.py", line 205, in get_system_stats
resp = self._get_url(
File "/usr/local/lib/python3.8/site-packages/qnapstats/qnap_stats.py", line 67, in _get_url
self._init_session()
File "/usr/local/lib/python3.8/site-packages/qnapstats/qnap_stats.py", line 49, in _init_session
if self._login() is False:
File "/usr/local/lib/python3.8/site-packages/qnapstats/qnap_stats.py", line 57, in _login
result = self._execute_post_url("authLogin.cgi", data, False)
File "/usr/local/lib/python3.8/site-packages/qnapstats/qnap_stats.py", line 97, in _execute_post_url
resp = self._session.post(url, data, timeout=self._timeout, verify=self._verify_ssl)
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 590, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='192.168.68.110', port=8080): Max retries exceeded with url: /cgi-bin/authLogin.cgi (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0xa782bee0>: Failed to establish a new connection: [Errno 113] Host is unreachable'))
2020-11-20 06:38:10 WARNING (MainThread) [homeassistant.components.sensor] Platform qnap not ready yet. Retrying in 90 seconds.
2020-11-20 06:38:15 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt_6c3a_interval_3'
2020-11-20 06:38:15 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting: Office: '_adapt_lights(['light.office_lights'], None, force=False, context.id=adapt_lgt_6c3a_interval_3)' called
2020-11-20 06:38:55 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.office_lights']')' event with context.id='d17f860d987a24bc40a29c6ab06917c2'
2020-11-20 06:38:55 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.office_lights' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 3, 'color_temp': 352, 'is_deconz_group': True, 'all_on': True, 'friendly_name': 'Office Lights', 'supported_features': 47, 'icon': 'mdi:desktop-tower-monitor'}' with context.id='d17f860d987a24bc40a29c6ab06917c2'
2020-11-20 06:38:55 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: Detected an 'off' → 'on' event for 'light.office_lights' with context.id='d17f860d987a24bc40a29c6ab06917c2'
2020-11-20 06:38:55 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt_6c3a_light_event_4'
2020-11-20 06:38:55 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting: Office: '_adapt_lights(['light.office_lights'], 1.0, force=True, context.id=adapt_lgt_6c3a_light_event_4)' called
2020-11-20 06:38:55 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.office_lights', 'transition': 1.0, 'brightness': 255, 'color_temp': 349} with context.id='adapt_lgt_6c3a_light_event_4'
2020-11-20 06:38:55 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.office_lights']')' event with context.id='adapt_lgt_6c3a_light_event_4'
2020-11-20 06:38:55 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.office_lights' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 255, 'color_temp': 349, 'is_deconz_group': True, 'all_on': True, 'friendly_name': 'Office Lights', 'supported_features': 47, 'icon': 'mdi:desktop-tower-monitor'}' with context.id='adapt_lgt_6c3a_light_event_4'
2020-11-20 06:38:56 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.office_lights' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 1, 'color_temp': 349, 'is_deconz_group': True, 'all_on': True, 'friendly_name': 'Office Lights', 'supported_features': 47, 'icon': 'mdi:desktop-tower-monitor'}' with context.id='adapt_lgt_6c3a_light_event_4'
2020-11-20 06:38:56 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State change event of 'light.office_lights' is already in 'self.last_state_change' (adapt_lgt_6c3a_light_event_4) adding this state also
2020-11-20 06:38:59 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_off('['light.office_lights']', transition=None)' event with context.id='5ce8e4102172356411bfd80d8149830c'
2020-11-20 06:39:01 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.office_lights']')' event with context.id='11c78607f9b7fad2a31c34ef14beb632'
2020-11-20 06:39:01 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.office_lights' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 1, 'color_temp': 349, 'is_deconz_group': True, 'all_on': True, 'friendly_name': 'Office Lights', 'supported_features': 47, 'icon': 'mdi:desktop-tower-monitor'}' with context.id='11c78607f9b7fad2a31c34ef14beb632'
2020-11-20 06:39:01 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: Detected an 'off' → 'on' event for 'light.office_lights' with context.id='11c78607f9b7fad2a31c34ef14beb632'
2020-11-20 06:39:01 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt_6c3a_light_event_5'
2020-11-20 06:39:01 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting: Office: '_adapt_lights(['light.office_lights'], 1.0, force=True, context.id=adapt_lgt_6c3a_light_event_5)' called
2020-11-20 06:39:01 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.office_lights', 'transition': 1.0, 'brightness': 255, 'color_temp': 349} with context.id='adapt_lgt_6c3a_light_event_5'
2020-11-20 06:39:01 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.office_lights']')' event with context.id='adapt_lgt_6c3a_light_event_5'
2020-11-20 06:39:01 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.office_lights' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 255, 'color_temp': 349, 'is_deconz_group': True, 'all_on': True, 'friendly_name': 'Office Lights', 'supported_features': 47, 'icon': 'mdi:desktop-tower-monitor'}' with context.id='adapt_lgt_6c3a_light_event_5'
2020-11-20 06:39:02 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_off('['light.office_lights']', transition=None)' event with context.id='c66e0e9e120ef413cf1a7edc53da6d0a'
2020-11-20 06:39:04 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.office_lights']')' event with context.id='1d5961c1fc04893950cd7e511a328c43'
2020-11-20 06:39:04 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.office_lights' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 255, 'color_temp': 349, 'is_deconz_group': True, 'all_on': True, 'friendly_name': 'Office Lights', 'supported_features': 47, 'icon': 'mdi:desktop-tower-monitor'}' with context.id='1d5961c1fc04893950cd7e511a328c43'
2020-11-20 06:39:04 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: Detected an 'off' → 'on' event for 'light.office_lights' with context.id='1d5961c1fc04893950cd7e511a328c43'
2020-11-20 06:39:04 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt_6c3a_light_event_6'
2020-11-20 06:39:04 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting: Office: '_adapt_lights(['light.office_lights'], 1.0, force=True, context.id=adapt_lgt_6c3a_light_event_6)' called
2020-11-20 06:39:04 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.office_lights', 'transition': 1.0, 'brightness': 255, 'color_temp': 349} with context.id='adapt_lgt_6c3a_light_event_6'
2020-11-20 06:39:04 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.office_lights']')' event with context.id='adapt_lgt_6c3a_light_event_6'
2020-11-20 06:39:11 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_off('['light.office_lights']', transition=None)' event with context.id='4dbf3344546785c02b61d9e248681550'
2020-11-20 06:39:14 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.office_lights']')' event with context.id='7ed9ac208fd7cdc4d7ee78a117b6ec09'
2020-11-20 06:39:14 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.office_lights' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 255, 'color_temp': 349, 'is_deconz_group': True, 'all_on': True, 'friendly_name': 'Office Lights', 'supported_features': 47, 'icon': 'mdi:desktop-tower-monitor'}' with context.id='7ed9ac208fd7cdc4d7ee78a117b6ec09'
2020-11-20 06:39:14 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: Detected an 'off' → 'on' event for 'light.office_lights' with context.id='7ed9ac208fd7cdc4d7ee78a117b6ec09'
2020-11-20 06:39:14 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt_6c3a_light_event_7'
2020-11-20 06:39:14 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting: Office: '_adapt_lights(['light.office_lights'], 1.0, force=True, context.id=adapt_lgt_6c3a_light_event_7)' called
2020-11-20 06:39:14 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.office_lights', 'transition': 1.0, 'brightness': 255, 'color_temp': 348} with context.id='adapt_lgt_6c3a_light_event_7'
2020-11-20 06:39:14 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.office_lights']')' event with context.id='adapt_lgt_6c3a_light_event_7'
2020-11-20 06:39:14 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.office_lights' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 255, 'color_temp': 348, 'is_deconz_group': True, 'all_on': True, 'friendly_name': 'Office Lights', 'supported_features': 47, 'icon': 'mdi:desktop-tower-monitor'}' with context.id='adapt_lgt_6c3a_light_event_7'
2020-11-20 06:39:43 ERROR (SyncWorker_14) [homeassistant.components.qnap.sensor] Failed to fetch QNAP stats from the NAS
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 169, in _new_conn
conn = connection.create_connection(
File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 96, in create_connection
raise err
File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 86, in create_connection
sock.connect(sa)
OSError: [Errno 113] Host is unreachable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 394, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 234, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "/usr/local/lib/python3.8/http/client.py", line 1255, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/local/lib/python3.8/http/client.py", line 1301, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.8/http/client.py", line 1250, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.8/http/client.py", line 1010, in _send_output
self.send(msg)
File "/usr/local/lib/python3.8/http/client.py", line 950, in send
self.connect()
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 200, in connect
conn = self._new_conn()
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 181, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0xa7811580>: Failed to establish a new connection: [Errno 113] Host is unreachable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 573, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='192.168.68.110', port=8080): Max retries exceeded with url: /cgi-bin/authLogin.cgi (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0xa7811580>: Failed to establish a new connection: [Errno 113] Host is unreachable'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/qnap/sensor.py", line 194, in update
self.data["system_stats"] = self._api.get_system_stats()
File "/usr/local/lib/python3.8/site-packages/qnapstats/qnap_stats.py", line 205, in get_system_stats
resp = self._get_url(
File "/usr/local/lib/python3.8/site-packages/qnapstats/qnap_stats.py", line 67, in _get_url
self._init_session()
File "/usr/local/lib/python3.8/site-packages/qnapstats/qnap_stats.py", line 49, in _init_session
if self._login() is False:
File "/usr/local/lib/python3.8/site-packages/qnapstats/qnap_stats.py", line 57, in _login
result = self._execute_post_url("authLogin.cgi", data, False)
File "/usr/local/lib/python3.8/site-packages/qnapstats/qnap_stats.py", line 97, in _execute_post_url
resp = self._session.post(url, data, timeout=self._timeout, verify=self._verify_ssl)
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 590, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='192.168.68.110', port=8080): Max retries exceeded with url: /cgi-bin/authLogin.cgi (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0xa7811580>: Failed to establish a new connection: [Errno 113] Host is unreachable'))
2020-11-20 06:39:43 WARNING (MainThread) [homeassistant.components.sensor] Platform qnap not ready yet. Retrying in 120 seconds.
2020-11-20 06:39:45 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: '_update_attrs_and_maybe_adapt_lights' called with context.id='adapt_lgt_6c3a_interval_8'
2020-11-20 06:39:45 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Adaptive Lighting: Office: '_adapt_lights(['light.office_lights'], None, force=False, context.id=adapt_lgt_6c3a_interval_8)' called
2020-11-20 06:39:45 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] State of 'light.office_lights' didn't change wrt change event nr. 0 (context.id=adapt_lgt_6c3a_interval_8)
2020-11-20 06:39:45 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Office: Scheduling 'light.turn_on' with the following 'service_data': {'entity_id': 'light.office_lights', 'transition': 1.0, 'brightness': 255, 'color_temp': 347} with context.id='adapt_lgt_6c3a_interval_8'
2020-11-20 06:39:45 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_on('['light.office_lights']')' event with context.id='adapt_lgt_6c3a_interval_8'
2020-11-20 06:39:45 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.office_lights' 'state_changed' event: '{'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['colorloop'], 'brightness': 255, 'color_temp': 347, 'is_deconz_group': True, 'all_on': True, 'friendly_name': 'Office Lights', 'supported_features': 47, 'icon': 'mdi:desktop-tower-monitor'}' with context.id='adapt_lgt_6c3a_interval_8'

Feature request: Set working hours

First of all, thanks for this great addition. Second, I'd like to make a feature request: setting working hours in which the color temperature can not fall below a threshold.

My situation:
As the sun in the Netherlands sets quite early already, I'm still working at that time. As I associate colder light with working, I'd like the lights to be colder during working hours (but still varying). After working hours - let's say at 18:00 - I would like the same lights to turn warmer than during the day, but still be adaptive.

Solution:

  1. The first solution I thought of was to have an option within the integration to define a "working hour" time range in which the brightness/temperature can not exceed a certain value. However, this has a limited scope to other problems, and would not work directly when having a second range of working hours later in the evening for example.

  2. The solution I think is better: Being able to define the time range during which an adaptive lighting integration should be enabled. In this way, you define separate integrations for separate periods with different temperature/brightness values. These integrations then work on the same set of lights anyway.

Let me know what you think, and keep up the great work!

[Feature Request] Operate color temp and brightness separately

AFAIK, right now, the changes in brightness and color temp take place at the same time. But the problem is that with MQTT lights, both the attributes are set to change at the same time. Some MQTT smart bulbs can take only one attribute change at a time. So, for me only the color temp changes or the brightness. Both attributes never change. If you could add an option to change the attributes separately, it would be great.

Treat lights in a scene as manually controlled

Add support to treat a light as manually controlled if it comes on via a scene. Ideally, this would be configurable to trigger on any scene, or only scenes from a designated list.

You can tell if a light was activated via scene by listening for the call_service event for scene.turn_on. The context for that event will be the same as the context for any later light.turn_on calls the scene triggers.

adaptive_lighting.set_manual_control doesn't have the expected outcome

I have a series of Philips Hue 4 button switches, and have traditionally used the "dim" button to set the lights to 1% brightness, no matter their current state. (eg if they're off, they turn on with 1% brightness).

This works fine with adaptive lighting if the lights are already on, but if the lights are off, the act of turning them on triggers adaptive lighting. I've tried working around this by setting "adaptive_lighting.set_manual_control" to "true" in my automation before calling the "dim" scene but it doesn't seem to work - the lights still come on at "full" brightness.

Example automation below.

- id: '1604357677300'
  alias: Kids Room Switch - Button 2 Hold
  description: ''
  trigger:
  - platform: event
    event_type: deconz_event
    event_data:
      id: kids_room_switch
      event: 2003
  condition: []
  action:
  - service: adaptive_lighting.set_manual_control
    data:
      manual_control: true
      lights: light.kids_room
    entity_id: switch.adaptive_lighting_home
  - scene: scene.kids_room_dim
  mode: single

Error in log after HA reboot

I see the following error after a HA reboot:

2020-10-22 21:23:49 ERROR (MainThread) [homeassistant.components.switch] Error while setting up adaptive_lighting platform for switch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 201, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 310, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 481, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 521, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/adaptive_lighting/switch.py", line 890, in async_added_to_hass
    if (last_state is None and self._initial_state) or last_state.state == STATE_ON:
AttributeError: 'NoneType' object has no attribute 'state'

i configured 2 light entities:

  • light.kitchen_ceiling_group
  • light.dining_area_ceiling_group

These are both ZHA zigbee groups. Could it be that they are not yet available during boot?

flash on update

Ive noticed that when adaptive lighting changes my lights settings, there is a fraction of a second where it flashes with a cold white before changing to the set white level. it is as the brightness update command is sent first which resets the color temp and then in the next instant the color is updated. This is particularly visible when the lights are updating to a dim warm colour.

I only have the 'take over control' checkbox ticked in the config settings

White Value (White Light Brightness) not being set

This is the last thing blocking me from fully migrating from CL. This was also a rubber duck exercise, but I figured I would post the issue anyways.

I have some ESPHome flashed Tuya bulbs, which have four channels; (RBG, Brightness) and (Color Temp, White Value). Brightness affects the brightness of the RBG diode, and White Value controls the brightness of the White diode. Each pair can be set individually and does not affect the other.

I'm looking through the switch, and I see you have White Value in the enums, but it's not being used. I've tested the bulbs with AL and it sets the colour correctly, but the brightness of the white diode never changes.

Here is the state for the bulbs in question;

min_mireds: 200
max_mireds: 500
brightness: 254
color_temp: 400
hs_color:
  - 28
  - 17.647
rgb_color:
  - 255
  - 231
  - 210
xy_color:
  - 0.367
  - 0.349
white_value: 254
friendly_name: Bulb - Living Room
icon: 'mdi:lamp'
supported_features: 187

I will be looking at adding this and testing with my own bulbs locally, but I just wanted to confirm that I was looking at this in the right way;

  1. Adding White Value to the imports from HA Core; https://github.com/basnijholt/adaptive-lighting/blob/master/custom_components/adaptive_lighting/switch.py#L34-L37
  2. Adding White Value to the Supported options; https://github.com/basnijholt/adaptive-lighting/blob/master/custom_components/adaptive_lighting/switch.py#L123-L128
  3. Add a White Value to the service_data being set, using the same brightness value; https://github.com/basnijholt/adaptive-lighting/blob/master/custom_components/adaptive_lighting/switch.py#L683-L685

For reference, here are the declared bitmap values for the light entity; https://github.com/home-assistant/core/blob/master/homeassistant/components/light/__init__.py#L35-L41

Lights still change by A.L.

Hi Bas,

I read all the info and maybe I don't it understand what you mean. Here full example how I config 1 light for testings:

adaptive lighting config:

- name: "Diningroom"
  lights:
    - light.dressoir_all
    - light.dressoir_1
    - light.dressoir_2
    - light.dressoir_3
  sleep_brightness: 20
  min_brightness: 70
  only_once: true
  max_color_temp: 3800
  min_color_temp: 2000
  interval: 30
  prefer_rgb_color: false
  take_over_control: true
  detect_non_ha_changes: true

automation to turn on 1 bulb with color red:

- alias: "TEST - Adaptive LIght"
  trigger:

    - platform: state
      entity_id: switch.newkaku_014e5906_a
      to: "on"

  action:
    - service: light.turn_on
      data:
        entity_id: light.dressoir_1
        color_name: "red"
        brightness_pct: 100

When the switch is on, light.dressoir_1 goes on into red. directly after it light.dressoir_1 turn into kelvin color by A.L.

Maybe I truly don't understand the way how it work?

Tradfri Lights still adapted after a second light.turn_on

  • When turning on the lights for the first time with a script, the lights go to the set scene. And then after a short while AL will change the lights. This is logical.
  • Then a second activation of the scripts, activates the lights and undoes what AL did.
  • Then after a short while again, the Tradfri lights are updated by AL, while the Hue lights stay at the scene.

So AL recognizes that a scene has been set for the Hue lights, but not for the Tradfri lights.

This is what the script does:

woonkamer_energie:
  sequence:
  - data:
      entity_id: light.eettafel
      color_temp: 152
    service: light.turn_on
  - data:
      entity_id: light.koplamp
      color_temp: 152
    service: light.turn_on
  - data:
      brightness: 255
      entity_id: light.lamp_boven_zithoek
      color_temp: 152
    service: light.turn_on
  - data:
      brightness: 255
      entity_id: light.leeslamp_bank
      color_temp: 152
    service: light.turn_on
  - data:
      entity_id: light.lampjes_langs_het_plafond
    service: light.turn_on
  - delay:
      milliseconds: 1
  - data:
      brightness: 255
      entity_id: light.eettafel
    service: light.turn_on
  - data:
      brightness: 255
      entity_id: light.koplamp
    service: light.turn_on
  alias: Woonkamer Energie

Where light.eettafel and light.koplamp are Tradfri lights (bundles of 4 and 2 lights to be exact) and light.lamp_boven_zithoek and light.leeslamp_bank are HUE lights.
Thing with the Tradfri lights is that they cannot process two settings at the same time. So brightness and colour need to be set shortly after each other. So are actually already are two light.turn_on actions in this script.

Slow Down Sparky

Why are we getting multiple updates per day for this addon, that require a restart. I appreciate the attention the author puts into the project, but maybe only 1-2 updates per week???

Select Lights by Name rather than Entity ID

For those of us with a lot of zigbee lights (I think I'm in the 20's now), would it be possible to list all lights by their name including the entity ID?

I think that would be somewhere around line 96 in config-flow.py.

That way it wouldn't be this endless back and forth referencing names to long hex strings while setting it up/modifying it.

EDIT: This might only apply to zigbee2mqtt users.

Improve manual control

Is there a way we could change AL so that when a light is turned on and the state is updated in HA it checks to see if it has been manually controlled? For example my wife will turn on a light and instantly set it to a brightness she wants. The next time AL checks it will auto adjust that light because it’s not at a level it thinks it should be at. Then if she adjusts it again it finally turns on manual control. This really hurts the WAF (wife acceptance factor). I tried setting the update interval to 1 second but that didn’t help either. Right now it is the default which I believe is 45 seconds?

Initial transition only when turning off sleepmode

Most of the lights in my house are controlled by motion sensors. In the mornings we find the lights get too bright too early so we leave on night mode longer. To get a smooth transition when night mode turns off (in my case 20% -> 100% most of the time) we set an hight initial transition.

The problem with motion sensor control is that my lights ar regularly turned of and on. And every time it turns on it gets the initial transition which takes to long to change the lights when you want them to change quickly during day time.

I could make more switches and set the according switches based on daytime to overcome this, but it would be nice to have an transition time only for switching night mode off.

Set Night Mode RGB value

Currently upgrading from the circadian_lighting setup. With that one, I have a automation scene external to the integration at sun-down that sets all color lights to red and then hands off brightness control only to the circadian service.

Would love for something like that to be integrated here, seems that the base is already there to support it. I think these items would greatly extend use cases:

  • Sleep mode scheduling / sun event offset
  • Allow RGB pinning to a single color or an RGB target to transition to during the time period covered by the above

[Feature Request] Output Manual Control Mode as Boolean

First of all, thank you very much for your great work. Adaptive Lighting is really great and has already completely replaced Circadian Lighting

Now to my problem. I have some automations that I would like to set up on the manual control state of my Adaptive Lighting. Unfortunately I don't get state not extrahier. I tried it with this Binary Sensor for example:

  - platform: template
    sensors:
      adaptive_lighting_buro_deckenlampe_manual_control:
        friendly_name: "Adaptive Lighting Büro Deckenlampe im manuellen Modus"
        value_template: >-
          {{ is_state_attr('switch.adaptive_lighting_buro_deckenlampe', 'manual_control', 'light.buro_deckenlampe') }}

Unfortunately it always shows off. No matter what the manual_control value of the switch is.
So I would like to ask if it would be possible to output the manual control state as boolean on/off or as a separate sensor?

No matter what the answer is, thanks again for the great work and stay healthy ;-)

Accent colors at daytime

I'd like to have an accent color on my lights, so you basically choose the color when the switch would generate a white light.

I'm already working on this and I'd like to know the other's opinion on this feature (Basically whether I should PR the changes).

If you're interested, my usability concept is like this:

  • add another switch to enable / disable this
  • color can be given via yaml or service call (new service: set_accent_color), yaml overrides last_state on startup
  • yaml also configs the interpolation endpoints (based on the internal percentage)

Functionality:

  • below the lower threshold the functionality isn't affected (nighttime color temperatures)
  • above said threshold, the rgb values are interpolated between the "default" rgb and the given accent color

Opinions?

Adapting lights when they turn on after being unavailable

Hi,

I have a smart bulb I have to physically plug into and out of an outlet at the beginning of the day and at the end of the day.
The way adaptive lighting works rn is that if a lamp gets turned on (off -> on) it gets automatically adapted.
What I'm looking for is lamps also getting adapted if they get physically turned on (the state going unavailable -> on).

It's awesome if that would be possible!
Many thanks for the awesome work you and the other contributers put into adaptive lighting already, I really enjoy using it!

[Bug] Manually controlled not set when issuing multiple entity id's in same light.turn_on

I'm using Node-RED for most of my automation, and when issuing multiple entity ID's in the same service call the lights changes, but they are overridden by AL on the next interval.

Separating them into different service calls for each light makes AL pick up that they have been manually controlled.

This might be related to #10 if they are also issuing multiple entity id's in the same call?

Single service call
Single service call, manual control not triggered.txt

Multiple service call, manual control triggered.txt

[Feature Request] A way to "separate" color from brightness in offsets

I'm not entirely sure the title is the best way to put it, but here's my use case:

In the mornings prior to sunrise I prefer to have lighting that is a cooler temperature to simulate daylight. This means that I use a sunrise_offset of -03:00:00 or so to ensure that I have the correct color temperature at around 5am.

However, a casualty of this is brightness. Ideally I'd like to have brightness tracking to the sun position without offset.

I'm not entirely sure of the best way to recommend how to go about this—but want to share my use case that I'm sure I'm not alone on!

Issue with Minimum Kelvin setting (HA mireds versus Kelvin in SmartTuya/Tuya Integration)

I just picked up some Globe Tunable White WiFi A19's. They are rated 2000K to 5000K. (2000K is f'ugly!) I paired them via the SmartTuya App and have integrated them into HA via the Tuya Integration. They show up in HA with a CT range of 153 to 370 which does not convert to the correct K value (Kelvin * mireds = 1,000,000). It would appear that HA is converting the kelvin range 5000-2000 (which should be 200 to 500 mired) to 153 to 370 (6536 to 2700) which when multiplied by the actual kelvin results in a number between 740,000 to 765,000.
The issue I am seeing in AL is that while I have specified a minimum Kelvin of 3200K, currently the bulbs in HA are at 214 mireds and the Tuya App shows a CT of 2396K. Are you converting the Kelvin value from AL to mireds for HA or just handing the kelvin value to HA? I suspect the latter in which case HA in converting the real kelvin to their translated mired scale of 153-370 (2700-6535) which results in the wrong kelvin at the bulb based on a scale of 200-500... Ahgh!! I've opened an incident with HA core.

[Feature Request] Update lights when they become available again

Hi, thanks for the awesome component!
I noticed that when my lights become unavailable and available again after I manually updated the status, it doesn't get updated.
I would like it to act like when it's turned off and on again, so the previous status is discarded and they return to be managed by Adaptive Lightning.
What do you think?
Thanks

light.turn_on errors in 1.0.0b0 with tasmota

I am getting theses errors pretty consistently

Logger: homeassistant.core
Source: components/tasmota/light.py:229
First occurred: 9:32:56 PM (53 occurrences)
Last logged: 10:02:15 PM

Error executing service: <ServiceCall light.turn_on (c:adapt_lgt_b7ef_interval_18): entity_id=['light.back_porch'], params=transition=45.0, brightness=196, white_value=196, color_temp=500>

Error executing service: <ServiceCall light.turn_on (c:adapt_lgt_b7ef_interval_19): entity_id=['light.porch'], params=transition=45.0, brightness=196, white_value=196, color_temp=500>

Error executing service: <ServiceCall light.turn_on (c:adapt_lgt_b7ef_interval_19): entity_id=['light.back_porch'], params=transition=45.0, brightness=196, white_value=196, color_temp=500>

Error executing service: <ServiceCall light.turn_on (c:adapt_lgt_18fd_interval_20): entity_id=['light.downstairs_bath'], params=transition=45.0, brightness=74, white_value=74, color_temp=500>

Error executing service: <ServiceCall light.turn_on (c:adapt_lgt_18fd_interval_21): entity_id=['light.downstairs_bath'], params=transition=45.0, brightness=73, white_value=73, color_temp=500>

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/core.py", line 1461, in catch_exceptions await coro_or_task File "/usr/src/homeassistant/homeassistant/core.py", line 1480, in _execute_service await handler.job.target(service_call) File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service await self.hass.helpers.service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 593, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 664, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 630, in _handle_entity_call await result File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 230, in async_handle_light_on_service await light.async_turn_on(**params) File "/usr/src/homeassistant/homeassistant/components/tasmota/light.py", line 229, in async_turn_on self._tasmota_entity.set_state(True, attributes) File "/usr/local/lib/python3.8/site-packages/hatasmota/light.py", line 274, in set_state self._set_state_light(state, attributes) File "/usr/local/lib/python3.8/site-packages/hatasmota/light.py", line 343, in _set_state_light speed = round(transition * 2 / delta_ratio) ZeroDivisionError: float division by zero

I was not getting these before the upgrade to the new beta.

Disable entity & state

Hi,
In the video from reddit there are field in order to have a disable_entity & disable_state but after installation & configuration I don't have these options in the UI

Color adapt without brightness adjust

This is an awesome update coming from circadian. However, I can't figure out how to only adjust color, not brightness? Is this possible? If not, please consider this a feature request :)

What is the recommended approach for using prefer_rgb_color during sleep mode only?

Maybe this should be a feature request instead, I am not sure.

I have an automation that activates sleep mode in a manner similar to the one shown in the documentation. If I extend this automation to also toggle prefer_rgb_color via adaptive_lighting.apply, my lights are adapted accordingly, but then they are adapted back to the original setting a moment later.

Is it possible to keep adaptive lighting on, but modify this setting until I turn sleep mode off?

some errors on a new install of this component

Just installed it as shown in your reddit video. Set the sunrise and sunset times, and added a couple lights.

Lights arent changing at all. and giving these erorrs. not really sure how to proceed since the times I set are correct.

edit: Also switch.adaptive_lighting_testing is Unavailable

Oct 13 15:44:50 server hass[5180]: 2020-10-13 15:44:50 ERROR (MainThread) [custom_components.adaptive_lighting.switch] testing: The sun events ('sunset', 'solar_noon', 'sunrise', 'solar_midnight') are not in the expected order. The Adaptive Lighting integration will not work! This might happen if your sunrise/sunset offset is too large or your manually set sunrise/sunset time is past/before noon/midnight.
Oct 13 15:44:50 server hass[5180]: 2020-10-13 15:44:50 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Oct 13 15:44:50 server hass[5180]: Traceback (most recent call last):
Oct 13 15:44:50 server hass[5180]:   File "/home/ctrl/.homeassistant/custom_components/adaptive_lighting/switch.py", line 739, in _light_event
Oct 13 15:44:50 server hass[5180]:     await self._update_attrs_and_maybe_adapt_lights(
Oct 13 15:44:50 server hass[5180]:   File "/home/ctrl/.homeassistant/custom_components/adaptive_lighting/switch.py", line 650, in _update_attrs_and_maybe_adapt_lights
Oct 13 15:44:50 server hass[5180]:     self._settings = self._sun_light_settings.get_settings(
Oct 13 15:44:50 server hass[5180]:   File "/home/ctrl/.homeassistant/custom_components/adaptive_lighting/switch.py", line 927, in get_settings
Oct 13 15:44:50 server hass[5180]:     percent = self.calc_percent()
Oct 13 15:44:50 server hass[5180]:   File "/home/ctrl/.homeassistant/custom_components/adaptive_lighting/switch.py", line 890, in calc_percent
Oct 13 15:44:50 server hass[5180]:     today = self.relevant_events(now)
Oct 13 15:44:50 server hass[5180]:   File "/home/ctrl/.homeassistant/custom_components/adaptive_lighting/switch.py", line 878, in relevant_events
Oct 13 15:44:50 server hass[5180]:     events = [
Oct 13 15:44:50 server hass[5180]:   File "/home/ctrl/.homeassistant/custom_components/adaptive_lighting/switch.py", line 879, in <listcomp>
Oct 13 15:44:50 server hass[5180]:     self.get_sun_events(now + timedelta(days=days)) for days in [-1, 0, 1]
Oct 13 15:44:50 server hass[5180]:   File "/home/ctrl/.homeassistant/custom_components/adaptive_lighting/switch.py", line 872, in get_sun_events
Oct 13 15:44:50 server hass[5180]:     raise ValueError(msg)
Oct 13 15:44:50 server hass[5180]: ValueError: testing: The sun events ('sunset', 'solar_noon', 'sunrise', 'solar_midnight') are not in the expected order. The Adaptive Lighting integration will not work! This might happen if your sunrise/sunset offset is too large or your manually set sunrise/sunset time is past/before noon/midnight.


Separate turn on commands can be improved

I'm trying to apply the (great) AL to my IKEA color bulb, without much success.
I had problems already with that in the past, since it can't make a transition with just on service call when it contains both brightness and color transitions.

I can imagine that the option 'separate_turn_on_commands' are made for such occasions, but it fails to do its job in this case. I think the problem is that the two service calls are made too close to each other. Probably they need to wait at least the 'transition' time.

I can provide more details if needed.

IKEA Tradfri CCT bulbs issues

Apparently the IKEA Tradfri implementation does not allow for simultaneous receipt of brightness AND color temp adjustments. As a result it's a random affair - either bri or color temp will be randomly adjusted, never both on a turn_on event 👍

I wonder if there's anything that you can do on your end to break up the call and delay on of these?

Unable to set custom sunset_time

Hi there -- thank you so much for your amazing work on this!

I've been slowly transitioning from CL to your component, but am having tremendous difficulty in setting a custom sunset time (working from home these days, and want to have my lights follow work schedule rather than sun's schedule). As context, I have established two switches (one with a custom sunrise_time and one with a custom sunset_time). I am having no issues with the switch with custom sunrise_time, but anytime I set a sunset time (e.g., 18:00:00 as my custom sunset_time, where my astronomical sunset today is 18:35:00), I get an error and my switch entity becomes disabled.

"The sun events ('sunset', 'solar_noon', 'sunrise', 'solar_midnight') are not in the expected order. The Adaptive Lighting integration will not work! This might happen if your sunrise/sunset offset is too large or your manually set sunrise/sunset time is past/before noon/midnight."

I noticed this behavior in the latest builds, but did not have this behavior in your the first few builds you released.

Logs here:

Error while setting up adaptive_lighting platform for switch Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 201, in _async_setup_platform await asyncio.gather(*pending) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 310, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 481, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 521, in add_to_platform_finish await self.async_added_to_hass() File "/config/custom_components/adaptive_lighting/switch.py", line 457, in async_added_to_hass await self.async_turn_on(adapt_lights=not self._only_once) File "/config/custom_components/adaptive_lighting/switch.py", line 544, in async_turn_on await self._update_attrs_and_maybe_adapt_lights( File "/config/custom_components/adaptive_lighting/switch.py", line 650, in _update_attrs_and_maybe_adapt_lights self._settings = self._sun_light_settings.get_settings( File "/config/custom_components/adaptive_lighting/switch.py", line 927, in get_settings percent = self.calc_percent() File "/config/custom_components/adaptive_lighting/switch.py", line 890, in calc_percent today = self.relevant_events(now) File "/config/custom_components/adaptive_lighting/switch.py", line 878, in relevant_events events = [ File "/config/custom_components/adaptive_lighting/switch.py", line 879, in <listcomp> self.get_sun_events(now + timedelta(days=days)) for days in [-1, 0, 1] File "/config/custom_components/adaptive_lighting/switch.py", line 872, in get_sun_events raise ValueError(msg) ValueError: Loft: The sun events ('sunset', 'solar_noon', 'sunrise', 'solar_midnight') are not in the expected order. The Adaptive Lighting integration will not work! This might happen if your sunrise/sunset offset is too large or your manually set sunrise/sunset time is past/before noon/midnight.

Can no longer use 2 switches for 1 set of lights

Hi Bas, great work on taking the Circadian component to a next level!

Now that I've switched to your component I've noticed that one of my "constructions" doesn't work anymore.
For my kitchen lights I had defined 2 sets of switches: one set for when someone is present in the kitchen, one set with lower brightness for when the kitchen is empty. With the Circadian component I could switch between these 2 sets instantly, most noticeable when entering the kitchen: the brightness-level of the lights would immediately increase.

Now that I use your component the script shown below no longer works.

turn_up_k_lights:
  sequence:
    - service: switch.turn_off
      entity_id:
        - switch.adaptive_lighting_adapt_color_keuken_dimmed
        - switch.adaptive_lighting_adapt_brightness_keuken_dimmed
    - service: switch.turn_on
      entity_id:
        - switch.adaptive_lighting_adapt_color_keuken
        - switch.adaptive_lighting_adapt_brightness_keuken
    - delay:
        milliseconds: 300
    - service: light.turn_on
      entity_id:
        - light.keuken_1
        - light.keuken_2
        - light.keuken_3

Lights randomly come back on after shut off

This has only happened to me twice, and I don't have a way to replicate it, but I will turn off a light using lovelace and after 10-15 seconds or so it turns itself back on. If I find a way to replicate it I can turn on debugging but I have no way to track it down so it wouldn't do much good right now. I am running d67479d now, and if I see it happen with this version I will let you know but like I said this has only happened twice over the week or so I've been running AL.

Is everything in const.py valid for config?

When I was making the docs, I only used configuration variables in your "full configuration example". I was looking at the source, and there's a couple variables in there not in the example in the PR. Are all of them valid?

Feature Request: combined RBG + colour temp

i may be wrong but current options allow you to either use the main light with kelvin adjustment OR the RGB light with colour changes.

I would love to be able to have an additional option to use full brightness (and truer daylight colours) of the main white light but the full dim coloured glow of the RGB lights during the night. perhaps a set time to swithc with 60+ second transition as it is difficult to match between the two. I feel like the options already are supposed to support this but I seem to only be able to select RBG or colour temp at the moment?

It would also be nice to be able to select a nighttime colour. In the past I had an automation to turn the bathroom lights to 3% brightness dark purple which ment you dont need to turn the light on to see and minimise impact on sleep. Guess I could easily keep this running but would be nice to have it integrated.

Also, love the graphs in documentation showing how lights change through the day. could these graphs be drawn at the bottom of the options to show you what you have configured?

Im looking forward to seeing this as a native integration in Hassio 0.117!

Lights still get brighter

I was in my living room this morning with my lights in night mode (1% brightness). The house went into day mode which turns off AL night mode so the lights got brighter which is fine, that’s what’s it’s supposed to do. However I then went to the wall and turned them back down to 1%, but a few seconds later they were taken back over by AL and made bright again.

I had to turn the brightness up and then down again within HA to get them to stop. Note, I have both take over control and the manual changes enabled for these lights.

It seems like light.turn_off service calls may not make AL understand the light has been manually controlled, only light.turn on?

adaptive_lighting.manual_control event not fired when making changes outside of Home Assistant

Hi,

Not sure if this is a bug or a feature, but it seems that the adaptive_lighting.manual_control event is not fired whenever I make changes to my lights using my IKEA TRADFRI remote. I do expect this to happen, so I can turn off adaptive lights whenever I manually adjust my lights using a remote control.

I am using the following configuration:

name: bedroom
lights:
  - light.bedside_left
  - light.bedside_right
detect_non_ha_changes: true
interval: 5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.