Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebuk1 committed Oct 28, 2024
2 parents 74ea911 + 838a2e8 commit 47a8608
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# PV Opt: Home Assistant Solar/Battery Optimiser v3.17.0 beta 9

# PV Opt: Home Assistant Solar/Battery Optimiser v3.17.0 beta 10


<h2>This documentation needs updating!</h2>

Expand Down
22 changes: 11 additions & 11 deletions apps/pv_opt/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -291,15 +291,15 @@ pv_opt:
# # - sensor.{device_name}_pv_power_2
id_solar_power: sensor.{device_name}_pv_total_power

alt_tariffs:
- name: Agile_Fix
octopus_import_tariff_code: E-1R-AGILE-23-12-06-G
octopus_export_tariff_code: E-1R-OUTGOING-FIX-12M-19-05-13-G

- name: Eco7_Fix
octopus_import_tariff_code: E-2R-VAR-22-11-01-G
octopus_export_tariff_code: E-1R-OUTGOING-FIX-12M-19-05-13-G
# alt_tariffs:
# - name: Agile_Fix
# octopus_import_tariff_code: E-1R-AGILE-23-12-06-G
# octopus_export_tariff_code: E-1R-OUTGOING-FIX-12M-19-05-13-G

# - name: Eco7_Fix
# octopus_import_tariff_code: E-2R-VAR-22-11-01-G
# octopus_export_tariff_code: E-1R-OUTGOING-FIX-12M-19-05-13-G

- name: Flux
octopus_import_tariff_code: E-1R-FLUX-IMPORT-23-02-14-G
octopus_export_tariff_code: E-1R-FLUX-EXPORT-23-02-14-G
# - name: Flux
# octopus_import_tariff_code: E-1R-FLUX-IMPORT-23-02-14-G
# octopus_export_tariff_code: E-1R-FLUX-EXPORT-23-02-14-G
8 changes: 5 additions & 3 deletions apps/pv_opt/pv_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@
"default": 4.0,
"attributes": {
"min": 0.0,
"max": 1.0,
"max": 10.0,
"step": 0.5,
"mode": "slider",
},
Expand Down Expand Up @@ -1376,6 +1376,9 @@ def _load_args(self, items=None):
self.yaml_config[item] = self.config[item]

elif "id_" in item:
self.log(f">>> Test: {self.entity_exists('update.home_assistant_core_update')}")
for v in values:
self.log(f">>> {item} {v} {self.entity_exists(v)}")
if min([self.entity_exists(v) for v in values]):
if len(values) == 1:
self.config[item] = values[0]
Expand Down Expand Up @@ -3314,8 +3317,7 @@ def _check_tariffs_vs_bottlecap(self):
df = pd.DataFrame(
self.get_state_retry(self.bottlecap_entities[direction], attribute=("rates"))
).set_index("start")["value_inc_vat"]
df.index = pd.to_datetime(df.index)
df.index = df.index.tz_convert("UTC")
df.index = pd.to_datetime(df.index, utc=True)
df *= 100

## SVB logging
Expand Down
2 changes: 1 addition & 1 deletion apps/pv_opt/pvpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ def _get_agile_predict(self):
return

df = pd.DataFrame(r.json()[0]["prices"]).set_index("date_time")
df.index = pd.to_datetime(df.index).tz_convert("UTC")
df.index = pd.to_datetime(df.index, utc=True)
return df["agile_pred"]

def get_day_ahead(self, start):
Expand Down

0 comments on commit 47a8608

Please sign in to comment.