I set up sensor in my sensors.yaml file to count the number of times a switch turns “on” per day and it works as expected.
- platform: history_stats
type: count
name: Pond fill count today
entity_id: switch.pond_water_control_2
state: “on”
start: “{{ today_at() }}”
end: “{{now()}}”
I then created a Statistics graph card to display these values on a bar chart but it shows the wrong number.
Today it shows 2 when it should be 1 according to the Logbook and History
Any ideas??