(history stats) simply count eggs and have a daily stats?

Hi all, i’ve been struggling with this simple question :
i have a simple counter that i manually increment when my chicken lay eggs.
is it possible to have a daily / monthly graph form that counter ? i try history stats with the counter with no luck …


sensor:
  - platform: history_stats
    name: oeufs du jour
    entity_id: counter.oeufstotal
    state: "on"
    type: count
    start: "{{ today_at('00:00') }}"
    duration:
        hours: 24

this is from the counter :

History stats can’t answer a question like “how much has the sensor value changed today.” You could use the statistics integration, but unfortunately it only supports max_age and sample_size as ways to restrict the time period considered – so there is no way to restrict it to just today.

You could create an input_number into which you save the oeufstotal value into every day at midnight, then create a template sensor that subtracts that input_number from oeufstotal to get the “today” count.

Try the utility meter helper with daily and monthly cycles.

You won’t even need to reset your counter.

Thanks guys, will try that :wink: