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

Related deferrable load parameters defaulting #193

Closed GeoDerp closed 4 months ago

GeoDerp commented 4 months ago

There seems to be a lot of users settings parameters that should be the same amount as the derivable load and getting an error.

I had two ideas to improve this:

One: edit the utils to check each dict to see if they are the same length. If they aren't pad the dict with default (or the first item in dict) values

Two: in utils create an error log that states that there are missing values and can't continue unless you resolve them.

GeoDerp commented 4 months ago

@davidusb-geek , may be good to give this a check

davidusb-geek commented 4 months ago

So PR #194 implements the padding solution? I think that is a good solution. But I will change these defaults values:

params['optim_conf']['def_total_hours'].append(0)
params['optim_conf']['P_deferrable_nom'].append(0)

And most importantly put warning sign indicating that we are filling these with default values but the configuration should be fixed on the user side.

davidusb-geek commented 4 months ago

I think that this is done