{% for light in lights %} # {{ light.name }} - id: sleep_on_{{ light.entityId }} alias: '[Sleep-On] {{ light.name }}' trigger: - platform: time at: input_datetime.sleep_mode - platform: state entity_id: - group.guests to: not_home condition: - condition: state entity_id: {{ light.entityId }} state: 'on' - condition: state entity_id: group.guests state: not_home - condition: time before: input_datetime.day_mode after: input_datetime.sleep_mode action: - service: light.turn_on data: kelvin: 2000 entity_id: {{ light.entityId }} mode: single {% endfor %}