adaptive-lighting icon indicating copy to clipboard operation
adaptive-lighting copied to clipboard

List of lights under automatic control

Open hoffbaked opened this issue 2 years ago • 2 comments

There is a property for lights that are under manual control, but it would be helpful if there was a similar property for lights which are being automatically controlled. I have to hard code the names of the adaptive lighting switches into everything. If there was a list, I could search for the adaptive lighting instance based on the name of the entity being controlled and make my scripts and automations more general. Also, I have to have a ton of controllers for bulb in different rooms, and of different relative brightnesses. Sometimes it's tricky to remember which of the integration instances a given bulb is controlled by. Being able to browse the states would be very helpful.

hoffbaked avatar Oct 20 '21 19:10 hoffbaked

what is the property for getting the lights under automatic control? I don't see it documented.

Talor-A avatar Nov 21 '21 06:11 Talor-A

@hoffbaked sounds like you have a large installation.

Can you look at the roadmap for v2 and vote on the things which would improve your experience and report close this, if the issue would be solved with those goals?

Thanks!

RubenKelevra avatar Jun 14 '22 19:06 RubenKelevra

If you want to send every adaptive-lighting switch, you can use the following template in your automation/script:

  entity_id: |
    {{ entity_id|default(states.switch
       | map(attribute='entity_id')
       | select(">", "switch.adaptive_lighting_al_")
       | select("<", "switch.adaptive_lighting_al_z")
       | join(",")) }}

output: switch.adaptive_lighting_al_bedroom_ceilingfan_lights,switch.adaptive_lighting_al_den_ceilingfan_lights,switch.adaptive_lighting_al_linkind_dimmer_bulb,switch.adaptive_lighting_al_shellyrgbw2_ddcc57

th3w1zard1 avatar Mar 23 '23 17:03 th3w1zard1

This doesn’t solve the problem that for any given light, I can’t tell which adaptive light switch is controlling it. For example, I have motion sensing scripts that dim the light over time. I have to get the brightness and color temp from the adaptive lighting switch, so I have to hard code it. But I have a bunch of 13 adaptive lighting groups, so it sometimes takes quite a while to go through the setup of each instance of the adaptive lighting integration, and then look through the dropdown to find out which one is controlling it. I usually miss it the first time through, and have to go through a second time. It’s very error prone and tedious. And if I move I light to a different group, I then have to modify every script, also.On Mar 23, 2023, at 10:38 AM, Benjamin Auquite @.***> wrote: If you want to send every adaptive-lighting switch, you can use the following template in your automation/script: entity_id: | {{ entity_id|default(states.switch | map(attribute='entity_id') | select(">", "switch.adaptive_lighting_al_") | select("<", "switch.adaptive_lighting_al_z") | join(",")) }}

output: switch.adaptive_lighting_al_bedroom_ceilingfan_lights,switch.adaptive_lighting_al_den_ceilingfan_lights,switch.adaptive_lighting_al_linkind_dimmer_bulb,switch.adaptive_lighting_al_shellyrgbw2_ddcc57

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

hoffbaked avatar Mar 23 '23 17:03 hoffbaked

I'm very interested in this too. If we loop through all switches created by adaptive-lighting and find the switch entity_id based on the light entity_id, we can make the switch optional from the service call.

would that be enough for ya? I agree the naming schemes get old pretty fast especially with large configs like ours.

th3w1zard1 avatar Mar 23 '23 18:03 th3w1zard1

I’m quite possibly misunderstanding, but I’m looking for a method of, given a light entity, finding the adaptive lighting switch the controls it. And I don’t think the proposed solution would get me there.The switch has a manual_control attribute that shows all the entities that are disabled, but no attribute for the lights it’s controlling. It seems like this would be pretty simple to expose. In many scripts, I need to get the brightness_pct and color_temp_kelvin attributes from the correct switch. For example, I have a script that ramps on the lights in my bedroom at a certain time over a period of time. I set control to manual, and every step up requeries the AL switch so it tracks the color and brightness. Maybe if there was a new service call which took the light entity and returned the switch name? But an attribute that lists the controlled lights would get the job done and would have the side benefit that I could browse the developer states and see which lights belong to which switches at a glance.It would also be nice to have the switch optional for things like enabling or disabling manual control.On Mar 23, 2023, at 11:41 AM, Benjamin Auquite @.***> wrote: I'm very interested in this too. If we make loop through all switches created by adaptive-lighting and find the switch entity_id based on the light.switch entity_id, we can make the switch optional from the service call. would that be enough for ya? I agree the naming schemes get old pretty fast especially with large configs like ours.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

hoffbaked avatar Mar 23 '23 21:03 hoffbaked

I've exposed the entire config in #445 however getting the services to accept a light's entity_id instead of requiring a switch's entity_id has been challenging, but I also finished that. You'll be able to use the area/group/entity id selectors just like in all the other service calls hass has once the PR goes live.

th3w1zard1 avatar Mar 23 '23 23:03 th3w1zard1

@hoffbaked Check out #459 I believe I've implemented what you're looking for.

th3w1zard1 avatar Mar 24 '23 07:03 th3w1zard1

Nice!! I’ll check it out…

hoffbaked avatar Mar 24 '23 14:03 hoffbaked

I managed to checkout your PR branch under the home assistant terminal, renamed by old adapative_lighting in custom_components installed by HACS, and then symlinked the one from the PR. I restarted, and it seems to be working, but the labels are missing when I get into the settings of an AL instance. When I look at states under developer tools, I'm not noticing any new attributes. I'm guessing I'm doing something horribly wrong.

hoffbaked avatar Mar 24 '23 18:03 hoffbaked

I managed to checkout your PR branch under the home assistant terminal, renamed by old adapative_lighting in custom_components installed by HACS, and then symlinked the one from the PR. I restarted, and it seems to be working, but the labels are missing when I get into the settings of an AL instance. When I look at states under developer tools, I'm not noticing any new attributes. I'm guessing I'm doing something horribly wrong.

I'm so sorry I got my wires crossed. The feature you're looking for is correctly implemented in #445 . image

th3w1zard1 avatar Mar 24 '23 22:03 th3w1zard1

No problem! I'll give it a go...

hoffbaked avatar Mar 24 '23 22:03 hoffbaked

Worth noting that the lights appearing under lights are not the ones being adapted, but are a collective of all the lights in the config. You'll need to have your automation/script filter out the ones in the manual_control list yourself.

th3w1zard1 avatar Mar 24 '23 23:03 th3w1zard1