Fix history_stats times

I have started using history_stats sensors to track how many minutes certain devices are running each day.
However I allways get 0.something values back… so its giving the time back in hours??
How can I change that? Time-Measurements are generaly done in Seconds so seeing hours there is very odd and makes little sense.
If I want to turn this into Minutes I need a seperate template sensor that multiplies the value by 60 which is a pretty poor reason for yet another Sensor.
I tried playing around with unit_of_measurement but that allways breaks the config.

So what is the correct, intended way to get minutes out of a history_stasts sensor?
Thanks!

What makes you think anyone intends that there’s a way for you to get minutes out of it… :upside_down_face:

Your only option is to use a template sensor. That being said, if it was in seconds you would still need a template sensor to get minutes.

If you could set the unit of measurment there would be no need for any template sensors.

I start to see why HA has so many custom modules as otherwise even very basic functionality is not available.

1 Like

Or looking at it another way:

Very advanced functionality is available by combining the many simple integrations and helpers available.

I fail to see how you would call changing the unit of a sensor “very advanced functionality”.
Others would call the inabillity to do so a bug.

I would not complain if HA wouldnt be that resource hungry and having yet another bunch of sensors that keep getting tracked is not helping in that regard.
So I fail to see how forcing users to configure additional sensors either through fixing the output numbers of history_stats or by building a counter and incrementing it via an automation would qualify as intentional design choice.

1 Like

Nice straw man argument.

Just because your use case is simple does not mean all are.

Good. Because it isn’t.

Domain Qty
 Sensor 788  ## !!!
 Alarm Control Panel 1
 Automation 287
 Binary Sensor 219
 Button 114
 Calendar 5
 Camera 17
 Climate 3
 Device Tracker 3
 Group 10
 Image 5
 Input Boolean 55
 Input Datetime 21
 Input Number 35
 Input Select 10
 Light 87
 Lock 2
 Media Player 12
 Number 22
 Remote 2
 Scene 35
 Schedule 2
 Script 166
 Select 29
 Stt 1
 Sun 1
 Switch 123
 Tts 1
 Update 25
 Vacuum 2
 Weather 3
 Zone 6

What are you trying to say?

I use HA for a year now and in that time the Disk usage increased steadily by 10GB.
In just one year.

So what was your point with your processor load?

“Just because your use case is simple does not mean all are.”

What about you stay out of my threads if you cannot contribute on topic.
Deal?

= memory and cpu.

Storage hungry would be what you are complaining about.

How about you ask nicely how we can fix your poorly configured history retention settings?

I keep 7 days of short term history and 2 years of long term in less than 5GB.

Otherwise good luck. :+1:

OK, then let me ask nicely again.
Hopefully this time the thread is not derailed and someone can provide an actual answer:

How can I change the output value of a history_stats sensor to minutes without using additional sensors, automations or helpers?

I meant about your storage issues as Drew has already answered that question.

OK so the Answer is:

“Congratulations you found a design deficit. You shall open a Change Request.”