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

days_to_retrieve default is documented wrong #195

Closed tomasbedrich closed 4 months ago

tomasbedrich commented 4 months ago

Describe the bug Default value of days_to_retrieve in HASS addon is described to be 2, while in reality it is 8.

To Reproduce Install EMHASS addon and configure it (leave days_to_retrieve default), create a new sensor.house_consumption_no_var_loads, let it collecting values for 3 days, attempt to run Perfect optim.

Expected behavior Perfect optim should pass.

Screenshots

Screenshot 2024-02-12 at 12 42 01 Screenshot 2024-02-12 at 12 41 39

Home Assistant installation type

Your hardware

EMHASS installation type

Additional context

root@5b918bf2-emhass:/usr/local/lib/python3.11/dist-packages/emhass# head -5 /usr/src/config_emhass.yaml 
# Configuration file for EMHASS

retrieve_hass_conf:
  freq: 30 # The time step to resample retrieved data from hass in minutes
  days_to_retrieve: 8 # We will retrieve data from now and up to days_to_retrieve days
davidusb-geek commented 4 months ago

You are right. It was always 2 and that's what is reflected in the documentation and it is what is logic for some forecast methods. But at some point we changed it for testing and it wrongly stayed at 8. Fixed: https://github.com/davidusb-geek/emhass/commit/f7e98416ae84e1e7989e0bd2f6b364b579a75da5

tomasbedrich commented 4 months ago

Thanks for the fix.

Perhaps there is some way to synchronize the values so that it doesn't happen again in future?

davidusb-geek commented 4 months ago

I can't come up with an easy way to synchronize these values, these are two separate config file, one from the add-on and the other with the default values. Any suggestions are welcome. Closing for now.