Latched Condition Triggering Unexpectantly

I’ve set up Reactor Sensor to monitor if the Current Temp (according to a DarkSky Weather device) goes over 28deg celsius.
If it does, I want my watering system to run an extra cycle that evening.

As the temp might reach 28deg and then drop again, I have set the Reactor condition to be latched (with I understand keeps it tripped until I reset the sensor).
I have a scene that runs early each day to reset the sensor (it sets it to enabled, armed & reset).
I’ve confirmed that it successfully resets the sensor.

However the sensor keeps tripping even though the temp hasn’t gone anywhere near 28 deg.

I’ve attached what it currently shows. It was definitely not tripped an hour ago and even Reactor says that the temp hasn’t gone over 28deg since 2nd Nov (ie. 2 days ago).
I can’t work out what is tripping it.

[quote=“sk1.publicc, post:1, topic:200021”]I’ve set up Reactor Sensor to monitor if the Current Temp (according to a DarkSky Weather device) goes over 28deg celsius.
If it does, I want my watering system to run an extra cycle that evening.

As the temp might reach 28deg and then drop again, I have set the Reactor condition to be latched (with I understand keeps it tripped until I reset the sensor).
I have a scene that runs early each day to reset the sensor (it sets it to enabled, armed & reset).
I’ve confirmed that it successfully resets the sensor.

However the sensor keeps tripping even though the temp hasn’t gone anywhere near 28 deg.

I’ve attached what it currently shows. It was definitely not tripped an hour ago and even Reactor says that the temp hasn’t gone over 28deg since 2nd Nov (ie. 2 days ago).
I can’t work out what is tripping it.[/quote]

Can you go to the “Test” tab and find the “Summary” link and post that? That’s better for diagnostics than screen shots, particularly if your sensor has been running a while.

Wait… latching doesn’t work the way you think, I think. When latching is on, the condition stays true until all other conditions in the same group (that aren’t latching) go false. Since you have no other conditions in that group, there is no way for the condition to reset–once latched, it is stuck latched. You untripping the ReactorSensor does not reset the latched condition(s)–it’s still latched. But the ReactorSensor does nothing about that until the next time the weather plugin updates the temperature, which triggers Reactor to re-evaluate the condition–at that point, it’s still latched, so it remains true regardless of the new value (that’s what latching does). But, the ReactorSensor itself then says “hey, I’ve got a condition group that’s true, and I’m supposed to be tripped right now but I’m not,” so it re-trips and causes your scene to run.

You need to add an additional, unlatched condition to your group so that the latched condition can unlatch. If you want your watering to only run after 6pm, for example, add a date/time condition configured to “after 18:00”. When that condition goes true, if the latched condition (temperature) also went true during that day, then all conditions in the group are then true and the ReactorSensor will trip, running your watering scene. At midnight, the time condition will automatically reset to false, resetting the latched condition as well.

BTW, in practice, the time of watering will not be random in the range of 6pm to midnight in the above example. It will be as close to 6pm as Vera’s uptime permits (i.e. exactly at 6pm if your Vera is up and running then, or as soon as it finishes rebooting/reloading after).

Thanks @rigpapa, adding the additional time condition has worked a treat. :slight_smile:

I’ve been messing around with latching and my findings are slightly different to what you’ve said above.

In my case, I have 3 conditions in an AND group, 1 of them with latching enabled. With all 3 conditions true, the latched condition resets when at least 1 (not all) of the other non-latching conditions are false.

This is actually what I was expecting, but just thought I’d confirm my understanding…

Great catch. The wiki text on this is still 2.0, and incorrect besides. Your observed behavior would be correct for 2.x, and an AND group in 3.0. Groups using OR or XOR will perform differently (exercise for readers).

A correct text for 3.0 will express that a latched condition remains true until the group to which it belongs goes false.

I will fix the text when I get home. I invite you or anyone else with a Github account to make corrections and embellishments in the wiki, as well.

EDIT: Turns out, @sm2117 was quoting an old post, not the wiki. The current text describing the latch option in the Wiki is correct/up-to-date, and has been since 3.0 was released.

Yes, that’s right. Sorry for the confusion. I hadn’t read the wiki until after you pointed it out.

…which was entirely mine. I was reading on mobile/phone and completely missed the visual cue that would have taken me back to the original message, and then known it was not from the wiki. I’m still getting used to these new forums.