-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
[Feature] UPS runtime_left time format #245
Comments
it is in iso8601, just missing pt mark. |
It has, called timedelta, and this attribute fits perfectly. |
you are talking about python there, not HA. |
I agree with the duration solution. I believe runtime should be passed in integer seconds. Then if the template sensor's "device_class" is "duration", most home assistant cards will display the duration in HH:MM:SS format automatically. History graphs are working as well. I tested it and it works, the card below gets its runtime data in seconds. For those who cannot wait here is an example template script that converts the 1h30m30s format to seconds.
|
Is your feature request related to a problem? Please describe.
Currently the attribute "runtime_left" is not eaily used in templates because it's format is not a standard time/timedelta.
Describe the solution you'd like
Would it be possible to format the runtime_left attribute in such a way what it's compatible with the as_timedelta filter ? (taken from docs: Expects data in the format DD HH:MM:SS.uuuuuu, DD HH:MM:SS,uuuuuu, or as specified by ISO 8601 (e.g. P4DT1H15M20S which is equivalent to 4 1:15:20) or PostgreSQL’s day-time interval format (e.g. 3 days 04:05:06))
This way this attribute is easier to be used in automations and scripts that rely on the time left on battery.
Describe alternatives you've considered
Converting the current attribute value inside the template before filtering it with as_timedelta.
The text was updated successfully, but these errors were encountered: