Successfully Setting Up a Rain Sensor for Home Assistant

Hi everyone,

I wanted to share my recent success in setting up a rain sensor for my Home Assistant setup. I’ve been looking for a reliable way to automatically close my awning and send a notification if any of my windows are open during a rainstorm. After some research and trial and error, I found a solution that works perfectly!

First, I started by searching for a rain sensor that integrates well with Home Assistant. Unfortunately, most of the options I found were either DIY solutions or didn’t meet my specific needs. However, I discovered that using an Aqara door sensor as a DIY rain sensor was a viable option. Here’s how I set it up:

  1. DIY Rain Sensor Setup: I placed an Aqara door sensor near my awning. The sensor detects rain by using its built-in motion and contact sensors. When it detects rain, it triggers a series of actions in Home Assistant.

  2. Automations in Home Assistant: I created an automation in Home Assistant that does the following:

  • Closes the awning if it’s open.
  • Checks if any of my windows (also using Aqara door sensors) are open.
  • Sends a Telegram message if any windows are open, alerting me to close them.

Here’s a quick look at the automation setup:
yaml

  • id: ‘123456789’
    alias: Rain Sensor Automation
    trigger:
    • platform: state
      entity_id: binary_sensor.rain_sensor
      from: ‘off’
      to: ‘on’
      condition:
      action:
    • service: cover.close
      entity_id: cover.awning
    • service: notify.send_telegram
      data:
      message: “Rain detected! Please close the windows.”
    • service: automation.turn_on
      entity_id: automation.check_windows
  1. Testing and Fine-Tuning: After setting up the automation, I tested it by manually triggering the rain sensor. Everything worked as expected—the awning closed, and I received a notification. I also tested it during a light rain shower, and it worked perfectly!

I’m really happy with how this setup turned out. It’s a simple yet effective solution that integrates seamlessly with my existing Home Assistant ecosystem. If anyone has questions or needs help setting up something similar, feel free to ask!

Cheers,
Timo