Reset Rule
-
Hi @toggledbits !!
A query, we have the possibility in the Set Reaction to run a Run Reaction and a Stop Reaction. Is it possible some way something like the Reset Rule that you have in the rules panel?
Explain better, in the rule below the Motion Rule group is already armed, because the devices have already fulfilled the rule and the estimated time of 900 secs has elapsed.
What I want to do with the Reset Rule, is to reset this counter.
Thanks!
-
@wmarcolin you could set the motion sensor to ‘pulse’ for 900 seconds. That will reset every time the 900 seconds lapses, however the only caveat is that once the pulse starts and say the motion sensor detects motion again the pulse won’t reset until the 900 seconds is over.
-
Why do you want to reset the counter? Under what conditions would you do that?
-
Ok, use case.
The rule above is to turn off the air conditioning when there is no motion or presence in the room or when my wife and I are not at home, it is not possible to turn on the air conditioning in our bedroom.
The conditions:
- Condition 1) HouseMODE must be on Day or Evening. I will add Night once the human presence sensor (FP1) works properly (another story I will tell later);
- Condition 2) AC Master On/Off, i.e., the air must be on for 5 minutes. This is to avoid turning off the AC by mistake;
- Condition 3) Motion Set, in my suite, I have motion sensors in the bedroom, bathroom, and closed room, besides a human presence sensor (still being activated);
- OR Condition 4) If I or my wife are not home, it will turn off the AC, even if there are other occupants in the room generating motion.
What is happening?
When I turn on the air conditioner on my way home (an example) to cool the room, conditions 3 and 4 are already TRUE, i.e., I have 5 minutes to be in the range of condition 4, and already have movement in the room for condition 3, to not turn off the A/C.
Or even if I am inside the house, conditions 3 TRUE and 4 FALSE, I turn on the air to cool the room. I have 5 minutes (condition 2) to generate movement in the room. If not by condition 3, the air is already turned off because it is TRUE.
This last example is a real situation. I had an accident, I am using crutches and to climb the stairs takes me more than 5 minutes. I can't turn ON the A/C, if I am at the basement of the house, when I get to the room the air is already off.
So the goal is to reset the counters when I turn on the air conditioning, to have, in my real example 15 minutes to get into the room generating a movement. Or in the first example 10 minutes to be in range of the house, and 15 to generate motion/presence.
As I explained before, this is not the case when using pulse, because the rule works correctly when passing times, and does not have to be restarted automatically. Either it becomes false by meeting conditions 3 and 4, or in the case I am requesting a reset generated by another rule.
So I thought, if we have conditions to trigger or stop an action, I thought about the possibility of resetting it, since the situation exists, we would have to increment the command to the Set Reaction.
Thanks.
-
OK, if I understand your objective correctly, I would simply include in my logic that the AC cannot be turned off it is has been on for less than 15 minutes. This would also serve to prevent short-cycling of the compressor (something near and dear to my heart; where I control AC, I also have timers to keep it from being turned on within five minutes of turning off).
There isn't a way to reset the sustained-for or delay-reset timers other than conditions themselves. That's by design. If the above doesn't seem like a workable alternative, I suggest adding a virtual switch to the logic, and when you want to reset the timer, toggle the switch off and back on. That feels a little "crafty" to me, though. I'd focus on the former suggestion, if it was my logic, because what ever controls that virtual switch, is probably just the logic that should be within the condition group itself.
-
Master, thanks for making me think a little
Well, I changed the logic a little. I unified the times - before, I had 3 timers, but now I will unify only one, and I think I will not damage to the goal of not keeping the air on in case of no presence in the environment. I already have in another rule the block to always have an interval of 5 minutes between turning on and off the A/C.
Well, if I may ask, one more item for that endless wish list; just like we have Run Reacton and Stop Reacton, maybe we should have Reset Reaction
Thanks!
-
Well... reactions aren't stateful objects, they are just lists of actions, so you don't reset them. That wouldn't mean anything.
If you mean rules... no. I give you guys plenty of rope to hang yourselves with. There are ways to get done what you need to do, I think, within the current structure of features. If I'm being completely forthcoming, giving you this "grenade without a pin" feature would encourage bad logic design, creating more odd problems that you will then ask for my assistance in troubleshooting, and my efforts will be met with hours of puzzling and frustration until the inevitable "oh wait... there's this other rule I completely forgot about that comes out of left field and resets this one" disclosure.
Nope. It's not going to happen. That's a hill I am willing to die on.
P.S. I view the similar/related request to enable/disable rules by reaction/action with the same reasoning, same outcome.
-
-
4/9