Need some advice how to fix a rule that throttles sometimes.
-
I have got some warnings i reactor that a rule is throttled because it update rate is over 120/minute, happens now and when with a week or two in between.
The rule monitors my house power consumption when charging my car, and if if consumption risks to kill a main fuse, it stops the charging.
Thought I was clever when I in Constraints added that my car should be located at home and charging is active, but apparantly it wasn't clever enough...
I had understand it that if Constraints isn't true, then the triggers isn't evaluated.I have a Shelly 3EM meter that measure three channel/phases and updates every second. So just for this three channels it is 180 updates per minute...
And now when I start to take a closer look I can se in my logs that this rule is evaluated with every value change on any of the three phases...
So ~11MB of logs only goes back in time around 16 hours...So what is the best solution?
Should move my "Constraints" in an new trigger group, before my existing triggers? -
I have got some warnings i reactor that a rule is throttled because it update rate is over 120/minute, happens now and when with a week or two in between.
The rule monitors my house power consumption when charging my car, and if if consumption risks to kill a main fuse, it stops the charging.
Thought I was clever when I in Constraints added that my car should be located at home and charging is active, but apparantly it wasn't clever enough...
I had understand it that if Constraints isn't true, then the triggers isn't evaluated.I have a Shelly 3EM meter that measure three channel/phases and updates every second. So just for this three channels it is 180 updates per minute...
And now when I start to take a closer look I can se in my logs that this rule is evaluated with every value change on any of the three phases...
So ~11MB of logs only goes back in time around 16 hours...So what is the best solution?
Should move my "Constraints" in an new trigger group, before my existing triggers?@Andr said in Need some advice how to fix a rule that throttles sometimes.:
I had understand it that if Constraints isn't true, then the triggers isn't evaluated.
Nope. The triggers are evaluated first. If they are satisfied, then the constraints are examined. So that 180 updates per minute from the Shelly is what's causing the throttling.
You need to reduce the frequency of updates from the source device to the rule. Since you seem to only care about the power over a period of 10 seconds, you could use the time series features of VirtualEntityController and produce, for example, a 10-second moving average. The VEC will gobble update the individual updates from the Shelly and drive virtual sensors that advertise the moving average, per phase. Your rule can then check the average from the virtual sensors (you probably don't need sustained for at that point, because the moving average contains the time component). Depending on how "bouncy" the source power readings are, it may still update a lot, but you can tune/dampen that by playing with the precision (e.g. set
precision: -1
to round to nearest 10 watts). -
T toggledbits locked this topic on