Skip to content

Commit

Permalink
Merge pull request #209 from fboundy/patch
Browse files Browse the repository at this point in the history
Patch
  • Loading branch information
fboundy authored Apr 14, 2024
2 parents 79d05ec + cd26ddd commit 0d85a38
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PV Opt: Home Assistant Solar/Battery Optimiser v3.14.1
# PV Opt: Home Assistant Solar/Battery Optimiser v3.14.2

Solar / Battery Charging Optimisation for Home Assistant. This appDaemon application attempts to optimise charging and discharging of a home solar/battery system to minimise cost electricity cost on a daily basis using freely available solar forecast data from SolCast. This is particularly beneficial for Octopus Agile but is also benefeficial for other time-of-use tariffs such as Octopus Flux or simple Economy 7.

Expand Down
6 changes: 3 additions & 3 deletions apps/pv_opt/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pv_opt:
# Octopus account parameters
# ========================================

octopus_auto: False # Read tariffs from the Octopus Energy integration. If successful this over-rides the following parameters
# octopus_auto: False # Read tariffs from the Octopus Energy integration. If successful this over-rides the following parameters

# octopus_account: !secret octopus_account
# octopus_api_key: !secret octopus_api_key
Expand All @@ -98,8 +98,8 @@ pv_opt:
# octopus_import_tariff_code: E-1R-FLUX-IMPORT-23-02-14-G
# octopus_export_tariff_code: E-1R-FLUX-EXPORT-23-02-14-G

octopus_import_tariff_code: E-1R-GO-VAR-22-10-14-N
octopus_export_tariff_code: E-1R-OUTGOING-LITE-FIX-12M-23-09-12-N
# octopus_import_tariff_code: E-1R-GO-VAR-22-10-14-N
# octopus_export_tariff_code: E-1R-OUTGOING-LITE-FIX-12M-23-09-12-N

# ===============================================================================================================
# Brand / Integration Specific Config: SOLIS_SOLAX_MODBUS: https://github.com/wills106/homeassistant-solax-modbus
Expand Down
3 changes: 2 additions & 1 deletion apps/pv_opt/pv_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from numpy import nan
import re

VERSION = "3.14.1"
VERSION = "3.14.2"

OCTOPUS_PRODUCT_URL = r"https://api.octopus.energy/v1/products/"

Expand Down Expand Up @@ -2273,6 +2273,7 @@ def _get_hass_power_from_daily_kwh(self, entity_id, start=None, end=None, days=N
df.index = pd.to_datetime(df.index)
x = df.diff().clip(0).fillna(0).cumsum() + df.iloc[0]
x.index = x.index.round("1s")
x = x[~x.index.duplicated()]
y = -pd.concat([x.resample("1s").interpolate().resample("30min").asfreq(), x.iloc[-1:]]).diff(-1)
dt = y.index.diff().total_seconds() / pd.Timedelta("60min").total_seconds() / 1000
df = y[1:-1] / dt[2:]
Expand Down

0 comments on commit 0d85a38

Please sign in to comment.