I think knowing the temperatures and such amounts to predicting the foggy state. Detecting it could look much different. Visual observation is obvious. With purpose built glass, perhaps one could look at electrical properties on the inside of the windshield. Maybe changes in the reflectivity of the glass could be used. Maybe some refractive index shenanigans?