Hi guys,
I’m trying to use the input box component to have the user specify how many minutes a garage door needs to be open before they get an alert.
I can’t seem to figure out how to use that number in an automation to send a notification. I’m trying to use a template: {{ states(‘input_number.garage_alert_1’) | int }}. The config is checking correctly but when reloading hass it fails so I’m pretty sure that I can’t use this format. Here’s what I did:
input_number:
garage_alert_1:
name: Garage Alert 1 (mins)
min: 5
max: 120
step: 5
unit_of_measurement: minutes
icon: mdi:timer
mode: box
automations:
- alias: Notifications Garage Door is Open for x minutes
trigger:
- platform: state
entity_id: binary_sensor.garagedoorswitch_2_3
to: "on"
for:
minutes: {{ states('input_number.garage_alert_1') | int }}
action:
- service: notify.telegrambotgroup
data:
message: Garage has been open for {{ states('input_number.garage_alert_1') | int }} minutes
data:
keyboard:
- '/Turn_off_alerts, /Close_Garage_Door'