what would be the best way to count events (state change) in a day?
ie; counting the number of time in/out of bed in a night using data from bed pressure sensor. resetting the counter each day. but preferably starting to count only after bedroom lights are off.
I was aiming for <history stats sensor> but it might not be the best way...