Rule not being triggered

Ecowitt GW1106 Soil Moisture Kit which includes gateway and sensor, seems to work well - https://www.amazon.com/dp/B09WQHDYN4?psc=1&ref=ppx_yo2ov_dt_b_product_details

1 Like

That's interesting, and I would agree that I'd rather have the event posted since the gateway only does checks once a minute. There are other drivers out there, might install one of them and try that one out.

That code chunk I posted above is what is filtering it.

Change it to something like this and it would post every event.
Just removing the if block around those 3 lines would make it run every time. Not sure what the return (true) triggers, if it triggers a log entry you may see a log entry every minute as well.

 // if ((device.currentValue(attribute) as BigDecimal) != val) {
    if (measure) sendEvent(name: attribute, value: val, unit: measure);
    else sendEvent(name: attribute, value: val);
    return (true);
//  }

The hub is still going to discard events that don't represent a state change.

2 Likes

Yeah I knew they got "hidden" from the events log but I was not totally sure if they would trigger rules or not. Sounds like you are saying they get totally trashed, so would not trigger rules.

So in that case, the change I suggested above would not be of much advantage here.

You really just need to wait for the value to change in order to trigger the rule. I think now that OP understands that, everything can work as-is with the unmodified driver.

Correct. The hub only passes on events that represent state changes for the attribute (unless the driver forces it with stateChange: true -- which you don't really want).

I use Ecowitt sensors and have no problem with them at all with respect to triggering rules.

2 Likes

ok, thanks guys this is helpful. Sounds like if I want to run I when the state hasn't changed, I'll have to kick it off manually instead of changing the threshold. That's effectively what I was doing because I'm trying to figure out good bounds for the moisture reading without letting me avocado tree starve in the mean time :slight_smile: Good to know it will work as expected once I have those threshold set correctly.

2 Likes

Just following up now that it's been running for a bit. It's working as expected with the unmodified driver code :+1: Thanks again for all your help @jtp10181 and @bravenel!

3 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.