How to detect if a sensor is connected to a digital input

But what do I on the unit with the wind sensor? The software should stay the same - if there is no wind the software would report nothing, even if the unit had a wind sensor.

How does the software know what 0 km/h means - no sensor or no wind? I'd like to distinguish between the two states.

Rudi