Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support to retrieve configuration data directly from HA #399

Merged
merged 7 commits into from
Dec 29, 2024

Conversation

davidusb-geek
Copy link
Owner

@davidusb-geek davidusb-geek commented Dec 24, 2024

In this PR two main new features are introduced:

  1. Retrieving basic configuration data directly from Home Assistant

This will avoid the need to define some of this parameters in the secrets file.
For now implemented automatic currency and temperature units.
But in the future we could also use the imported altitude, latitude, longitude, etc.

  1. A new load forecast method based on typical household consumption

This new method will be useful to new installations as it is based on just a typical household consumption and some basic statistic methods. So a new user installing EMHASS don't need to provide data from a sensor to use the current default method which is the naive persistance.
To completely make it very easy to install we need to do something similar with the PV. A first option could be to add a on/off switch to consider a PV installation or not (as we are doing for the battery), then make the no PV installation option as the default.
With these two changes a new install needs minimal configuration and we can obtain optimization results quickly.

Copy link

codecov bot commented Dec 26, 2024

Codecov Report

Attention: Patch coverage is 88.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 66.39%. Comparing base (bcac4ce) to head (0078154).
Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
src/emhass/utils.py 88.23% 2 Missing ⚠️
src/emhass/command_line.py 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #399      +/-   ##
==========================================
+ Coverage   66.04%   66.39%   +0.34%     
==========================================
  Files           8        8              
  Lines        2904     2922      +18     
==========================================
+ Hits         1918     1940      +22     
+ Misses        986      982       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@davidusb-geek
Copy link
Owner Author

davidusb-geek commented Dec 28, 2024

Hi @GeoDerp, I've just added in this PR a new load forecast method (look at the description in the first post).
Could you please quickly check if I'm not forgetting anything? What I want to do is make this new method the default method, as it does not require any external data retrieved from HA or any other source. The hope is that this will improve the experience for new users and make it easier to setup.

I will open a second PR to implement the second part of this "make-it-easier" approach: make PV installation optional

@davidusb-geek davidusb-geek merged commit a4ca611 into master Dec 29, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant