benct / lovelace-multiple-entity-row

Show multiple entity states and attributes on entity rows in Home Assistant's Lovelace UI
MIT License
798 stars 60 forks source link

Durations showing as decimal hours #250

Closed sevorl closed 1 year ago

sevorl commented 2 years ago

durations are displayed in decimal hours instead of hh:mm:ss

This becomes obvious with the latest changes in 2022.5 for history stats https://github.com/home-assistant/core/pull/70720

Here is an example that shows the difference to the regular entities card: image image

aheath70 commented 1 year ago

I have exactly the same issue here.

I have a history_stats sensor measuring the amount of time a pool solar pump runs each day, unit of measures is hours, and that is how the history_stats time sensor type stores its values according to the documentation at https://www.home-assistant.io/integrations/history_stats/.

When I display it in an entities card, it displays in HH:MM:SS format (e.g. 6:59:24). image

When it is displayed it in a multiple entity row, it shows as a decimal value (e.g. 6.99). image

Sensor is as per the Home Assistant documentation page for a sensor of this type, and there is no ability to change the unit of measure from hours to minutes:-

- platform: history_stats
  name: Pool solar running today
  entity_id: switch.pool_solar_pump_switch
  state: 'on'
  type: time
  start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
  end: '{{ now() }}'

I notice that the multiple entity row card has a format option, which allows sensors in seconds in milliseconds to be converted, but it does not allow minutes or hours to be converted.

benct commented 1 year ago

Might be fixed in version 4.5.0 with formatting option duration-h.