Plotting shower times in a bar chart

Hi I am fairly new to home assistant so I hope this is not to much of a noob question
(I did check around for similar questions but have not been able to find any answers)

What I have is a:

binary_sensor.boiler_tapwater_active 

entity that is able to generate the history graph below.

For obvious reasons this bar mostly shows “Off” (no hot water usage) and only occasiononally briefly switches to “On”. Unfortunately in practice this means the graph is not very relevant.

What I would be looking for is a bar chart that shows me the amount of times hot water is used (nr of bars per day) and the amount of time hot wat is used (height) of the bar. e.g if on a particular day 3 shower event occurred of 3, 7 and 5min the graph would show me 3 bars that are resp 3,7 and 5 min high.

Would this be possible?
How would I go about making this?

I realise that this means the amount of bars my vary for each day displayed, and if needed I would be fine with just displaying the last 10 events (still knowing when they occurred would be nice).

Also I realise that as I would like to check for shower event only I probably need to find a way of filtering out short (<1 min) events of hot water usage.

I think I read some where that doing what I want requires may require a new sensor that measures how long the binary sensor is in a specific state but I am not really sure how I would need to build such a sensor as I would expect it state to be reset by each shower event.

Thanks for the help
Remi

Look at creating a statistics sensor with ‘count’
Statistics - Home Assistant (home-assistant.io)