--- - alias: "[Scene] Backyard Scene Rotation" initial_state: 'true' trigger: platform: state entity_id: input_select.backyard_scenes action: - service: scene.turn_on data_template: entity_id: scene.backyard_{{ states.input_select.backyard_scenes.state | replace(' ', '_') | lower | string }} transition: 2.5 - service: input_text.set_value target: entity_id: input_text.backyard_last_scene data: value: "{{ states.input_select.backyard_scenes.state | replace(' ', '_') | lower | string }}" - service_template: > {% if states.input_select.backyard_scenes.state | lower | string == 'off' -%} input_boolean.turn_off {%- else -%} input_boolean.turn_on {%- endif %} entity_id: - input_boolean.backyard_light_state