claytonjn / hass-circadian_lighting

Circadian Lighting custom component for Home Assistant
Apache License 2.0
756 stars 89 forks source link

[Feature request] support for multiple switches #222

Closed acidkill closed 1 year ago

acidkill commented 1 year ago

Be able to create multiple switches for lights in different rooms.

F.ex. Daughter sleeps with pink lights so I want to be able to control circadian lightning for her room independently of other rooms. Adding her room as the second switch disables main group.

Sonic77 commented 1 year ago

+1 for this request. I have 2 rooms with different light bulbs and different lighting conditions and requirements.

When i do this only the first light bulb is working:

switch:
  - platform: circadian_lighting
    lights_ct: light.hallway_light
    min_brightness: 15
    max_brightness: 40
  - platform: circadian_lighting
    lights_ct: 
      - light.entrance_spotlight_inside_light
      - light.entrance_spotlight_center_light
      - light.entrance_spotlight_outside_light
    min_brightness: 75
    max_brightness: 100
claytonjn commented 1 year ago

This has always been supported. @Sonic77 when you say only the first light bulb is working, do you mean light.hallway_light, light.hallway_light and light.entrance_spotlight_inside_light, or something else? Have you already enabled and looked into debug logs?

Sonic77 commented 1 year ago

Only lights_ct: light.hallway_light is working. When i swap both platform sections the other lights_ct still only the first platform section is working. There was no information in the HAS System Logs. I have just now enabled debug log.

Sonic77 commented 1 year ago

@claytonjn i found this error in the log after restart with debug logging enbaled:

2023-06-22 09:13:07.502 ERROR (MainThread) [homeassistant.components.switch] Entity id already exists - ignoring: switch.circadian_lighting_circadian_lighting
Sonic77 commented 1 year ago

I got this working by adding a name: in each section. After adding name: each switch needed to be turned on.

switch:
  - platform: circadian_lighting
    name: Entrance Circadian Lighting
    lights_ct: 
      - light.entrance_spotlight_inside_light
      - light.entrance_spotlight_center_light
      - light.entrance_spotlight_outside_light
    min_brightness: 75
    max_brightness: 100
  - platform: circadian_lighting
    name: Hallway Circadian Lighting
    lights_ct: light.hallway_light
    min_brightness: 15
    max_brightness: 40
claytonjn commented 1 year ago

Ahh, sorry, I should have caught that! Glad you got it working :)