davidusb-geek / emhass

emhass: Energy Management for Home Assistant, is a Python module designed to optimize your home energy interfacing with Home Assistant.
MIT License
260 stars 51 forks source link

Feature request: startup penalty #261

Closed werdnum closed 1 month ago

werdnum commented 2 months ago

I am using emhass to control my pool pump based on Amber electricity prices. Often, the solution EMHASS comes up with switches the pump on and off repeatedly, which is probably a bit more switching than I'd like. The pump also runs faster (2x energy consumption) for the first few minutes, which probably negates the benefit from running at 22c/kWh rather than 23c/kWh.

I think I'd like to alter the algorithm to allow specifying a penalty (in minutes or cents) for each startup. That way, the optimiser can split the usage in two if it really helps, but won't stop and start every 30 minutes when the power price fluctuates slightly over the day.

davidusb-geek commented 2 months ago

Turning on the option to make it a continuous load with just one startup is not an option for you?

werdnum commented 2 months ago

It’s an option, but not the preferred one. Starting up twice is fine, but it needs to be a big enough win to justify it.

— Andrew Garrett

On Wed, 1 May 2024 at 22:11, David @.***> wrote:

Turning on the option to make it a continuous load with just one startup is not an option for you?

— Reply to this email directly, view it on GitHub https://github.com/davidusb-geek/emhass/issues/261#issuecomment-2088380008, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACCFXSMHZOQNKASJXTAQTLZADLXTAVCNFSM6AAAAABGT3VWX6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBYGM4DAMBQHA . You are receiving this because you authored the thread.Message ID: @.***>

werdnum commented 1 month ago

I have this somewhat working in a branch. Want to clean it up before sending a PR.

davidusb-geek commented 1 month ago

Hi, ok nice feature! The annoying part will be to add a new user-defined input variable to control this. I think that by default no penalty should be applied on the number of startups. Then if the user desires as it was your case, this option can be activated. This has been a constant struggle, add parameters so that this optimization can be highly configurable, but at the same each new parameter adds more complexity and the people complain about how all this is hard to setup. But go ahead these are nice features. Try to add some lines to test_optimization.py to quickly test the desired/expected behavior of the feature.

davidusb-geek commented 1 month ago

This is included in the just released new version. Closing this for now but reopen if eneded.