Hi so I am using a automation to turn off a switch or light after some time but i want to be able to input said time from a numerical input this is my code
- id: '1572362955848'
alias: Test automation
description: Prueba para apagar las luces despues de x tiempo de un numeric input
trigger:
- entity_id: switch.test
from: 'off'
platform: state
to: 'on'
condition: []
action:
- wait_template: 'seconds: "{{ states(''input_number.sala_temp'') }}"'
- alias: ''
data: {}
service: switch.turn_off
It says the automation triggers but it doesnt turn off after desired time
- id: '1572362955848'
alias: Test automation
description: Prueba para apagar las luces despues de x tiempo de un numeric input
trigger:
platform: state
entity_id: switch.test
from: 'off'
to: 'on'
for:
seconds: "{{ states('input_number.sala_temp') }}"
action:
service: switch.turn_off
entity_id: switch.test
i just tried the program you used but it doesnt turn off the switch, but if i turn it off and then on it will instantly turn it off, do you think this might be a bug?
I used seconds: “{{ states(‘input_number.sala_temp’) }}”|int and it marks it as an error i removed it and now the automation doesnt trigger
i already restarted the whole thing i got this to work with node-red so i whink i am sticking with that for the moment but thank you very much i am still willing to learn more about automations, i think i need to learn yaml or something, anyway do you know a good post about device tracking i am using the app on my android phone and i want to turn on the garage lights when i arrive after sunset thanks again