Help with statistics sensor: calculate increase in the last 48 hours

One other issue related to this: if no change during 48 hours, the sensor reads “unkown” and not 0. For this reason my automation was no longer working (if rainfall last 48 hours < 2, start watering). I think it makes more sense for the sensor to return 0 if there no no change, is there a way to enforce this?

unknown