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

Question: Trigger before schedule? #163

Closed Andoramb closed 1 year ago

Andoramb commented 1 year ago

Hi! Got a quick question for the usecase below: Is it possible to trigger before the ON schedule?

For example if there is a vacuum cleaner and it takes 1hour to clean the house. I want the ON event for Lowest price to be triggered 1hr before the actual lowest price, to optimize the charging. But the same is valid for lawnmowers or other battery operated devices.

For sure, it can be queried with Jsonata like this: $substring(payload.schedule[value=true][0].time, 11, 5), then it returns "16:00" for example, but that will have to be handled later, etc.

Just wanted to know if there is a "Pre-Trigger" oprion. It would look nice in the strategy node with "Hours on" + "Max Price" then this :)

Thanks, this is great stuff by the way! 👍

ottopaulsen commented 1 year ago

There is no such feature. What you could try is to change the prices before they are used by the strategy so prices are skewed one hour.

Andoramb commented 1 year ago

Right, thanks, good that the schedule output is so detailed, because then it's freeplay with javascript :)