Skip to content
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

Support Msec to hours #174

Closed
poudenes opened this issue Feb 23, 2021 · 3 comments
Closed

Support Msec to hours #174

poudenes opened this issue Feb 23, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@poudenes
Copy link

Hi All,
Love this add-on so much!!! use it for many things!!

I have some sensors that show the uptime in msec. How can I change this to convert them to hours?
Or is there a way to make it possible to support this to convert it to hours?

Cheers,
Peter

@benct benct added the enhancement New feature or request label Mar 22, 2021
@benct
Copy link
Owner

benct commented Mar 29, 2021

I'm guessing format: duration will not work, as your sensors are in milli(?)seconds? If so you could make a template sensor that divides your sensor value by 1000, and then use the duration formatting option. Not sure I want to add custom conversions for all types of numbers, but I'll see what can be done.

@mitch-thomas
Copy link

I would also appreciate this feature - in a more general form:
Add a configuration property "convert" to scale the value before displaying it.
This allows for the above conversion as well as converting from Wh to kWh (without using template senors).

@benct
Copy link
Owner

benct commented Dec 23, 2021

Added formatting option duration-m in version 4.4.0 for converting milliseconds to a HA duration.

(also added kilo to convert Wh to kWh, i.e. divide number by 1000)

@benct benct closed this as completed Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants