Shelly Flood - integration with or w/o MQTT

Hello,

I am using Home Assistant for about a year. So I am not an expert but I solved all problems so far, e.g. integration of trasmota switches, shelly switches, Hue bulbs etc.

Now I bought a shelly flood and tried to integrate it.
I tried:

  • MQTT: I can see the shelly flood in the MQTT explorer but not in my home assistant
  • “ShellyForHass” (Shelly smart home): switches are working fine but not shelly flood

What is the best way to integrate the shelly flood?

Regards,
xwox
PS: I do not need to use the cloud.

Create an MQTT binary sensor. Replace <deviceid> with your devicve id.

binary_sensor:
  - platform: mqtt
    name: Flood Sensor
    state_topic: "shellies/shellyflood-<deviceid>/sensor/flood"
    payload_on: "true"
    payload_off: "false"

Then add this to your customize.yaml:

binary_sensor.flood_sensor:
  icon: mdi:pipe-leak # or whatever icon you want for the flood sensor from here: https://materialdesignicons.com/

There are also two sensors available:

sensor:
  - platform: mqtt
    name: Battery Level
    state_topic: "shellies/shellyflood-<deviceid>/sensor/battery"
    value_template: {{ value }}
    unit_of_measurement: "%"
    icon: mdi:battery-70

  - platform: mqtt
    name: Temperature
    state_topic: "shellies/shellyflood-<deviceid>/sensor/temperature"
    value_template: {{ value }}
    unit_of_measurement: "°C" # or "°F" depending on your settings
    icon: mdi:thermometer

Untested. Info from here: https://shelly-api-docs.shelly.cloud/#shelly-flood

Thank you for your scripts. I integrated it into configuration.yaml.
It did not change my situation.

But still my problem is. The one ShellyFlood was integrated without a problem.
It even shows automatically “Trocken” (dry in German) without any special editing by me.
I only use ShellyForHass and the shelly discovery script.

I can see both shellies in my MQTT-Explorer. Messages look identically (except for the name).

What can I do to integrate ShellyFlood #2? What can be checked?

Regards,
xwox

Sounds like you could have the wrong device id for the second unit.