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

Cannot move lights to a different switch, and deleted switch entities remain

Open richardroberts opened this issue 3 years ago • 2 comments

Hello, thanks for the great work on this integration! I created a configuration with two switches, as below:

adaptive_lighting:
  - name: "nondimming"
    lights:
      - light.bedroom_hallway
      - light.kitchen_cabinet_lights
      - light.kitchen_ceiling
      - light.living_room_window_lamp
      - light.lamp_near_tv
    min_brightness: 100
    max_brightness: 100
    min_color_temp: 2000
    max_color_temp: 4000
    transition: 45
    interval: 90
  - name: "dimming"
    lights:
       - light.bedroom_floor_lamp

Now, I move light.bedroom_floor_lamp from the "dimming" to "nondimming" switch in the config file, but this light continues to be updated as if it were in the "dimming" switch. Further, if I delete the "dimming" switch from the config file altogether, its entities remain behind, I can see them in the overview dashboard and entity list. This seems to be a bug?

richardroberts avatar Jan 16 '21 20:01 richardroberts

Updating this issue report with a bit of progress - specifying an empty array in the "dimming" switch resulted in light.bedroom_floor_lamp being correctly updated as part of the "nondimming" switch. However, I still haven't been able to remove the "dimming" entities even after removing them from the configuration file. This message appears when attempting to remove them through the dashboard (Configuration -> Entities):

You can only remove 0 of the selected 4 entities. Entities can only be removed
when the integration is no longer providing the entities. Sometimes you have to
restart Home Assistant before you can remove the entities of a removed
integration. Are you sure you want to remove the removable entities?

richardroberts avatar Jan 17 '21 18:01 richardroberts

And one more update - was able to get the entities to disappear by removing the unused integrations from the adaptive lighting "box" listed under Configuration -> Integrations. Adaptive Lighting was listing 3 - "default", "nondimming", and "dimming", while "nondimming" was the only one still present in configuration.yaml. Clicking on each one and deleting it got rid of the extra entities.

Is this intended behavior? If so, it might help to update the documentation. Sorry I do not know how to do this, or I would, but I'll write a paragraph that can be copy-pasted by someone who does know how to update the documentation:

"Removing redundant entities after removing Adaptive Lighting definitions from configuration.yaml":

" If you remove Adaptive Lighting entries from configuration.yaml, their entities and integrations will still be present in Home Assistant, despite being redundant. To remove them using the UI, go to Configuration -> Integrations, and find the Adaptive Lighting integration. Your entries, each with a name previously specified in configuration.yaml, will be listed there. If there is more than one, it will have an arrow next to it, click it to see additional information, then click the 3 dots button, and in the menu click Delete. This will remove the associated entities from Home Assistant. "

The issue is now effectively solved for me, but I do think it would be good to add the above paragraph to the documentation. Thanks again!

richardroberts avatar Jan 17 '21 18:01 richardroberts