Count the number of times a specific event has occurred within another event
This is a workaround since you do not have the ability to control the bin size in the search results. Assuming you can do a search result to find your event for which you want to find the number of times another event occurred, e.g., a valve has opened.
Create a new Tag Builder Formula to count the number of times e.g., a valve tag changes to open from any other state that is not open (valve is closed when 0 and opened when 1).
Formula:
if(and(A=1, A=B, C<>A), 86400, 0)
Variable mapping:
A = Event-Tag
B = Event-Tag, shifted by 1 second (x seconds)
C = Event-Tag, shifted by 2 seconds (2*x seconds)
Now a value-based search can be performed and the integral for each search result can be get.
It is also possible to use the statistics table get the number of events directly from the integral there. You can zoom into any area and quickly see the number of events across that period.