jeroenterheerdt / HAsmartirrigation

Smart Irrigation custom component for Home Assistant
MIT License
301 stars 47 forks source link

Change to minutes does not affect (unit_of_measurement) #332

Closed mikburnz closed 1 month ago

mikburnz commented 2 months ago

What happened?

If i change from seconds to minutes for the sensor (unit_of_measurement) then the value stays the same. How can i let me show the irrigation time in minutes instead of seconds?

How to reproduce

.

Relevant log output

.

Which version are you running?

.

Diagnostics file

Additional information

.

DaTwo commented 2 months ago

I do it with a helper template. I find keeping things in seconds form all the way till display is much easier to manage as no time formatting conversions need to take place till you want to display it. I just use a helper template and use this to convert the seconds into "hours:minutes:seconds". Hope this helps.

{{ timedelta(seconds=states('sensor.your_sensor') | int(0)) }}

jeroenterheerdt commented 1 month ago

See comment above. Closing as won't fix.