Shelly Flood Integration with Shelly 1: A Step-by-Step Guide

Hello fellow smart home enthusiasts! I recently embarked on a project to integrate my Shelly Flood sensor with a Shelly 1 relay to automate water pump shutdown during flood detection. While the setup seemed straightforward, I encountered a few hurdles that I thought I’d share with you in case you’re tackling a similar project.

Setup Overview

  • Network Infrastructure: I’m using a wireless router with a specific SSID to ensure all Shelly devices are on the same network.
  • Shelly 1 Relay: Configured with a static IP (192.168.1.20/24) for consistent communication.
  • Shelly Flood Sensor: Currently on a DHCP address (192.168.1.8/24), leased for 2 days.
  • Monitoring Tool: A laptop with Wireshark to track network activity.

The Challenge
Initially, I configured the Shelly Flood to trigger the Shelly 1 relay using the URL http://192.168.1.20/relay/0?turn=off. However, despite simulating a flood condition, there was no communication between the devices. Wireshark confirmed no traffic between the Flood sensor and the relay. Interestingly, accessing the URL directly from the laptop worked perfectly, indicating the issue wasn’t with the relay itself but somewhere in the Flood sensor’s configuration.

Troubleshooting Steps

  1. Firmware Check: Both devices were on the latest firmware, so that wasn’t the culprit.
  2. Network Configuration: Ensured both devices were on the same network and could communicate via ping.
  3. URL Testing: Verified the URL worked when accessed from the laptop, confirming the relay was functional.
  4. Shelly Flood Settings: Double-checked the Flood sensor’s settings, ensuring “Rain mode” was off and the correct URL was entered.

The Solution
After some research, I discovered that the Shelly Flood sensor requires specific headers in the HTTP request for actions to trigger properly. By modifying the URL to include the necessary headers, the Flood sensor now successfully communicates with the Shelly 1 relay. This involved a bit of trial and error, but the satisfaction of seeing everything work seamlessly was worth it!

Tips for Success

  • Test Each Component Individually: Ensure each device works independently before integrating them.
  • Check Network Settings: Confirm both devices are on the same network and can communicate.
  • Review Documentation: Sometimes, specific configurations or headers are required that aren’t immediately obvious.

Final Thoughts
Integrating smart devices can be a bit of a puzzle, but with patience and a systematic approach, you can overcome most challenges. If you’re working on a similar project, I hope this guide helps you avoid some of the pitfalls I encountered. Happy automating! :rocket: