Okay, but that’s not what you wrote initially - you wrote that you use median to not spam HA but get fast value changes.
Median isn’t the right tool to achieve that.
It’s kind of strange that you get spikes like that, haven’t seen anything similar with my unit and would still assume that the values are correct, maybe the fan just kicks up some dust from time to time or the fan collected some dirt on the fan blades which falls back into the sensor when it turns off?
Anyway, yes median is able to filter out outliners. But I would stack a sliding average over the output anyway, to avoid that you send flickering values in short succession to HA, but instead combine those values to get more precision.