Hello, I have a problem with a blueprint for a simple automation that turns off a [IKEA Tradfri] light after some seconds. I would like to pass a value to “for” field using a helper (input_number? input_datetime?).
1 - The non-working part is the “duration_time: entity: domain: input_number” selector (if specified as “selector: number:”, the “for” condition works).
2 - I tried a whole day several variants, with templates also for “for”, but the value of the input_number seems not taken.
3 - It seems that the “input_number” is a float (example: 9.0), but the “seconds” field needs a integer, but passing something like: seconds: !input {{ states('duration_time') | int }}
does not work.
4 - I did not find detailed documentaton or examples for the syntax needed to use “!input input_number” for “for: seconds” condition, or conversion from float in blueprints.
Thanks for any help.
This is what I am trying to configure:
blueprint:
name: Light Off
description: Turns OFF a LIGHT after configured SECONDS in a time interval (FROM - TO)
domain: automation
input:
duration_time:
name: Turn off after SECONDS
selector:
entity:
domain: input_number
target_light:
name: Light
selector:
entity:
domain: light
after_time:
name: FROM time
selector:
entity:
domain: input_datetime
before_time:
name: TO time
selector:
entity:
domain: input_datetime
trigger:
- platform: state
entity_id: !input target_light
to: 'on'
for:
seconds: !input duration_time
condition:
- condition: time
after: !input after_time
before: !input before_time
action:
- service: light.turn_off
data: {}
entity_id: !input target_light