Sonoff RF Bridge MQTT Reset device state

I have a 433mhz water sensor that I have working with Sonoff RF Bridge(Tasmota) and MQTT. The water detection alert works fine, but the water sensor doesn’t send a signal when there is no longer water. I tried setting up an automation to clear the status, but it isn’t working. Any thoughts?

Sensor:

- platform: mqtt
  state_topic: "tele/RF_Bridge/RESULT"
  name: 'Basement Water Sensor'
  value_template: '{{value_json.RfReceived.Data}}'
  payload_on: '6EEC0C'
  payload_on: '6EEC0Coff'
  device_class: Moisture
  qos: 1

Automation to clear sensor:

- alias: Reset basement water detecotr
  initial_state: 'on'
  trigger:
  - platform: state
    entity_id: binary_sensor.basement_water_sensor
    from: 'off'
    to: 'on'
    for: "01:00:00"
  action:
  - service: mqtt.publish
    data:
      topic: tele/RF_Bridge/RESULT
      payload: 6EEC0Coff
  payload_on: '6EEC0C'
  payload_on: '6EEC0Coff'

One of these should be payload_off.

The action part seems ok, but the trigger ? When does your binary sensor get an ‘off’ ?

What about the off_delay of the binary_sensor?

1 Like

Thank you!!! Can’t believe I missed that.

Totally agree. With the current automation, if the ‘on’ gets fired once and then again 59 minutes and 59 seconds later, it’ll still turn off at 1 hour. If we use off_delay: 3600 it’ll stay on as long as the on payload keeps getting published. I guess it depends on the behaviour you are looking for.