Historian help needed

I disagree, I think tag history is great to use for what you need.

For your event, if you trust that you won't have multiple 1s or 0s in a row, then use count aggregate for one hour interval. If you could have multiples, then you will want to use a script. Something like the one below that @JordanCClark did, but instead of total time, you would change to total count.