The detector in cooperation with the ZWMP weather module provides the facility of automatic closing the windows equipped with motors compatible with the Z-Wave system in case of rainfall. This sensor finds also its application in smoke ventilation systems. Signal from the sensor is taken into account only when the smoke ventilation window is opened for ventilation. In case of emergency opening, signal from the rain sensor is ignored. The sensor is heated thanks to which its work is unaffected by such interference as mist, dew etc.. The sensor is intended for installation in the open sections of the roof directly exposed to weather conditions.