Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95985

Try convert input number to time format

$
0
0

@noam76 wrote:

Hi, I use home assistant and try convert an input number to time format.
I can convert the number to minutes but I don’t succeed with the time.
I receive unknow to my timer_countdown_hour sensor.
Who can help me to correct my code?

my input_number variable is timer_countdown

- platform: template
    sensors:
     timer_int:
      value_template: "{{ states('input_number.timer_countdown') | int }}"
     timer_countdown_min:
      value_template: "{{ states('input_number.timer_countdown') | int %60}}"

    # what is the correct way to do this operation ?
     timer_countdown_hour:
      value_template: "{{ states('sensor.timer_int') - states('sensor.timer_countdown_min') / 60 }}"

Posts: 7

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95985

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>