The template sensor was originally constructed to use an input number to set the delay time in minutes. It is referenced here in the template:
{{ [ (states('input_number.minuts')|int
…
So if you want a fixed time of 30 minutes you could replace that with a number like so:
sensor:
- platform: template
sensors:
boost_time_remaining:
friendly_name: 'Time Remaining'
unit_of_measurement: "min"
value_template: >
{% set update = states('sensor.time') %}
{% if is_state('input_boolean.boost_toggle', 'on') %}
{{ [ 30 - (as_timestamp(now()) - as_timestamp(states.input_boolean.boost_toggle.last_changed))/60)|round(0) ,0 ] | max }}
{% else %}
0
{% endif %}
If you want a variable time use the original template but add this input number to your configuration:
input_number:
minutes:
name: Minutes
min: 1
max: 60
step: 1
Also with recent changes to the template engine this line is no longer needed:
{% set update = states('sensor.time') %}
And can be deleted.
sensor:
- platform: template
sensors:
boost_time_remaining:
friendly_name: 'Time Remaining'
unit_of_measurement: "min"
value_template: >
{% if is_state('input_boolean.boost_toggle', 'on') %}
{{ [ 30 - (as_timestamp(now()) - as_timestamp(states.input_boolean.boost_toggle.last_changed))/60)|round(0) ,0 ] | max }}
{% else %}
0
{% endif %}