Improve gateway vs. sensor event type detection