I've been having issues with simple lighting triggers (based on motion) on my hub taking >2-3 minutes. I also noticed that the process of taking a backup takes like 15 minutes now.
I finally took some time to investigate and found a number of my apps have massive state sizes:
I noticed further down the list a related rule called simple "Jeremy Office Fan" also has a substantial state size of nearly 9,800, and it shows "% of busy" over over 50%. This rule is a little more complex but it's not so complex that I would expect that sort of busy time:
I'm especially confused by the state size. What "state" is being saved/stored here? I know I can adjust the state history size for devices, but I'm not finding a way to edit that for Rule Machine rules/apps.
Using changed is usually not a good idea unless it something simple like on/off, active/inactive, etc..
That aside, I think there's been acknowledgement with changed causing problems and the recommendation is inline with the best practice (until a fix is released of course). Modify changed to a threshold.
This is probably the best approach. The other option is to save the current value of the sensor to a numerical variable, and use a condition that exits the rule unless the new value is different from the current value by a reasonable delta. Say < -1.5 or > 1.5.
I also just realized this doesn't work for the other rule either. One rule just sets the numeric variables, so it really does need to run anytime they change.
If I want to capture the value of the sensor in a numeric variable: how else would I do that without having a rule set that variable anytime the sensor value changes?
I'm not sure what you mean. My recommendation to change the actions is to support changing the triggers. A wait for event is functionally the same as a trigger, it just doesn't require the rule as a whole to be triggered again (aside from being cancelled and reset if the rule triggers again). Meaning you don't need changed to catch the temp going back down to an acceptable level, the wait will handle that in the actions. So your trigger would catch the temp delta (which you can set as its own item instead of storing into variables) and you actions are there to turn the fan on to the appropriate speed, wait for the temp to come down, then turn off the fan.
Not sure if you got this figured out or not, but I had some time to mock this up. I think this single rule can replace both that you posted, does not use changed, and should still achieve what you're trying to do.
This is all under the assumption that you aren't using those variables in the first rule elsewhere.