when i check the “template”, it works fine, and spot just the bulbs that are on with no prob.
what would be the best implantation of this with a button in the dashboard?
can i use a mushrooms light card with a slider to just control the “on state” lights?
maybe a “costume button card” would be better (as i can tell it to repeat an action like “light.turn_on” at 5%" while being held)?
managed to figure it out, i’ll leave the code i am using if anyone will try to do the same:
Start with creating a group in “helpers” with the lights you want in the group. call it what you want. something like: “light.backlights_wleds_hyperion”
creat a script with this script config (to allow control of the lights that are already on, and just them):
hey man
the part i mentioned is just the “action/sequence” part of the script.
if you want to start with an empty one, and go directly to YAML mode, you will need some more lines.
this example should work fine for pasting into a blank script page.
change the “alias” to what you want, and the make sure the group name is consistent with whatever you called yours.
after saving, you can go back to UI mode, and see how things are laid out, change icons etc.
let me know how you do.
cheers
alias: backlights wleds hyperion dim up
sequence:
- service: light.turn_on
data:
brightness_step_pct: 5
target:
entity_id: >-
{{ expand('light.backlights_wleds_hyperion') | selectattr('state', 'eq',
'on') | map(attribute='entity_id') | list }}
mode: single
icon: mdi:chevron-triple-up
However, there is a slight difference as you seem not to have a group domain, but a light domain instead - but the actual template works when I try it in developer tool
i think you will have to use the “light” domain, otherwise you will not be able to use the “light.turn_on” function, and without that (as far as i know), there is no dimming.
the “turn on/off” will work, and the template will still be able to know what is on, and what’s off - as they work on switches too, and a “group” domain can be lights & switches.
but since we want “dimming” - as i mentioned, i think you will have to use as a light domain.