Files
hassio-configuration/configuration/automation/scene_rotation_porch.yaml
2025-02-07 12:46:24 -05:00

25 lines
820 B
YAML

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