Hi, I'm trying to achieve something that I think should be pretty common, but haven't found how to implement it without resorting to custom coding, and I'd rather not reinvent the wheel if possible. I've tried searching for it, but haven't found anything.
I control a water heater with my Node Red instance. In order to save in electricity costs, I don't want it being turned on 24/7, so I would like to toggle it on or off depending on different factors. Some of them:
- It should be always on at some hours (when electricity is cheap) and off at others
- If total instant home power exceeds some treshold, it should be turned off no matter the time
- My home has solar panels, so even if we're not on cheap electricity hours, water heater should be turned on if there's enough sun
- Manual control should also be possible
Those are a lot of different calculations, each of them end concluding if water heater should be on or off. Problem is not all of them will reach to the same conclusion (perhaps water heater should be off according to time of day, but sun is up and other node concludes it should instead be on). Managing each condition independently only leads to very fast switching between on and off due to automations "fighting" between them, so I would love some way of coordinating all conditions, taking into account different rule priorities, reaching a final, stable decision about if water heater should be on or off at a specific moment, considering everything.
Is there a standard/contrib node that lets me manage this kind of scenarios? Let's say all automations feeding it with a message including intended device state (on/off), priority and perhaps time to live, and it managing conflicts and calculating the end result.
Thanks in advance!