Skip to content

Commit

Permalink
Merge pull request #9 from TheGabeMan/BasicHouseUsage
Browse files Browse the repository at this point in the history
Basic House Usage toegevoegd
  • Loading branch information
TheGabeMan authored Apr 21, 2023
2 parents 7a7b148 + 5e8cdde commit b9872b2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ This project makes use of the following other projects:
- [Forecast.Solar by Knut Kohl](https://forecast.solar/) Though the use of his API is for free, please reward the maker by signing up for the 'personal' plan or use the 'buy me a coffee' button on the website.


# Breaking changes
# Changes
- March 22nd, 2023: Added TIMEZONE=Europe/Amsterdam to the .env, you should add this as well (with your timezone) to prevent the script from failing.
- April 21st, 2023: Added TMPIMAGEPATH=/home/OptimalEnergyUser to the .env. This points to the temp directory for the image generated. If not specified it will use the directory of the script.
- April 21st, 2023: Show the BASICHOUSEUSAGEWATT (Basic House Usage in WATT) in the image as third graph
3 changes: 2 additions & 1 deletion example.env
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ DEC=25
AZI=40
KWP=4.4
TIMEZONE=Europe/Amsterdam
TMPIMAGEPATH=/home/OptimalEnergyUser
TMPIMAGEPATH=/home/OptimalEnergyUser
BASICHOUSEUSAGEWATT=400
2 changes: 0 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ def main():
image_name = tmp_image_path + "{}{:-%Y%m%d%H%M%S}.jpeg".format(
str(uuid.uuid4().hex), datetime.datetime.now()
)
print( tmp_image_path)
print( image_name )
plt.savefig(image_name, format="png", dpi=300)

# Send to Telegram
Expand Down
6 changes: 6 additions & 0 deletions plotgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
def create_plot(combined_list):
"""Generate the data for the Graph"""
forecast_kwp = float(os.getenv("KWP")) * 1000
if float( os.getenv("BASICHOUSEUSAGEWATT")) > 0:
basic_house_usage = float(os.getenv("BASICHOUSEUSAGEWATT"))
else:
basic_house_usage = 0

rows = len(combined_list)
prices = combined_list[0 : rows + 1, 1:2]
Expand Down Expand Up @@ -38,6 +42,8 @@ def create_plot(combined_list):
ax2.set_ylim(ymax=forecast_kwp, ymin=0)
ax2.legend()

plt.axhline(basic_house_usage,xmin=0, xmax=forecast_kwp, color="orange" )
ax2.plot(basic_house_usage, color="orange", label="Basic House Usage in Watt")
plt.title("Forecast for " + forecastdate)
plt.legend(loc="upper left")

Expand Down

0 comments on commit b9872b2

Please sign in to comment.