[solved] Impossible to affect an entity to a room

hello, i have created light in lights.yaml

# lampe virtuelle
  - platform: template
    lights:
      salon_virtual_light:
        friendly_name: "lampe salon"
        turn_on:
          service: script.turn_on
          entity_id: script.turn_on_salon_virtual_light
        turn_off:
          service: script.turn_off
          entity_id: script.turn_off_salon_virtual_light
        set_level:
          service: script.set_level_salon_virtual_light
          data_template:
            level: "{{ brightness | float / 255 * 100 }}"

now within paramter/entities
i could see the entity named “lampe salon”
but when i want to affect this entity to a room i get a message
“This entity (“light.sejour_virtual_light”) does not have a unique identifier, therefore its settings cannot be managed from the user interface.”

how could i solve this ?

You need to add the unique_id to the template light.
Just add

unique_id: lampe_salon_template_light

Then you can edit it in the ui and add it to a room.
Here are the docs where it is described

1 Like

ok thanks that will do the job