Git Product home page Git Product logo

agile-powerwall's Introduction

Agile Powerwall

Home Assistant Pyscript-based integration that uploads dynamic pricing to Tesla Powerwalls.

This is primarily designed to sync Octopus Agile prices to Tesla Powerwalls. It glues together two pieces of software

using

Installation

  1. Install Home Assistant Octopus Energy integration.
  2. Install Pyscript integration.
  3. Unzip the release zip into the Home Assistant directory /config.
  4. Add Pyscript app configuration:
pyscript:
    apps:
        powerwall:
            email: <username/email>
            refresh_token: <refresh_token>
            tariff_name: Agile
            tariff_provider: Octopus
            import_mpan: <mpan>
            import_tariff_breaks: [0.10, 0.20, 0.30]
            import_tariff_pricing: ["average", "average", "maximum", "maximum"]
            plunge_pricing_tariff_breaks: [0.0, 0.10, 0.30]
            plunge_pricing_tariff_pricing: ["average", "maximum", "maximum", "maximum"]
  1. Optionally, create an input_text helper called powerwall_tariff_update_status if you want to see status messages.

Configuration

email: E-mail address of your Tesla account.

refresh_token: One-off refresh token (see e.g. https://github.com/DoctorMcKay/chromium-tesla-token-generator)

tariff_name: name of the tariff.

tariff_provider: name of the tariff provider.

import_mpan: MPAN to use for import rates

export_mpan: MPAN to use for export rates if you have one

import_tariff_breaks: Powerwall currently only supports four pricing levels: Peak, Mid-Peak, Off-Peak and Super Off-Peak. Dynamic pricing therefore has to be mapped to these four levels. The import_tariff_breaks represent the thresholds for each level. So, by default, anything below £0.10 is mapped to Super Off-Peak, between £0.10 and £0.20 to Off-Peak, between £0.20 and £0.30 to Mid-peak, and above £0.30 to Peak. (You can use import_tariff_breaks: jenks to calculate optimal breaks, but this may not give optimal behaviour.)

plunge_pricing_tariff_breaks: similar to above, but applied if there are any plunge (negative) prices.

import_tariff_pricing: determines how to calculate the price of each import pricing level from the actual prices assigned to a level.

plunge_pricing_tariff_pricing: similar to above, but applied if there are any plunge (negative) prices.

export_tariff_pricing: determines how to calculate the price of each export pricing level from the actual prices assigned to a level.

import_standing_charge: sensor name or value.

export_standing_charge: sensor name or value.

schedule_type: one of:

week - current day rates are used for the week (default).

weekend - same as week, but when possible, current day rates are used for midweek/weekend and next day rates are used for weekend/midweek.

multiday - current day rates are used to span one part of the week, and next day rates are used to span the rest (not compatible with in-app editor).

maintain_history: keep previous schedules, don't calculate schedule afresh (default: false).

Computed thresholds

As well as numeric thresholds, the following computed thresholds are also supported:

lowest(num_hours): sets the threshold at the price to include the cheapest num_hours hours.

highest(num_hours): sets the threshold at the price to exclude the most expensive num_hours hours.

states(sensor_name): uses the value of the specified sensor as a threshold.

state_attr(sensor_name, attr_name): uses the value of the specified state attribute as a threshold.

e.g.:

            import_tariff_breaks: ["lowest(2)", 0.20, 0.30]

Pricing formulas

average: the average of all the prices. If the average is negative, it is set to zero.

nonNegativeAverage: the average of all the prices. If a price is negative, it is taken to be zero.

minimum: the minimum of all the prices. If the minimum is negative, it is set to zero.

maximum: the maximum of all the prices.

agile-powerwall's People

Contributors

pulquero avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

agile-powerwall's Issues

Octopus rates being downloaded - Powerwall utility rate plan not being updated

Expected Behaviour:

  1. Half-hourly rates for import and exported are downloaded from the Octopus API(s)
  2. Powerwall utility rate plan is updated with these, in-line with the pyscript powerwall app configuration
  3. A DEBUG log entry of "Powerwall updated" should be visible in the logs upon completion

Actual Behaviour:

  1. Half-hourly rates for import and exported are downloaded from the Octopus API(s)
....
27, 19, 0, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 27, 19, 30, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.18165, 'is_capped': False}, {'start': datetime.datetime(2024, 1, 27, 19, 30, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 27, 20, 0, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.1323, 'is_capped': False}, {'start': datetime.datetime(2024, 1, 27, 20, 0, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 27, 20, 30, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.146895, 'is_capped': False}, {'start': datetime.datetime(2024, 1, 27, 20, 30, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 27, 21, 0, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.1323, 'is_capped': False}, {'start': datetime.datetime(2024, 1, 27, 21, 0, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 27, 21, 30, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.14595, 'is_capped': False}, {'start': datetime.datetime(2024, 1, 27, 21, 30, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 27, 22, 0, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.12348, 'is_capped': False}, {'start': datetime.datetime(2024, 1, 27, 22, 0, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 27, 22, 30, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.1323, 'is_capped': False}, {'start': datetime.datetime(2024, 1, 27, 22, 30, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 27, 23, 0, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.12747, 'is_capped': False}]
2024-01-26 21:02:59.132 DEBUG (MainThread) [custom_components.pyscript.eval] apps.powerwall.refresh_next_day_rates: calling get_rates("1050002476215", {})
  1. Powerwall utility rates have not been updated in the Tesla app -
  2. No errors in the logs, no successful message in the logs

I have regenerated the Tesla refresh token in case this was causing a failure and validated the other information in the app configuration.

Noting the comment from Issue 1:
"One thing that comes to mind is I had issues with the release version of teslapy. I had to place a copy of head under config/pyscript_packages. I also renamed the directory from teslapy to teslapy_latest and updated the imports to teslapy_latest to guarantee that version was being used."

Originally posted by @pulquero in #1 (comment)

I was not able to determine what this referred to, I'm not a developer and so if you can be more specific about what's required, I'm happy to give it a try.

I am running the latest files and have updated the config to include export MPAN.

Import Errors on first run

Firstly thank you for your efforts - the idea of this is amazing for an Octopus/Powerwall user.

Home Assistant - Fresh install with default integrations
HACS - Fresh install

  • Octopus Energy - Fresh install, 2 devices 41 entities all working correctly
  • PyScript - Fresh install

config/configuration.yaml:

# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
pyscript: !include pyscript/config.yaml

I added an include after trying the config in the config/configuration.yaml without success

config/pyscript/config.yaml:

allow_all_imports: true #tried with and without this
hass_is_global: true #tried with and without this
apps:
  powerwall:
      email: **MYEMAIL**
      refresh_token: **MYTOKEN**
      tariff_name: Agile
      tariff_provider: Octopus
      import_mpan: **MYMPAN**
      tariff_breaks: [0.10, 0.20, 0.30]
      tariff_pricing: ["average", "average", "maximum", "maximum"]
      plunge_pricing_tariff_breaks: [0.0, 0.10, 0.30]

My errors are:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun home-assistant (no readiness notification)
s6-rc: info: service legacy-services successfully started
2024-01-25 16:54:04.318 WARNING (SyncWorker_4) [homeassistant.loader] We found a custom integration octopus_energy which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-01-25 16:54:04.318 WARNING (SyncWorker_4) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-01-25 16:54:04.318 WARNING (SyncWorker_4) [homeassistant.loader] We found a custom integration pyscript which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-01-25 16:54:07.602 ERROR (MainThread) [custom_components.pyscript.file.__init__] Exception in </config/pyscript/__init__.py> line 31:
    from .const import (
    ^
ImportError: attempted relative import with no known parent package
2024-01-25 16:54:07.603 ERROR (MainThread) [custom_components.pyscript.file.config_flow] Exception in </config/pyscript/config_flow.py> line 11:
    from .const import CONF_ALLOW_ALL_IMPORTS, CONF_HASS_IS_GLOBAL, CONF_INSTALLED_PACKAGES, DOMAIN
    ^
ImportError: attempted relative import with no known parent package
2024-01-25 16:54:07.605 ERROR (MainThread) [custom_components.pyscript.file.entity] Exception in </config/pyscript/entity.py> line 10:
        _attr_extra_state_attributes: dict
�������
^
NotImplementedError: file.entity: not implemented ast ast_annassign
2024-01-25 16:54:07.623 ERROR (MainThread) [custom_components.pyscript.file.eval] Exception in </config/pyscript/eval.py> line 22:
    from .const import (
    ^
ImportError: attempted relative import with no known parent package
2024-01-25 16:54:07.624 ERROR (MainThread) [custom_components.pyscript.file.event] Exception in </config/pyscript/event.py> line 5:
    from .const import LOGGER_PATH
    ^
ImportError: attempted relative import with no known parent package
2024-01-25 16:54:07.628 ERROR (MainThread) [custom_components.pyscript.file.function] Exception in </config/pyscript/function.py> line 9:
    from .const import LOGGER_PATH, SERVICE_RESPONSE_NONE, SERVICE_RESPONSE_ONLY
    ^
ImportError: attempted relative import with no known parent package
2024-01-25 16:54:07.630 ERROR (MainThread) [custom_components.pyscript.file.global_ctx] Exception in </config/pyscript/global_ctx.py> line 10:
    from .const import CONF_HASS_IS_GLOBAL, CONFIG_ENTRY, DOMAIN, FOLDER, LOGGER_PATH
    ^
ImportError: attempted relative import with no known parent package
2024-01-25 16:54:07.637 ERROR (MainThread) [custom_components.pyscript.file.jupyter_kernel] Exception in </config/pyscript/jupyter_kernel.py> line 22:
    from .const import LOGGER_PATH
    ^
ImportError: attempted relative import with no known parent package
2024-01-25 16:54:07.638 ERROR (MainThread) [custom_components.pyscript.file.logbook] Exception in </config/pyscript/logbook.py> line 6:
    from .const import DOMAIN
    ^
ImportError: attempted relative import with no known parent package
2024-01-25 16:54:07.639 ERROR (MainThread) [custom_components.pyscript.file.mqtt] Exception in </config/pyscript/mqtt.py> line 8:
    from .const import LOGGER_PATH
    ^
ImportError: attempted relative import with no known parent package
2024-01-25 16:54:07.641 ERROR (MainThread) [custom_components.pyscript.file.requirements] Exception in </config/pyscript/requirements.py> line 12:
    from .const import (
    ^
ImportError: attempted relative import with no known parent package
2024-01-25 16:54:07.776 ERROR (MainThread) [custom_components.pyscript.file.state] Exception in </config/pyscript/state.py> line 10:
    from .const import LOGGER_PATH
    ^
ImportError: attempted relative import with no known parent package
2024-01-25 16:54:07.790 ERROR (MainThread) [custom_components.pyscript.file.trigger] Exception in </config/pyscript/trigger.py> line 17:
    from .const import LOGGER_PATH
    ^
ImportError: attempted relative import with no known parent package

Any assistance greatly appreciated

Jenkspy fails "because it is not a valid package"

Hi Mark,

2024-01-30 18:59:01.577 DEBUG (SyncWorker_4) [custom_components.pyscript] Ignoring 'git+https://github.com/pulquero/jenkspy' because it is not a valid package
...
2024-01-30 18:59:01.693 ERROR (MainThread) [custom_components.pyscript.modules.powerwall_tariff] Exception in </config/pyscript/modules/powerwall_tariff.py> line 3:
import jenkspy
^
ModuleNotFoundError: No module named 'jenkspy'

I tried a couple of basic things just to test (like specifying the branch) but no luck.

FYI - this is within a home assistant docker container running Alpine

Exception in previous day rates - 500 Server error in API

Hi,
I experienced some quirkiness over the last few weeks and so I left HA off overnight and restarted this morning with debug on. I noted the errors below:

2024-03-19 04:50:21.217 ERROR (MainThread) [custom_components.pyscript.apps.powerwall.refresh_previous_day_rates] Exception in <apps.powerwall.refresh_previous_day_rates> line 76:
tariff_data=tariff_data
^
HTTPError: 500 Server Error: upstream internal error for url: https://owner-api.teslamotors.com/api/1/energy_sites/*************142/time_of_use_settings

It's worth saying that the utility rate plan for import appears to have updated correctly but that export has not (all show 0.00). It's logical that this might relate to the fact that HA was off overnight and therefore previous day rates is throwing an exception because it doesn't have any previous day rates but this is a complete guess on my part.

Config (unchanged since we got it all working):

allow_all_imports: true
apps:
  powerwall:
      email: "le******@******.com"
      refresh_token: "******"
      tariff_name: Tracker
      tariff_provider: Octopus
      import_mpan: "*************"
      export_mpan: "*************"
      tariff_breaks: [0.10, 0.20, 0.30]
#      tariff_breaks: jenks
      import_tariff_pricing: ["average", "average", "maximum", "maximum"]
      export_tariff_pricing: ["average", "average", "maximum", "maximum"]
      plunge_pricing_tariff_breaks: [0.0, 0.10, 0.30] 

Thanks in advance

Export rate update fails with error

Expected behaviour:

Export rates are downloaded and powerwall updated

Actual behaviour:

Process fails with error:

...
2024-01-27 19:46:44.078 DEBUG (MainThread) [custom_components.pyscript.eval] apps.powerwall.refresh_next_day_rates: calling enumerate([0.1, 0.2, 0.3], {})
2024-01-27 19:46:44.078 DEBUG (MainThread) [custom_components.pyscript.eval] apps.powerwall.refresh_next_day_rates: calling add({'start': datetime.datetime(2024, 1, 27, 18, 30, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 27, 19, 0, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.29526, 'is_capped': False}, {'start': datetime.datetime(2024, 1, 27, 18, 30, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 27, 19, 0, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.299013, 'is_capped': False}, {})
2024-01-27 19:46:44.078 DEBUG (MainThread) [custom_components.pyscript.eval] apps.powerwall.refresh_next_day_rates: calling enumerate([0.1, 0.2, 0.3], {})
2024-01-27 19:46:44.079 DEBUG (MainThread) [custom_components.pyscript.eval] apps.powerwall.refresh_next_day_rates: calling add({'start': datetime.datetime(2024, 1, 27, 19, 0, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 27, 19, 30, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.18165, 'is_capped': False}, {'start': datetime.datetime(2024, 1, 27, 19, 0, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 27, 19, 30, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.182152, 'is_capped': False}, {})
2024-01-27 19:46:44.079 DEBUG (MainThread) [custom_components.pyscript.eval] apps.powerwall.refresh_next_day_rates: calling enumerate([0.1, 0.2, 0.3], {})
2024-01-27 19:46:44.079 DEBUG (MainThread) [custom_components.pyscript.eval] apps.powerwall.refresh_next_day_rates: calling add({'start': datetime.datetime(2024, 1, 27, 19, 30, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 27, 20, 0, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.1323, 'is_capped': False}, {'start': datetime.datetime(2024, 1, 27, 19, 30, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 27, 20, 0, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.182152, 'is_capped': False}, {})
2024-01-27 19:46:44.079 DEBUG (MainThread) [custom_components.pyscript.eval] apps.powerwall.refresh_next_day_rates: calling enumerate([0.1, 0.2, 0.3], {})
2024-01-27 19:46:44.079 DEBUG (MainThread) [custom_components.pyscript.eval] apps.powerwall.refresh_next_day_rates: calling add({'start': datetime.datetime(2024, 1, 27, 20, 0, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 27, 20, 30, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.146895, 'is_capped': False}, {'start': datetime.datetime(2024, 1, 27, 20, 0, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 27, 20, 30, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.182152, 'is_capped': False}, {})
2024-01-27 19:46:44.079 DEBUG (MainThread) [custom_components.pyscript.eval] apps.powerwall.refresh_next_day_rates: calling enumerate([0.1, 0.2, 0.3], {})
2024-01-27 19:46:44.079 DEBUG (MainThread) [custom_components.pyscript.eval] apps.powerwall.refresh_next_day_rates: calling add({'start': datetime.datetime(2024, 1, 27, 20, 30, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 27, 21, 0, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.1323, 'is_capped': False}, {'start': datetime.datetime(2024, 1, 27, 20, 30, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 27, 21, 0, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.182152, 'is_capped': False}, {})
2024-01-27 19:46:44.079 DEBUG (MainThread) [custom_components.pyscript.eval] apps.powerwall.refresh_next_day_rates: calling enumerate([0.1, 0.2, 0.3], {})
2024-01-27 19:46:44.079 DEBUG (MainThread) [custom_components.pyscript.eval] apps.powerwall.refresh_next_day_rates: calling add({'start': datetime.datetime(2024, 1, 27, 21, 0, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 27, 21, 30, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.14595, 'is_capped': False}, {'start': datetime.datetime(2024, 1, 27, 21, 0, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 27, 21, 30, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.182152, 'is_capped': False}, {})
2024-01-27 19:46:44.079 DEBUG (MainThread) [custom_components.pyscript.eval] apps.powerwall.refresh_next_day_rates: calling enumerate([0.1, 0.2, 0.3], {})
2024-01-27 19:46:44.079 DEBUG (MainThread) [custom_components.pyscript.eval] apps.powerwall.refresh_next_day_rates: calling add({'start': datetime.datetime(2024, 1, 27, 21, 30, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 27, 22, 0, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.12348, 'is_capped': False}, {'start': datetime.datetime(2024, 1, 27, 21, 30, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 27, 22, 0, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.182152, 'is_capped': False}, {})
2024-01-27 19:46:44.080 DEBUG (MainThread) [custom_components.pyscript.eval] apps.powerwall.refresh_next_day_rates: calling enumerate([0.1, 0.2, 0.3], {})
2024-01-27 19:46:44.080 DEBUG (MainThread) [custom_components.pyscript.eval] apps.powerwall.refresh_next_day_rates: calling add({'start': datetime.datetime(2024, 1, 27, 22, 0, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 27, 22, 30, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.1323, 'is_capped': False}, {'start': datetime.datetime(2024, 1, 27, 22, 0, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 27, 22, 30, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.182152, 'is_capped': False}, {})
2024-01-27 19:46:44.080 DEBUG (MainThread) [custom_components.pyscript.eval] apps.powerwall.refresh_next_day_rates: calling enumerate([0.1, 0.2, 0.3], {})
2024-01-27 19:46:44.080 DEBUG (MainThread) [custom_components.pyscript.eval] apps.powerwall.refresh_next_day_rates: calling add({'start': datetime.datetime(2024, 1, 27, 22, 30, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 27, 23, 0, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.12747, 'is_capped': False}, {'start': datetime.datetime(2024, 1, 27, 22, 30, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 27, 23, 0, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.182152, 'is_capped': False}, {})
2024-01-27 19:46:44.080 DEBUG (MainThread) [custom_components.pyscript.eval] apps.powerwall.refresh_next_day_rates: calling enumerate([0.1, 0.2, 0.3], {})
2024-01-27 19:46:44.080 DEBUG (MainThread) [custom_components.pyscript.eval] apps.powerwall.refresh_next_day_rates: calling add({'start': datetime.datetime(2024, 1, 27, 23, 0, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 27, 23, 30, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.125685, 'is_capped': False}, {'start': datetime.datetime(2024, 1, 27, 23, 0, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 27, 23, 30, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.182152, 'is_capped': False}, {})
2024-01-27 19:46:44.080 DEBUG (MainThread) [custom_components.pyscript.eval] apps.powerwall.refresh_next_day_rates: calling enumerate([0.1, 0.2, 0.3], {})
2024-01-27 19:46:44.080 DEBUG (MainThread) [custom_components.pyscript.eval] apps.powerwall.refresh_next_day_rates: calling add({'start': datetime.datetime(2024, 1, 27, 23, 30, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 28, 0, 0, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.09702, 'is_capped': False}, {'start': datetime.datetime(2024, 1, 27, 23, 30, tzinfo=datetime.timezone.utc), 'end': datetime.datetime(2024, 1, 28, 0, 0, tzinfo=datetime.timezone.utc), 'value_inc_vat': 0.182152, 'is_capped': False}, {})
2024-01-27 19:46:44.080 ERROR (MainThread) [custom_components.pyscript.apps.powerwall.refresh_next_day_rates] Exception in <apps.powerwall.refresh_next_day_rates> line 79:
                self.export_pricing.add(export_rate["value_inc_var"])
                                                    ^
KeyError: 'value_inc_var'

Removing the export_mpan from the config allows the import process to run as normal.

Note:
From the looks of things, looks like import data is from 00:00 to 23:00 but export data is from 00:00 to 24:00. For now, remove the export_mpan to see if the rest works and i'll work on a fix for exports.

Originally posted by @pulquero in #2 (comment)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.