Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 103369

State trigger. Device on for user defined time

$
0
0

I have this basic automation. See line that starts with for:
How do I add user input value from helper “input_datetime.timeout” in this “for:” field?

alias: 'Alarm: Valve timeout '
description: 'Close valve after x hours x=input_datetime.timeout'
trigger:
  - platform: state
    entity_id: switch.main
    to: 'on'
--> for: {{states('input_datetime.timeout')}} <----- Can I do this?
condition: []
action:
  - service: notify.emailer
    ...

After saving it shows as this:

alias: 'Alarm: Valve timeout '
description: 'Close valve after x hours x=input_datetime'
trigger:
  - platform: state
    entity_id: switch.main
    to: 'on'
    for: '[object Object]'
condition: []
action:
  - service: notify.emailer

Developer tab confirms input field {{states(‘input_datetime.timeout’)}} is 03:00:00

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 103369

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>