Histogram daily based with only 1 value for that day (chicken eggs per day)

I would like to create a histogram that shows the yield of our chickens. They lay between 0 and 10 eggs each day. I enter the number into Home Assistant during the day; the exact time (hour and minute) is irrelevant for the log and histogram.

I want to be able to generate a histogram that is comparable to the energy dashboard, where you can see a histogram per day, week, and month.

For example: today 6, yesterday 4, the day before yesterday 6.

How can I set this up in Home Assistant to track and visualize our daily egg production in a similar way to the energy dashboard?

I would say you want to create a forever increasing sensor which is total number of eggs produced. If you make that with state_class total_increasing, then statistics platform will store it in long term statistics.

If it is stored in long term statistics, you then can make a statistics graph card (bar chart), with the ‘change’ value selected. This will then be a bar chart, and whatever timescale you select, it will show the number of eggs increased in that time range. So if you have a daily chart, it will show the eggs produced for that day.

To get that sensor, there’s a couple approaches you could take. You can make a script that increments a counter helper by a value you input, or an automation that increments a counter anytime an input_number changes. For either of these approaches you’ll then need one additional template to change the counter to a sensor with the correct state class.

Or you could make a script that prompts for a number of eggs and fires an event, and a triggered template sensor that listens for that event and increments its value when it sees it.