-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Entities with device_class: duration no longer displaying in human readable format #23338
Comments
This is new intended behavior, it is intended to be more customizable than the previous implementation. If you want to see time in HH:MM format, change the unit_of_measurement for the entity to hours in the entity settings menu. See: #23025 |
Hi @karwosts Thanks for the explanation. I have added a comment to request that these changes be reverted. The unit_of_measurement advises what the base value is provided in. By setting this manually there is no option to dynamically view durations that range between minutes, hours, days and are not consistent. |
The unit of measurement selector in the UI does not have to be the base value of the sensor. If user picks a different value there, the base value is converted to that unit for display. |
Ok, that makes sense, I still believe by default the values should display dynamically in a human readable format and you can use the unit_of_measure enhancement to override this and use a fixed measurement. |
Unfortunately there is no concept of a "default" here, UoM can be selected as days, hours, minutes, or seconds, but there's no option which is "none of these, do something dynamic". There was mention of maybe doing something more with the display precision setting in the future, but that hasn't been acted on yet. |
Ok, what would the fix be to support the users who are negatively affected by this change and don't have a way forward? I tried to use the unit of measure setting and that is not available? So we are left with dashboards of pretty unusable numbers at the moment. See craibo/ha_strava#189 for example. FYI @piitaya |
Can you share the attributes of that sensor.strava_0_10 (unit_of_measurement & device class?). Surprised you don't see the unit_of_measurement selector there, I would have expected to see that.
This is what I see for a duration sensor with |
Checklist
Describe the issue you are experiencing
Since upgrading to
core-2024.12.0
and future versions, entities with thedevice_class: duration, unit_of_measurement: s
are no longer displaying on the dashboards in a human readable format.6,317 seconds
is being displayed as6,317s
. It was previously being displayed in a human readable format of1:45:17
Describe the behavior you expected
Entities with a
device_class: duration, unit_of_measurement: s
should be displayed in a human readable format ofH:MM:SS
eg. using
device_class: duration, unit_of_measurement: s
for the entityvalue:75
should display as1:15
value:6317
should display as1:45:17
Steps to reproduce the issue
device_class: duration
andunit_of_measurement: s
and a value greater then 60{value}s
format instead of the human readable formatWhat version of Home Assistant Core has the issue?
core-2024.12.0
What was the last working version of Home Assistant Core?
core-2024.11.3
In which browser are you experiencing the issue with?
Chrome, Companion App, Brave
Which operating system are you using to run this browser?
Windows, MacOS, Android, iOS
State of relevant entities
No response
Problem-relevant frontend configuration
No response
Javascript errors shown in your browser console/inspector
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: