Statistics & door sensor

Hi,

I have a door sensor in a small shop, and would like to “count numbers of customers”, by that I mean make some statistics on how many time the door is opened. But since one count needs to be divided by 2 ( Entry + Exit), I’m totally lost as how this can be done in Home Assistant.

I haven’t come to how to present the numbers in Lovelace yet, either. So suggestions are more than welcome :slight_smile:

There is this :
History Stats - Home Assistant (home-assistant.io)

@vingerha Thank you for the link. However I can’t see how I can reduce the counting from two (door open/close when customer enters, and door open/close when customer leaves) to just one registration?

You can put a delay in for ex. 10 seconds. so they can open and close the door

but you have 2 counts, when they come and when the go

Mine registers ‘open’ and ‘closed’ so only thing to do is count ‘open’ or?
Else, count all and divide by 2
EDIT… coing dropped (dûh :slight_smile: )… so you’d have to divide by 2 anyhow and this then needs a template as hist-stats does not have it…or you divide by 2 in the card when displaying it
Alternative is a helper + automation and possibly other alternatives…I sadly have little time to help further before Friday so it seems