Open h0jeZvgoxFepBQ2C opened 1 year ago
There plenty of possible desires like "convert my Celsius to Fahrenheits", "euros to dollars", "time to hh:mm:ss" ... It is not easy to define ALL of them.
Do you want is a possibility to define a format of the displayed state only - or for all displayed labels?
including popup labels while hovering
Oh this looks really nice, I guess for all labels it would be great then.
Maybe it's possible to provide a value_template function, so it could be open to the user what he wants to convert (like you mentioned, Celcius to Fahrenheit, EUR/USD,...)?
But if it's easier to implement just the hour formatting, I would prefer option two :D ❤️
I would suggest to implement somthing like
value_template: |
{% set duration = <some_value> * 60 %}
{{ duration|int }}:{{ '{:02}'.format(((duration - duration|int) * 60) |int) }}
.. or it can be formatted depends on an entity attributes for example I have a sensor with attributes
state_class: measurement
unit_of_measurement: h
device_class: duration
icon: mdi:chart-line
and it shows like hh:mm:ss on tile card
it's the same values
Hi,
I'm using your mini-graph-card to calculate how many hours a sensor was on in my home. It works fine, but shows f.e. "0,05 hours" whereas it would be nice to show "0 Hours 3 Minutes" (since 0,05 hours translate to 3 minutes).
Any idea if this is possible to implement?