There is so much wonderful documentation and forum posts, I just struggle to put it all together.
What I am trying to achieve is have a Lovelace UI card with a slider that you use to set a sleep timer for my TV.
All I have currently is a script that works to turn the TV off after a delay, I just want to make it more “smarter” and improve the WAF (wife approval factor).
Then I need to pass the details of the slider to my script, this is what I have for my script so far:
bedroom_tv_sleep_timer:
alias: Bedroom TV Sleep Timer
fields:
minutes:
name: Minutes
description: "The amount of time to wait before turning on the living room lights"
selector:
number:
min: 0
max: 60
step: 1
unit_of_measurement: minutes
mode: slider
# If called again while still running (probably in delay step), start over.
mode: restart
sequence:
- delay:
minutes: "{{ minutes }}"
- service: media_player.turn_off
target:
entity_id: media_player.bedroom_android
I’m not sure how you have your configuration organised, but I think that will work. Does the timer remaining value get set to the slider value when you trun on the switch?
If you are using the UI to create Helpers you could have entered the input number and input boolean there.
One thing you might want to change is the input_boolean icon:
hello, just to help if needed, i just make one with an “input_number” helper and a good flow into NodeRed (into HomeAssistant of course).
it’s for my bed (pre)warmer : bed warm from 9PM til 12PM.
When i turn on light after 9PM, it set the OFF timer to 15 minutes. (slider auto go to 15 minuts)
But i can change of very cold or if it’s warm enough (change slider live)
slider move with decement counter.
At 0 second, it stop bed warmer.