Water/ Flood Sensor via ESP8266 (01-S) and MQTT

Hello community,
I am currently facing the problem of integrating a water sensor with an ESP8266 01-S into Home Assistant via MQTT.
As soon as water is reported, I also get the corresponding message (via binary_sensor on/off) on Home Assistant.
Since the ESP 01-S only sends the message once and then goes to sleep again, I would like to set the binary_sensor back to “off” via a “Helper Button” after it has been set to “on”.

This can be done via “Set State” in the “Developer Tools”, but I would like to do it via a button on the LoveLace.

Can you help me with this?
I know that it is supposed to work via the “Shell”, but I just can’t get it to work… I’ve been despairing about this project for almost 3 weeks now…

Many thanks in advance :slight_smile:

  - name: "Waschkueche Wassermelder Alarmkontakt"
    unique_id: 220920221
    state_topic: "WaschkuecheWassermelder/water_detected"
    payload_on: 'on'
    payload_off: 'off'
    qos: 1
    device_class: problem
    value_template: "{{ value_json.state }}"


Create a button that on the tap action performs a mqtt publish service call that publishes the off payload to the same mqtt topic as the water device does.

That sounds like a possible solution :slight_smile:
Could you please tell me how to interpret the following codes?
e.g. topic
The file path behind it would then be named as follows: home-assistant/config/mqtt/???
It is difficult for me to understand what should be entered here.
Can the unique_id also be entered there to identify the binary_sensor?


“topic” is a pretty basic concept in mqtt. Are you saying you don’t know what “topic” means in that regard?

If that’s the case then you should look for information on how mqtt works before you attempt this. It’ll be a bit too complicasted to try to explain it in a thread like this.