Skip to content

Commit

Permalink
Merge pull request #288 from fboundy/patch
Browse files Browse the repository at this point in the history
3.17.1 Remove spurious logging and add to readme
  • Loading branch information
fboundy authored Nov 11, 2024
2 parents d39edf0 + d1b9878 commit 6b02220
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 41 deletions.
13 changes: 12 additions & 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.17.0
# PV Opt: Home Assistant Solar/Battery Optimiser v3.17.1

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

Expand Down Expand Up @@ -270,6 +270,7 @@ And add the `client_user` and `client_password` keys to `secrets.yaml` like this
That's it. AppDaemon is up and running. There is futher documentation for the on the [Add-on](https://github.com/hassio-addons/addon-appdaemon/blob/main/appdaemon/DOCS.md) and for [AppDaemon](https://appdaemon.readthedocs.io/en/latest/)
<h3>12. Install PV Opt from HACS</h3>
0. Make sure HACS "Enable AppDaemon apps discovery & tracking" is enabled - under integrations in HA https://hacs.xyz/docs/categories/appdaemon_apps/
Expand Down Expand Up @@ -621,6 +622,16 @@ The dashboards also depend on the following Frontend components from HACS:
- apexcharts-card
<h2> Known Issues</h2>
<h3>Docker MariaDB Cache Size</h3>
If you are using MariaDB for your database in a standalone container (ie Docker or Proxmox) rather than the Home Assistnt Add-On you may find that AppDaemon struggles to pull in enough history with the default cache settings.
MariaDB defaults to an in memory cache of 10MB. increasing `innodb_buffer_pool_size` to will allow more history to be transferred. This setting does not appear to be available in the Add-On configuration.
Full details are here: https://github.com/fboundy/pv_opt/issues/270
<h2>Development - Adding Additional Inverters: the PV Opt API</h2>
PV Opt is designed to be <i>pluggable</i>. A simple API is used to control inverters. This is defined as follows:
Expand Down
54 changes: 27 additions & 27 deletions apps/pv_opt/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,36 +119,36 @@ 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

manual_import_tariff: True
manual_import_tariff_name: Test Importe
manual_import_tariff_tz: GB
manual_import_tariff_standing: 43
manual_import_tariff_unit:
- period_start: "00:00"
price: 4.2
- period_start: "05:00"
price: 9.7
- period_start: "16:00"
price: 77.0
- period_start: "19:00"
price: -2.0

manual_export_tariff: True
manual_export_tariff_name: Test Export
manual_export_tariff_tz: GB
manual_export_tariff_unit:
- period_start: "01:00"
price: 14.2
- period_start: "03:00"
price: 19.7
- period_start: "16:00"
price: 50.0
- period_start: "14:00"
price: 0.0
# manual_import_tariff: True
# manual_import_tariff_name: Test Importe
# manual_import_tariff_tz: GB
# manual_import_tariff_standing: 43
# manual_import_tariff_unit:
# - period_start: "00:00"
# price: 4.2
# - period_start: "05:00"
# price: 9.7
# - period_start: "16:00"
# price: 77.0
# - period_start: "19:00"
# price: -2.0

# manual_export_tariff: True
# manual_export_tariff_name: Test Export
# manual_export_tariff_tz: GB
# manual_export_tariff_unit:
# - period_start: "01:00"
# price: 14.2
# - period_start: "03:00"
# price: 19.7
# - period_start: "16:00"
# price: 50.0
# - period_start: "14:00"
# price: 0.0


# The following Can be omitted if either of the above options is working correctly:
Expand Down
12 changes: 6 additions & 6 deletions 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.17.0"
VERSION = "3.17.1"


OCTOPUS_PRODUCT_URL = r"https://api.octopus.energy/v1/products/"
Expand Down Expand Up @@ -183,7 +183,7 @@
"default": 4.0,
"attributes": {
"min": 0.0,
"max": 10.0,
"max": 20.0,
"step": 0.5,
"mode": "slider",
},
Expand Down Expand Up @@ -1032,7 +1032,6 @@ def _check_tariffs(self):
self.log(
f" {direction.title()}: {tariff.name:40s} Start: {tariff.start().strftime(DATE_TIME_FORMAT_LONG)} End: {z} "
)
self.log(tariff.to_df().to_string())
if "AGILE" in tariff.name:
self.agile = True
if "INTELLI" in tariff.name:
Expand Down Expand Up @@ -1232,9 +1231,10 @@ 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 self.debug:
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
7 changes: 0 additions & 7 deletions apps/pv_opt/pvpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,6 @@ def to_df(self, start=None, end=None, **kwargs):

use_day_ahead = kwargs.get("day_ahead", ((start > time_now) or (end > time_now)))

# self.get_octopus(area=self.area, period_from=start, period_to=end)
# self.log(f">>> Name: {self.name}")
# self.log(f">>> Export: {self.export}")
# self.log(f">>> Manual: {self.manual}")
# self.log(f">>> Start: {start}")
# self.log(f">>> End: {end}")

if self.eco7:
df = pd.concat(
[pd.DataFrame(x).set_index("valid_from")["value_inc_vat"] for x in [self.day, self.night]],
Expand Down

0 comments on commit 6b02220

Please sign in to comment.