Group Helper with attributes of entities, instead entities

Hi!

A small question: there is any way to create a helper group of attributes instead entities?

Thanks!

A group, by definition, is a collection of entities.

Is it possible to make a school bus out of paper and have it look like a paper airplane? No, but I can tell you how to make a paper airplane if that’s what you want.

Likewise, if you can describe what your end goal is, it’s likely we can help you get there.

Do you want an entity that has a state which is some value based on a specific attribute from a bunch of other sensors?

Do you want an entity that has its own attributes that are a list of attribute values from other sensors?

…

1 Like

Well… I done it by creating a template sensor with a state list of all the needed attributes.
I wanted to make this from the GUI, with the helper feature, I thought that this can be done from the HA by default, and maybe I don’t know how, this why I created the post.

Thanks

Yep there’s no way to do what you’ve done from the UI.

Hi everyone,
I have the same use case. I have combined A) Zigbee LED strip regulators/dimmers/color temperature and B) zigbee switches. I want to group both, so I can have a single card to switch lights on and regulate color temp. However, since sometimes the zigbee connection is a bit unstable, I would like the on/off command to be sent only to the switch (B), but not to the regulator (A). When creating a group, card looks fine, and it works, but command is sent to both.
If for whatever the reason the regulator loses connection, or takes a while to receive the command, the lights will not turn on.
Is it possible to create a group where the on/off command is only changed with B), but left unchanged in A)?

Thanks!

Hi all,

I am still trying to get my head around this, and tried many solutions that did not work at all. Is it possible to make a group, maybe not through the GUI, but what about YAML?

I am pretty sure I may not be the only one with this issue. Thanks for the help in advance!

Cheers

I think what you want is a template light, which must be created in YAML.

1 Like

Hi all,

After some months where I was busy with other things, I made things work, with a bit of patience and carefully reading the documentation (which I wish would have some more examples and detailed explanations for stupid people like me).
I made it work with the following code:
Kindly note that I have a light (the zigbee colour temp and intensity regulator) and a switch (an ordinary zigbee switch) entity

light:
   - platform: template
     lights:
       combined_bathroom_light:
         unique_id: combined_bathroom_light
         friendly_name: "Combined Bathroom Light"
         value_template: "{{ is_state('switch.interruptores_bano_atico_l1', 'on') }}"
         level_template: "{{ state_attr('light.regulador_bano_atico', 'brightness') }}" 
         temperature_template: "{{ state_attr('light.regulador_bano_atico', 'color_temp') }}" # Corrected
         turn_on:
           - service: switch.turn_on
             entity_id: switch.interruptores_bano_atico_l1
         turn_off:
           - service: switch.turn_off
             entity_id: switch.interruptores_bano_atico_l1
         set_level:
           action: light.turn_on
           target:
             entity_id: light.regulador_bano_atico
           data_template:
             brightness: "{{ brightness }}"
         set_temperature:
           action: light.turn_on
           target:
             entity_id: light.regulador_bano_atico
           data_template:
             color_temp: "{{ color_temp }}"

The way it works, as per my humble understanding:

  • value_template: Controls the on/off state of the template light based on the switch’s state.
  • level_template: This template dynamically sets the brightness of the template light based on the brightness attribute of the real light. This is what enables the two-way synchronization for brightness.
  • temperature_template: This template dynamically sets the color temperature of the template light based on the color_temp attribute of the real light, enabling two-way synchronization for color temperature.
  • turn_on and turn_off: These actions control the physical switch.
  • set_level and set_temperature: These actions are triggered when you change the brightness or color temperature from the template light. They then update the real light’s attributes.

This combination of level_template/temperature_template and set_level/set_temperature is the correct and most efficient way to achieve two-way synchronization in a template light.