Skip to content

Releases: azogue/aiopvpc

🐛 Fix unsorted prices in composed sensor 'INDEXED'

25 Mar 08:43
Compare
Choose a tag to compare
  • 🐛 Fix unsorted prices in composed sensor 'INDEXED' (#72)
  • 👷 ci: Split actions for tests on PRs and publish package on main (#72, #73, #74)
  • 👷 Remove codecov integration and produce reports instead (#71)

✨ Add new composed sensor for Indexed tariff

10 Mar 11:32
Compare
Choose a tag to compare
  • ✨ Add new price sensors: Market adjustment (from ESIOS API indicator 2108), and Indexed tariff (as composed price sensor calculated as PVPC - ADJUSTMENT), from first-time contributor @MiguelAngelLV in #69 🍻, and some adjustments in #70
  • 🎨 pre-commit updates and change to ruff + ruff-format instead of black and isort
  • 🚀 Bump minor version and update deps and CHANGELOG.md

♻️ Remove python upper limit

30 Jul 10:04
Compare
Choose a tag to compare
  • ♻️ Remove python upper limit (thanks to @cdce8p in #59)
  • 🎨 pre-commit autoupdate
  • 📦️ Bump minor version and update deps and CHANGELOG.md

Fix injection price sensor attributes (2)

29 May 10:25
Compare
Choose a tag to compare
  • 🐛 Fix one-line conditional matching for 'not None' instead of positive value 🙈
  • ✅ tests: Add unit test for price sensor attributes

Fix injection price sensor attributes

29 May 08:08
Compare
Choose a tag to compare
  • 🐛 Fix attributes 'max_price_at' and 'min_price_at' for injection price sensor (were swapped)
  • 📦️ Bump minor version and update deps
  • 📝 Fix usage example in README.md and links in CHANGELOG.md
  • 🎨 pre-commit autoupdate and swap flake8 for ruff

Adapt to 403 unauthorized error

12 Mar 17:33
Compare
Choose a tag to compare
  • 🐛 Process 403 error from server like '401 unauthorized', raising BadApiTokenAuthError to signal HA for reauth-config for both status codes, when API token is enabled (#51)

Minor fixes

11 Jan 08:05
Compare
Choose a tag to compare
  • ✏️ Fix typo on 'injection' keyword (was badly typed as spanglish 'inyection' 😅)
  • 🐛 Fix unit for price sensors attributes (from €/MWh to €/kWh)

Implement ESIOS API Token support

09 Jan 18:05
Compare
Choose a tag to compare
  • ✨ Implement support to access the extended ESIOS API with a personal token
    (you must request yours by mailing to [email protected]),
    with initial support for the existent PVPC price sensor (ESIOS indicator code: 1001), and 3 new ones 🤩:

    • Inyection price sensor (ESIOS indicator code: 1739),
      name: "Precio de la energía excedentaria del autoconsumo para el mecanismo de compensación simplificada"
    • MAG price sensor (ESIOS indicator code: 1900),
      name: "Desglose peaje por defecto 2.0TD excedente o déficit de la liquidación del mecanismo de ajuste de costes de producción"
    • OMIE price sensor (ESIOS indicator code: 10211),
      name: "Precio medio horario final suma de componentes"
  • 💥 Remove 'apidatos' support as alternative data-source, leaving only public and private paths for https://api.esios.ree.es

  • ✨ Signal bad auth for esios token calls with a custom exception, to handle 'reauth' flow in Home-Assistant

  • ✨ Add helper methods for HA integration to manage unique ids for each sensor, to update the enabled sensors to download, and to check the API token

  • ♻️ Use dataclasses for EsiosApiData and EsiosResponse data containers, instead of typed dicts

  • ✅ tests: Update fixtures for esios sensors and adapt tests to the new interface and the multiple-sensors behaviour

  • 📦️ Bump mayor version to v4 and lighten dev-env, removing pre-commit related modules and adding python-dotenv

  • 📦️ Remove holidays dependency to evaluate special days under 'P3' period and fix tests (from #46)

Changes in #46 and #47

Change data source to apidatos.ree.es

20 Dec 13:47
Compare
Choose a tag to compare

🔥 BREAKING-CHANGE: this release removes support for the old PVPC tariffs (prices < 2021-06-01), and the extra methods to use this library as a dataloader (.download_prices_for_range(...)), leaving only the code to support the HA Core integration.

Motivated by recent successful attempts to kick us out from api.esios.ree.es, we are changing the data source to another server, at apidatos.ree.es.

👏 As suggested by @lazynoda in this comment, REE has another public and documented API (REData API) with the same information as the current one, available without authentication 👌, so it may deserve a chance 🤞.

This release implements the new data-source, but also maintains the legacy one.

  • Initial configuration is set with a new data_source parameter, with the new source as default.
  • If a 403 status-code is received, the data source is switched (new to legacy / legacy to new), no retry is done (and the User-Agent loop trick is only used for the legacy data source)

Changes in #39

Decrease API refresh rate and try to avoid user-agent banning

01 Dec 20:41
Compare
Choose a tag to compare

v2.3.0 - Decrease API refresh rate and try to avoid banning (2021-12-01)

Quick-Fix motivated by the last change in the ESIOS server (on 2021-11-30 😱), which is now apparently banning HomeAssistant requests, filtering us out because of the 'User-Agent' headers data 😤 (the server is returning a 403 status code error for a PUBLIC url 🤷).

So, until future moves to authenticated endpoints, or alternative data sources, let's continue playing 🐈 and 🐁 with the ESIOS webadmins 🤣🤣

[Serious note for those webadmins]: I'm just a volunteer, and I'm an email away for contact, so please, if you are reading this, give me a call before filtering us all out 🤝🥺

Changes:

  • Substantially decrease the number of API requests to ESIOS, avoiding unnecessary calls to refresh data for the same electricity prices.
    Before, when used from the pvpc_hourly_pricing HA Core integration, the ESIOS API was called 2 times/hour from 0h to 20h, and 4 times/hour in the evening, from 20h to 0h, retrieving today + tomorrow prices.
    This makes a total of ~56 requests/day, which is not a lot 😅, but it seems the aggregated total for the HA user base (🔥 >30k requests/day just counting users pushing HA analytics) is being some kind of a problem for ESIOS,
    as it looks like they're trying to bane us 🥺😭
    Now, the API handler avoids calls to retrieve already available prices, cutting down the number of requests to just 1-2 requests/day 🤩

  • 🐛 Set standard User-Agent header info, to try to avoid server-side banning 🙈, and rotate it if banning is detected, using common User-Agent browser identifiers.

  • ♻️ Minor code refactor to prepare for future library changes, in order to move to authenticated API endpoints in future versions.