logo smart home family kruse

Kruse Smart Home

Easy living in our smart home & Garden

Integrating the Shelly Flood sensor with Home Assistant

Integrating the Shelly Flood sensor with Home Assistant

26 November 2022


1. Introduction

Integrating the Shelly flood sensor with Home Assistant is easy, but unfortunately only the temperature and battery sensors work as expected. The flood sensor itself does not work out of the box; it sticks to the state “Dry”. This can be overcome by using the MQTT protocol.

Integrating the Shelly Flood sensor with Home Assistant

2. Requirements

For adding the flood sensor to Home Assistant the following is required:

  • Shelly Flood sensor & IP address of this sensor
  • MQTT broker working within Home Assistant & it’s username and password
  • An MQTT explorer, for example for windows.

3. Integrating the Shelly Flood sensor with Home Assistant

Perform the following steps to integrate the sensor with Home Assistant:

  1. Within Home Assistant select Settings from the sidebar

  2. Select Devices & services

  3. At bottom left click the button Add integration

  4. In the search box enter shelly to search for the Shelly integration

  5. Open your flood sensor and press once on the reset button to get the sensor out of sleep state.

  6. Enter the IP address of the flood sensor (can for example be found in your router) and click SUBMIT.

  7. The flood sensor configuration has now been created. Enter the area of the flood sensor and click on Finish.

  8. The Home Assistant integrations overview will show in the Shelly integratie the newly added flood sensor. Clicking on it will show the device details.

  9. One device with 3 entities will be shown. Click on the device link.
  1. The flood, temperature and battery sensor will be shown.

4. Configuring MQTT for the flood sensor

The last step for integrating the flood sensor with Home Assistant is implementing a connection via MQTT protocol to get the flood sensor working. This is divided into 2 steps:

  1. Enable the MQTT protocol in the flood sensor
  2. Create a Home Assistant Automation for the flood sensor

4.1 Enable the MQTT protocol in the Shelly Flood sensor

Execute the following steps:

  1. Awake the flood sensor by pressing the reset button once.
  2. Open it’s interface by entering the IP address in the browser address bar
  3. Go to Internet & Security > Advanced – Developer Settings > Enable MQTT

  4. Additional fields will be shown. Enter the username/password of the MQTT broker, the Home Assistant server IP address and if you want a custom MQTT prefix. Assure the flood sensor is still awake and click on the Save button.

  5. At the top of the browser screen the button Reboot now will be displayed. Click it.

4.2 Create a Home Assistant Automation for the flood sensor

A Home Assistant automation will be created to monitor the Shelly Flood MQTT topic for changes and will inform us if there is any. Execute the following steps:

  1. Open the automations.yaml file via the Home Assistant File Editor add-in
  2. Paste the following YAML code:
  3. Use the MQTT explorer to find the correct topic. I used the MQTT Explorer for Windows. After making connection to my Home Assistant I awakened the flood Sensor by pressing it’s reset button once. The explorer will show the flood sensor info. Select the flood sensor. The correct topic will be shown. Update the automation.yaml code w.r.t. the topic.

  4. Test it works by setting the flood sensor in water. Within Home Assistant a notification should be available.


Article by <a href="https://smarthome.familykruse.eu/author/iamjwk/" target="_self">Jan-Willem</a>

Article by Jan-Willem


Writen by the website owner

1 Comment

  1. Jan-Willem



Submit a Comment

Your email address will not be published. Required fields are marked *