I have this automation with different delays and brightness for switching a light on or off.
The transition for switching the light on is disregarded, though it works for switching off.
I changed the values, recreated the automation, restarted HA but it to no avail.
The light does support this feature and using this template in a script does work fine.
What am I missing?
alias: "Toilet: Motion"
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.toilet_motion_occupancy
from: "on"
to: "off"
for:
hours: 0
minutes: 2
seconds: 0
- platform: state
entity_id:
- binary_sensor.toilet_motion_occupancy
from: "off"
to: "on"
condition: []
action:
- service: light.turn_on
metadata: {}
data:
transition: "{{ 12 if trigger.to_state.state == 'off' else 9 }}"
kelvin: >-
{{ 2200 if is_state('input_boolean.bedtime', 'on') or
is_state('input_boolean.sleeping', 'on') else 4000 }}
brightness_pct: >-
{{ 0 if trigger.to_state.state == 'off' else 1 if
is_state('input_boolean.bedtime', 'on') or
is_state('input_boolean.sleeping', 'on') else 100 }}
target:
entity_id: light.toilet
mode: single