Consider what's the right way to create the following:
If water is detected by the moisture sensor, send a notification every five minutes while it's reading 'wet'.
It seems to be a rule because of the while 'wet' part: it's a condition that lasts for a while. The send a notification part would be set up with a repeated action in the 'condition rule is true' section. That way, the repeat will stop when/if the wet condition switches to 'dry' which is what I want. Is this correct?
But should this be a triggered rule? The trigger would be when the sensor reads 'wet'? It seems like the idea of a triggered rule is unnecessary if the trigger and the rule condition are the same. In that case the change in condition from false to true is the trigger and is already covered by the condition. So triggered rules are used to start a rule check only after some different trigger happens?
Personally, I would use HSM for something like that.
I have a trigger that fires when a moisture sensor is wet. As long as it is wet, it will repeat. But, if I only want that trigger to occur while a valve is open, then I would use a triggered rule to only alert if both the sensor is wet AND a valve is opened.
You are correct in your interpretation of a rule. It has events that cause it to be evaluated, and it maintains either a True or False state.You can set up delays or repeats to react to changes in the truth state.
A triggered rule uses a trigger to cause evaluation, so it's a momentary thing. While there is a rule component to a triggered rule, the rule part doesn't maintain a true or false state like a normal rule does because it doesn't subscribe to the rule devices. When the trigger happens, the rule is evaluated, and actions are run dependent on the True or False evaluation of the rule. It only checks the truth when the trigger happens. You can't do anything in regards to rule truth change in a triggered rule for this reason.
I have created a virtual switch that gets switched on if any of my water sensors are triggered. The only way it is switched off is manually through the web interface.
I did this because water sensors report a momentary state; there may have been a leak, momentarily, but no longer is, and I want to know about it. My water leak alerts are tied to the virtual switch.
I also have a water valve that opens & closes based on presence; somebody home/open, away/closed.
The water valve will automatically close (hopefully) on a water alert, but I do not want the valve to open again when somebody is present if the previous state was away. The virtual switch solves this for me as my RM rule check for the "global" water switch before opening. Many ways to skin the cat.
I would use a regular rule. That way you can have the repeating notifications while the rule is true and you can cancel it once it turns to false. That is if you truly want the repeating alarm. Because, a moisture sensor will continue to alarm while it's wet, even if the leak has stopped. I've always wondered why you'd want repeating alarms for something like that. Seems like something you'd want to take care of right away to me.
Because, a moisture sensor will continue to alarm while it's wet, even if the leak has stopped. I
Makes sense. But in that case, how do you control the delay between notifications? If I'm understanding correctly, a trigger that fires when 'wet' would work and send one alert. Then it would still be 'wet' so fire again and alert again and so on. So you don't need a rule. But wouldn't that trigger as fast as possible? So how do I space out the notifications so my phone doesn't fill up with water-leak messages?