Hello there.
I have a blueprint which worked fine on my old version of HA. Today I upgraded to a new version and now the blueprint does not work as expected any longer. I am not sure about what to do…
The log says the following so my best guess is that it has something to do with the Blueprint and maybe the timestamp conditions…
Below is the blueprint shown. I hope someone can solve this issue.
blueprint:
name: Auto Control Light
description: Turn light on and off automatically
domain: automation
input:
sensor:
name: Sensor
description: The sensor which shall trigger the automation
selector:
entity:
domain: binary_sensor
light:
name: Light(s)
description: Light(s) to operate
selector:
target:
time_duration:
name: Duration of sensor
description: How long time should pass before trigger
default: "00:03:00"
selector:
time:
time_on:
name: Time to turn ON
default: "07:00:00"
selector:
time:
time_off:
name: Time to turn OFF
default: "23:30:00"
selector:
time:
delay_min:
name: Delay minimum
description: How short delay
default: 60
selector:
number:
min: 0
max: 300
mode: slider
step: 10
unit_of_measurement: "seconds"
delay_max:
name: Delay maximum
description: How long delay
default: 300
selector:
number:
min: 10
max: 600
mode: slider
step: 10
unit_of_measurement: "seconds"
trigger:
- platform: time
at:
- !input time_on
- !input time_off
- platform: state
entity_id: !input sensor
for: !input time_duration
mode: single
variables:
sensor: !input sensor
time_on: !input time_on
time_off: !input time_off
delay_min: !input delay_min
delay_max: !input delay_max
action:
- delay: "{{ range(delay_min | int, delay_max | int) | random }}"
- choose:
- conditions:
- "{{ (as_timestamp(trigger.now) | timestamp_custom('%H:%M:%S')) == time_on }}"
- "{{ is_state(sensor, 'off') }}"
sequence:
- service: homeassistant.turn_on
target: !input light
- conditions: "{{ (as_timestamp(trigger.now) | timestamp_custom('%H:%M:%S')) == time_off }}"
sequence:
- service: homeassistant.turn_off
target: !input light
- conditions:
- "{{ trigger.platform == 'state' }}"
- condition: time
after: !input time_on
before: !input time_off
sequence:
- choose:
- conditions: "{{ is_state(sensor, 'off') }}"
sequence:
- service: homeassistant.turn_on
target: !input light
- conditions: "{{ is_state(sensor, 'on') }}"
sequence:
- service: homeassistant.turn_off
target: !input light