Create helper based on binary helper

Hallo everyone,
i have a binary helper in home assistant.
It logs when a oil pump for my furnice is ‘on’ or ‘off’.

I want a helper that counts the minutes that the oil pump is on per day.
It should look like something like this:


y-axis: the minutes the oil pump was on at a day.
x-axis: the days

I tried several things, but nothing works and the official documentation doesn’t help me.
Trying something out is also frustrating when you have to wait at least half a hour till the changes show in the statistic.

All i got is this:
It tracks the minutes per day as a statistic but it resets every day.
(I couldn’t ad a screenshot because i am a new user.)

Is the helper i want possible?
And if, can it be done by using only the gui?
(I don’t like the yaml configuration.)

Greetings EvilErwin.

Make a history stats sensor with your start being

{{ today_at() }}

and end being

{{ now() }}


This is the helper i got.
y-axis: the time the oil pump was on at a day.
x-axis: time (date and time).

It reserts everyday and does not totalize the ‘on’-time of the pump.

start:
{{today_at('00:00')}}
end:
{{now()}}

If you want daily statistics, put that entity in a statistics card on the frontend.

Okay that worked.
But can’t i get a helper that does that?
So i get a longer history? (21 days then weeks then months)

Can i make a helper that counts the total ‘on’-time over a longer time?
(start: the day i configure this. end: today)

The helper already does that. Statistics are handled in the background for every entity. Just wait for the data to populate, then you can use monthly, yearly, etc and it will show you that data. No additional helpers needed.

long term statistics are stored forever. So if you aren’t getting those other time periods, that means the data doesn’t exist in your system yet.

Thank you for these clarifications.
I have two new questions:
1)
The statistic card i created has a configutaion for the amount of days.
When i want to view a different amount i have to edit the card.

The data from helpers i can view under ‘history’ and there i can select a time frame i want to watch. (From start date and time to end date and time.)

Can i create a helper i can view in ‘history’ that shows a bar chard of the ‘on’-time?

My helper that shows the ‘on’-time (from my screenshot) has some wrong data entries at the beginning.
It messes with the statistic.
(20h ‘on’-time instead of everage 3h per day)
Can i delete these data entries?

  1. Make a conditional card based on a input_select helper and conditionally show each statistics card based on the input_select.

  2. You can fix issues in developer tools → statistics tab. There should be a fix issue button. If that doesn’t appear, you’ll have to manually edit the database.