Rule Machine triggered rule

Hi @bravenel I've noticed a strange behaviour with Rule Machine Triggered Rule.

I have a rule defined as below:

These are rule statuses:

From definition, rule should be triggered only once when Humidity "Temperatura Bagno" < Humidity "Temperatura Sala" + 10 and evaluated true only when Contact "Finestra Bagno" is open, but seems that rule it's triggered also when opening "Finestra Bagno".

Any idea if I've done something wrong with the rule or something else seems wrong on Hubitat side?

Can't really tell from what you've shown. You can see that the app has subscription only to events of the two sensors, so events from the contact sensor are not activating the app. It is possible that something else is messing the TTS up. What driver/app are you using for Alexa TTS?

Please look at the app events. These can be found by clicking on the Events button on the app status page you showed above. It will show what has happened. Also, if you could turn on App Logging in the app, and have Logs open, that would also help to see just what is happening.

Hmmm, I'm trying to reproduce it with logging enabled but without success, weird..
Looking anyway at the previous events, there is anyway something strange, how can be true if difference is less than 10%?

Look at the device events. Click on the Events button on the device page. It will show temperature events and humidity events. Also, notice that times of the events are different. So we don't really know from those events what the two values were at the time of trigger firing.

I will set up a test similar to yours....

This is "Temperatura Bagno"

This is "Temperatura Sala"

And this is "Finestra Bagno"

I don't have Alexa events, but I think that message was sent on "Temperatura Bagno" humidity change (that was a consequence of opening the window because external humidity is different), while in previous test that I made few minutes ago humidity didn't change and that's explains the trigger.

Looking better at the rule, considering that I want to trigger it when "Bagno" humidity becomes lower than ("Sala" Humidity plus 10%), should offset be 10 or -10? If I understood correctly from rule summary it should be +10, that's correct? I feel that there is something strange around it...

I have found a problem, and am digging deeper into it. Will report back later...

Meanwhile I've added some more events logging to Alexa TTS App and I confirm that it's triggered by humidity change, not by contact opening. At least this is consistent with subscription...

@bravenel do you know if it has been fixed in 2.0.9? Thanks

I believe so, but let me know if you see a problem.

With Hubitat on 2.0.9 but rule still 2.5 it had the same behaviour, then I recreated the rule with 3.0 and now seems to be working fine.
EDIT: Seems that the issue it's still there, Alexa just spoke again..

Please show me again just what it is that you are having a problem with.

I think that the issue is in the trigger:

Expected behaviour:
Triggers only once at the first instant that
"Humidity of Temperatura Bagno" < ("Humidity of Temperatura Sala" + 10)

After that, even if "Humidity of Temperatura Bagno" changes (but still < "Humidity of Temperatura Sala" + 10), it shouldn't trigger.
Then at sometimes (when taking shower) it should become > "Humidity of Temperatura Sala" + 10).
After that, only once the first time that "Humidity of Temperatura Bagno" < ("Humidity of Temperatura Sala" + 10) it should trigger again.

Actual behaviour:
Seems that it triggers also after first time, even if "Humidity of Temperatura Bagno" changes but it's still < "Humidity of Temperatura Sala" + 10

I need to see the rule in question.

This is the complete rule (nothing on false):

It should trigger every time there is a humidity event for either sensor and the test is true, namely that Bagno < Sala+10.

Why would you think that it will only trigger once?

Because in description I have
Humidity of [Temperatura Bagno] becomes < Temperatura Sala + 10

If it's by design to trigger multiple times, I'd expect
Humidity of [Temperatura Bagno] is < Temperatura Sala + 10

BTW, to make it working only once I could just add a "Stop Rule Actions" on True after speaking message and a "Run Rule Actions" on False, that's correct?

Wording is a little misleading. However, a trigger of any sort happens on each event, not just the first. There is not a good wording possible here that captures this. "is" would not be right either, because this is event triggered, not state.

No, putting in Stop Rule Actions would not stop it from triggering multiple times.

What you want is a Rule instead of a Triggered Rule. Simply put your trigger event in as another condition, and use AND for the two conditions in the rule. This way, it will only do the actions when truth changes.

Using a rule will trigger also if the other condition (window contact open) changes (while humidity still below the limit), instead I want that it triggers only by humidity change (but only if window is open).
Maybe using only humidity ad condition and using an IF window open in True action?

This should work for you.

1 Like