Using platform: group vs group gives me a warning for LIFX lights

I get the following warning while I am running a script:

2025-01-20 16:15:01.255 WARNING (MainThread) [homeassistant.helpers.service] Referenced entities light.familyroom_lights are missing or not currently available

Here is the script that produces the above warning when I configure a LIFX group as a light using the platform: group:

manually_update_lifx_lighting:
  alias: Manually Update Lifx Lighting
  description: Manually Update Lighting(Lifx) via Adaptive Lighting Sensor
  # Start a new, independent run in parallel with previous runs.
  mode: parallel
  sequence:
    - condition: template
      value_template: 
            "{{ states(entity) not in ['unavailable', 'unknown', 'none'] and  
                states('sensor.circadian_brightness_pct') != 'unknown' }}"
    # Check if the light input_boolean entity value is disabled i.e. off
    - condition: template
      value_template: "{{ is_state(entity_disable_cl, 'off') }}"
    - service: lifx.set_state
      data_template:
        entity_id: "{{ entity }}"
        brightness_pct: "{{ states('sensor.circadian_brightness_pct') }}"
        color_temp_kelvin: "{{ states('sensor.circadian_color_temp_kelvin') }}"
        transition: "{{ transition | default(45) | int(45) }}"

It fails when I set the state. I am not sure if this warning should happen or not? The same script works when I configure a group instead of the platform: group

The lifx.set_state action only works on LIFX-controlled light entities. There is no such thing as a LIFX group either, so I’m not sure what you mean by that.

It will not work with a Light group created via Home Assistant’s “Helper” tab in Devices & Entities.

@Djelibeybi Thank you for the reply, I know there is no such thing as a LIFX groups. Possibly my post lack details.

The script works when called with the following light group that contains a list of LIFX lights:

Code:

familyroom lights:
  name: Familyroom Group
  entities:
    - light.familyroom_east
    - light.familyroom_ouest

Here is the list of attributes for the group.
Current entity states:

group.familyroom_lights
Familyroom Group on	
entity_id: light.familyroom_east, light.familyroom_ouest
order: 0
friendly_name: Familyroom Group

The script does not works when called with the following platform group that contains a list of LIFX lights:

Code:

- platform: group
  name: Familyroom Lights
  entities:
    - light.familyroom_east
    - light.familyroom_ouest

Here is the list of attributes from the template that does not work, notice that the supported_features is 36. Same as my LIFX lights attributes

Current entity states:

light.familyroom_group
Familyroom Group on	

min_color_temp_kelvin: 1500
max_color_temp_kelvin: 9000
min_mireds: 111
max_mireds: 666
effect_list: effect_pulse, effect_stop
supported_color_modes: color_temp
effect: null
color_mode: color_temp
brightness: 255
color_temp_kelvin: 4600
color_temp: 217
hs_color: 26.749, 24.966
rgb_color: 255, 220, 191
xy_color: 0.388, 0.356
entity_id: light.familyroom_east, light.familyroom_ouest
icon: mdi:lightbulb-group
friendly_name: Familyroom Group
supported_features: 36

Where and how did you create light.familyroom_group? Because groups shouldn’t work as a target for the lifx.set_state action. If you’re using it with light.turn_on, it will work fine.

I have thought about creatingLIFX-specific groups for this purpose for a while now, but honestly couldn’t really justify the effort given how little benefit it would provide.

@Djelibeybi I am not sure I understand your question? Where and how did you create light.familyroom_group It is all coded manually as described above.

It works for me as a group, i.e. not a platform: group

Here is the edited automation if interested?

- alias: "Adaptive lighting: manually update"
  trigger:
    platform: time_pattern
    minutes: "/1"
  action:
    # Parameters is submitted to the called script.
    - service: script.manually_update_lifx_lighting
      data:
        entity: 'group.familyroom_lights'
        entity_disable_cl: 'input_boolean.familyroom_lights_disable_cl'
        transition: '45'
    ## This does not work
    #- service: script.manually_update_lifx_lighting
    #  data:
    #    entity: 'light.familyroom_lights'
    #    entity_disable_cl: 'input_boolean.familyroom_lights_disable_cl'
    #    transition: '45'

What I’m asking is how/where you defined group.familyroom_lights?

Never mind. I’ve reproduced the behaviour and it works with the deprecated/old style groups but not with the new style of groups. This is in fact more functionality that I expected so I would classify this as “working beyond expectations” :slight_smile:

@Djelibeybi Thanks for your dedication to this problem. So to answer my question: This is normal behavior? Since this is the intended behavior the message is little confusing:

2025-01-20 16:15:01.255 WARNING (MainThread) [homeassistant.helpers.service] Referenced entities light.familyroom_lights are missing or not currently available

It’s an interesting problem. The error only occurs because you’re building your automation and/or script by hand. If you tried to do this via the UI, it wouldn’t even show light.familyroom_lights as an target option for lifx.set_state. So I don’t know if this would be considered a bug or not, to be honest.

Chnage your template to

        entity_id: "{{ entity | expand | map(attribute='entity_id') | list }}"
1 Like

@petro Wow now that is cool. For ‘posterity’ here is the modified script:

manually_update_lifx_lighting:
  alias: Manually Update Lifx Lighting
  description: Manually Update Lighting(Lifx) via Adaptive Lighting Sensor
  # Start a new, independent run in parallel with previous runs.
  mode: parallel
  sequence:
    - condition: template
      value_template: 
            "{{ states(entity) not in ['unavailable', 'unknown', 'none'] and  
                states('sensor.circadian_brightness_pct') != 'unknown' }}"
    # Check if the light input_boolean entity value is disabled i.e. off
    - condition: template
      value_template: "{{ is_state(entity_disable_cl, 'off') }}"
    - service: lifx.set_state
      data_template:
        entity_id: "{{ entity | expand | map(attribute='entity_id') | list }}"
        brightness_pct: "{{ states('sensor.circadian_brightness_pct') }}"
        color_temp_kelvin: "{{ states('sensor.circadian_color_temp_kelvin') }}"
        transition: "{{ transition | default(45) | int(45) }}"