I want this to return something like 40 seconds. However as you can see in ID 5->6 there is a 9 hour jump (this is normal in my data, for example the equipment isn't used during the night, so the jump becomes ~9 hours). So the average gets shifted up a lot. I want to filter those out, for example don't include the time interval to the average if it's over 1 hour (this would be the best, I thought filtering out the nights too, but sometimes the big jumps might happen during the day too).
So how would the filtering these out go? I've already tried stuff like this (0.042 is 1 hour in duration):