ottopaulsen / node-red-contrib-power-saver

A Node-RED node to saver money by turning off when the power is most expensive
Other
70 stars 17 forks source link

Reduction Action triggers on every hour #121

Closed shadowano closed 1 year ago

shadowano commented 1 year ago

Every hour I see that the reduction action function node is shutting down my heat box on the hour, every hour. I set this up yesterday to control my water heater.

What I see is that the hour estimate can have some wild numbers from very low negative values to very high positive numbers the first 3 minutes. The node "Collect estimate for hour" has a value of 3 in ESTIMATION_TIME_MINUTES variable. Before the buffer is filled up to get a correct hour estimate, the numbers are not close to what is should be.

image

I would expect two things to happen:

  1. The estimation doesn't go wild, but uses the average of the values collected so far.
  2. The reduction trigger doesn't fire at least until ESTIMATION_TIME_MINUTES has passed.

Solving one of them will solve the problem.

image

gulli1986 commented 1 year ago

I also experience the same, The first few minutes past every hours, some of my reduction actions are triggered which I don't think is actually necessary.

It would be good to give the system time to adjust, let's say the first 5 minutes past the hour, before any reduction actions is taken.

shadowano commented 1 year ago

@gulli1986 I see that @ottopaulsen has updated the reduction action code on powersaver.no with a configure constant for number of minutes before it takes action.

Thanks @ottopaulsen, I'll close this as solved then:)