Some days ago, the community helped me out in finding what I needed to do to automate a switch in order to turn on for a period of time. What I have is this:
The automation turns on the switch for the minutes stipulated in the panel (in this case 15 minutes).
Now I want to show the time remaining when I activate the automation. Is there any solution for this? Could someone help me out to try this?
As you said, I changed the entity_id and it worked defining the time sensor as specified in the documentation. Thanks very much!!
One more question, if I want that the display shows minutes and seconds (25:00) instead fo inly minutes (25), it’s ok if I change the unit_of_measurement?
I do only partially understand why the remaining attribute can not be updated in frontend while is updated in the timer popup every second.
Anyway, I work-around this by pausing/restarting the timer every second for a fraction of a second. Of course for long time timers, it delays it, for my purpose (watering) it is ok enough. I am not very proud of that solution but couldn’t find better one.
Hi Tom,
I’ve been trying to do your template above but i’m struggling and i’m sure i’m doing it wrong someway as i can’t see where i put the length of time i want (30mins)
So basically i want a small card showing a toggle switch (which is a boolean toggle) and then the time remaining when the toggle switch is turned on.
So i created your template as below with the time sensor under it and they are in the packages folder and both sensors show up so i add the remaining time sensor and the booleen toggle to a entity card but nothing happens when i toggle it.
Can you tell where i’m going wrong ?
Thanks
Thanks for that.
Unfortunately it’s not accepting the code the template editor is saying. TemplateSyntaxError: unexpected ')', expected ']'
Where would i put the input number you mentioned in the template? would it be directly under the boost_time_remaining.
Thanks again
Thanks so much for that it works great now.
One last thing if i may, can the timer work with a script executed or anything else for that matter if so is it just a case of swapping the “input_boolean.boost_toggle” i have and change it to a script instead.
Hi @tom_l ,
Sorry to bother you again i’ve been trying to do this myself for a while now but can’t do it.
So you created me the countdown timer above.
When i press the “boost” button below it triggers a sensor called “sensor.home_boost” that increases the heating for 30 mins.
Now what i want to do is create a automation that when i press boost triggering this “sensor.home_boost” i want it to turn on the boost input boolean i have as that will then activate you countdown timer you did for me and will then show in my simple thermostat card.
I hope you understand what i mean and could help.
This is the automation i thought would work but its not.
alias: Boost
description: Turn boolean toggle on
trigger:
- platform: state
entity_id: sensor.home_boost
condition:
- condition: template
value_template: |
{{ trigger.to_state is not none and
trigger.to_state.state == 'true' }}
action:
- service: input_boolean.turn_on
data: {}
entity_id: input_boolean.boost_toggle
mode: single