I am automating the switching on of lights in an area:
id: '1677319029194'
alias: michael ⬤ entrée ⬤ lights on
description: ''
trigger:
- platform: device
type: turned_on
device_id: d4ae80995d09de415c0ab69a04a0a936
entity_id: switch.michael_michael_main
domain: switch
condition: []
action:
- service: script.lights_on_in_area
data:
area: michael
mode: single
The service which is called:
lights_on_in_area:
alias: lights on in area
sequence:
- alias: get all lights
variables:
area: '{{ area }}'
lights: '{{ expand(area_entities(area)) | selectattr(''domain'', ''eq'', ''light'')
| rejectattr(''entity_id'', ''search'', ''restart | disturb | repeat | shuffle'')
| map(attribute = ''entity_id'') | list }}'
- alias: turn lights on
service: light.turn_on
target:
entity_id:
- '{{ lights }}'
mode: single
icon: mdi:lightbulb-group
Running the automation ends up with
Template rendered invalid entity IDs: [['light.michael_bureau_droit', 'light.michael_bureau_gauche']]
The devices do exist:
What does this error mean, exactly? The documentation states that entity_id
can be a list of entities:
String or list of strings that point at
entity_id
s of lights.