Hi,
I want to use an input_number / input_datetime, to edit the offset time of the sunset trigger in an automation. Like in my example:
alias: turn_on_light
description: ""
trigger:
- platform: sun
event: sunset
offset: "00:{{ states('input_number.min') | int }}:{{ states('input_number.sec') | int }}
condition: []
action:
.......
But I get this error:
Message malformed: offset 00:{{ states(‘input_number.min’) | int }}:{{ states(‘input_number.sec’) | int }} should be format ‘HH:MM’, ‘HH:MM:SS’ or ‘HH:MM:SS.F’ for dictionary value @ data[‘offset’]
I found this code example in the docs:
automation:
- alias: "turn something off after x time after turning it on"
trigger:
platform: state
entity_id: switch.something
to: "on"
action:
- delay: "00:{{ states('input_number.minutes') | int }}:{{ states('input_number.seconds') | int }}"
- service: switch.turn_off
target:
entity_id: switch.something
Does anybody know a solution?
Thanks