3rd Reality Water Sense Leaker will turn a switch ON but not OFF

Hi,

I’ve recently purchased a 3rd Reality Water Leak Sensor, and it appears to work, but I can’t seem to get it to turn off a switch (attached to a sump pump) when it stops sensing moisture.

Turning the pump on works almost instantly, and is exactly what I need, but when the moisture drops below the sensor I need it to turn off.

Here’s my two code snippets - I’m hoping someone can help me out.

I’m using latest HAOS/HA in VirtualBox and everything else works fine (presence sensor, smart plugs, etc.). I used the GUI to create the automation.

Working Code:

alias: Turn Window Sump Pump ON
description:
triggers:
  - type: moist
    device_id: 0466edee3436f407c58e1013a182e39b
    entity_id: 2e32e1fae4de439fb71a641f6e650e41
    domain: binary_sensor
    trigger: device
conditions: []
actions:
  - action: switch.turn_on
    target:
      entity_id:
        - switch.new_outdoor_smart_plug_plug_2
    data: {}
  - data:
      message: Sump Pump Turned ON
      title: Sump Pump Off Notification
    action: notify.notify
mode: single

Broken Code:

alias: Turn Window Sump Pump Off
description:
triggers:
  - type: not_moist
    device_id: 0466edee3436f407c58e1013a182e39b
    entity_id: 2e32e1fae4de439fb71a641f6e650e41
    domain: binary_sensor
    trigger: device
conditions: []
actions:
  - target:
      entity_id: switch.new_outdoor_smart_plug_plug_2
    action: switch.turn_off
    data: {}
  - data:
      message: Sump Pump Turned OFF
      title: Sump Pump Off Notification
    action: notify.notify
mode: single

Turns out the answer was the delete the automation and recreate… exactly the same…