Ecowitt Soil Moisture Sensor not working in automation, anyone have this happen?

I’ve recently added the Ecowitt GW1100 and a WH51 Soil Moisture Sensor to my setup. I’ve been able to successfully configure the integration, and I’m receiving readings from the WH51. I’m attempting to add automation so that if the soil moisture goes below a certain threshold (45%) it will trigger a 10-minute cycle from my sprinklers. However, there seems to be an issue with my configuration because I can’t get the automation to work. Here’s what I have (I’ve added a light just to confirm when it triggers):

alias: Garden sprinkler on below 45 moisture
description: “”
trigger:

  • type: humidity
    platform: device
    device_id: 2db1a4d8351364925e5fa99503fdb2a0
    entity_id: be38cec51227544ce69b4b28ea39bc2d
    domain: sensor
    below: 45
    for:
    hours: 1
    minutes: 0
    seconds: 0
    condition:
    action:
  • type: turn_on
    device_id: 0226121b4c3038a29c8baba3eb72a78f
    entity_id: dc046ac2dcd93fca68062ae2bcb2bad5
    domain: switch
  • type: turn_on
    device_id: 62017308ddde8a4d132fbe805ac56670
    entity_id: 39509ac6abe6955a0459d0a58a6b4463
    domain: light
    brightness_pct: 15
  • type: turn_on
    device_id: 59705788eb79fae3abce045b90bebf29
    entity_id: 66f3496fd724557f2137fab0d3c1043d
    domain: light
    brightness_pct: 75
  • delay:
    hours: 0
    minutes: 10
    seconds: 0
    milliseconds: 0
  • type: turn_off
    device_id: 0226121b4c3038a29c8baba3eb72a78f
    entity_id: dc046ac2dcd93fca68062ae2bcb2bad5
    domain: switch
  • type: turn_off
    device_id: 62017308ddde8a4d132fbe805ac56670
    entity_id: 39509ac6abe6955a0459d0a58a6b4463
    domain: light
  • type: turn_on
    device_id: 59705788eb79fae3abce045b90bebf29
    entity_id: 66f3496fd724557f2137fab0d3c1043d
    domain: light
    brightness_pct: 10
    mode: single

I have that same sensor. Have you looked at the trace of the automation, or it just never triggers?

Based on what you’ve posted you have picked a device trigger; I’d recommend changing it to entity trigger. It should look something like this, just with your entity name:

trigger:
  - platform: numeric_state
    entity_id:
      - sensor.out_soil_moisture
    below: 45
    for:
      hours: 1
      minutes: 0
      seconds: 0
condition: []

Keep in mind that the value must go above 45 for the trigger to occur again, but I’m guessing the watering should consistently do that.

The key to the above is the numeric state trigger - if the automation isn’t properly evaluating your trigger as a number, it will never fire.

1 Like

It’s weird, in that after I wrote this it triggered. It has also done this in the past. I tried the entity route only to have it never trigger. In checking the trace logs, it looks like it worked as intended.

You stated that the “value must go above 45 for the trigger to occur again” but I have it as below 45% for one hour. Might this be the issue, that it should be “above” which wouldn’t make sense to me, but that wouldn’t be a first.

Yes, it has to start above 45 and go below for one hour for the trigger to occur. It will never trigger again until it has gone above 45 and then below again for 1 hour. If it ever goes above during the 1 hour delay, the trigger is canceled and the cycle starts again.

So, the way I have it written it correct? The trigger should be Below 45% and the only way it will trigger is if the soil moisture goes below the 45% threshold for 1 hour. Am I understanding this correctly?

Yes, sounds like you understand it correctly.

1 Like

I’m going to mark this as solved, but with the caveat that I deleted and recreated the automation. For the trigger, I used the device GWB1100 which then triggers a dropdown for the moisture sensor.

The automation has triggered several times today, and I’m going to blame this on gremlins!

1 Like