Cheap and reliable Rain sensor connected via MQTT

I was looking for reliable and cheap solution for a rain sensor to trigger an alarm in OpenHab when windows are open. Ready made sensors are available e.g. from Homematic but expensive.
After some search I found the Rain Sensor RS 12. You can easily combine the output (which goes to “low” when rain is detected) with any device providing a switch input. I choose the Shelly (plus) 1.
You can directly connect the “OUT” teminal of the RS12 with the Shelly “SW” pin. Additionally a 12V power supply is needed. After setting up the Shelly for MQTT operation, adding it as thing to OH and creating a channel for the contact status, you have a rain sensor for 30…40 € added to your home control system.
In my case when rain is detected, I created a rule to

  • mute all running audio (Spotify, radio, TV) etc.
  • announce the rain
  • announce all open windows, awnings, doors etc.

Edit 2.8.24: Schematic updated.

Rainsensor-MQTT

That sensor looks quite nice. I couldn’t find any heated ones that cheap last time I browsed aound. I ended up getting an aqara water sensor and yanking on a PCB with the same “maze pattern” as this one.

However, never got to complete it as I realized that condensation would likely be an issue.

Only annoying part is this one will require mains power outdoors, but could be worth the hassle!

I have a weather station and use the open source weewx software which supports mqtt.
It is easy to get the data into openHab via mqtt from the station.

I have an item that gets the is raining information and I display it on the floor plan.
Works well. I have been using it for years and you also get a weather station :smiley: