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 Nov 11, 2024
2 parents f5b6d00 + 6b02220 commit 7755ad7
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 39 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,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 @@ -642,6 +643,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
10 changes: 5 additions & 5 deletions apps/pv_opt/pv_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@
"default": 4.0,
"attributes": {
"min": 0.0,
"max": 10.0,
"max": 20.0,
"step": 0.5,
"mode": "slider",
},
Expand Down Expand Up @@ -1528,7 +1528,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 @@ -1730,9 +1729,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 @@ -297,13 +297,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 7755ad7

Please sign in to comment.