Timer template - counting in seconds only?

Hi all!
I’ve a problem with template using number helper. When I use simple template such as:

service: timer. Start
data:
  duration: "{{states('input_number.time_duration')}}"
target:
  entity_id: timer.timer_ch1

Timer starts but counting only as second. My question: is how set as minutes. In my solution I cannot use time - helper because it use HH:MM format.
My problem looks like below:
2023-06-19 16_04_43-Clipboard

Please support me, I’m not advanced HA user :slight_smile:
Thanks in advance!

Kris

Hello Kris,

If your input_number is meant to be used as a number of minutes, then you can start the time with a multiplication, like so:

service: timer.start
data:
  duration: '{{ int(states(''input_number.time_duration''), 0) * 60 }}'
target:
  entity_id: timer.timer_ch1

This is what I’m doing for the kid’s bedroom.
image

Please note the conversion to ìnt with a default value of 0 in my code.

The “standard” method for durations is to use the unit configuration variables:

service: timer.start
data:
  duration: 
    minutes: "{{states('input_number.time_duration')}}"
target:
  entity_id: timer.timer_ch1

Another option which works, but is limited to 99 minute maximum.

service: timer.start
data:
  duration: "{{ '00:' ~ states('input_number.time_duration') | int | string  }}"
target:
  entity_id: timer.timer_ch1

Wow! Thank you!!! I try to use tomorrow.
Seems perfect - I’ll set up and test.

Many thanks!!!

Kris

EDIT:
Gentelmans!
All proposed solutions are correct and working fine :slight_smile:
To be fair and will remember, for my 6 channels, I set up 3 as first and 3 as second solution.

Thank you very much!!!

Kris