Skip to content

pvpc_hourly_pricing: Request for new maintainer — integration broken since Jan 1st 2026 due to inactive code owner #166904

@mainmind83

Description

@mainmind83

The problem

The pvpc_hourly_pricing integration has been completely broken since January 1st, 2026. It fails on every data fetch with KeyError: 2026 because the underlying library [aiopvpc](https://github.com/azogue/aiopvpc) has national holidays hardcoded in a Python dictionary (_NATIONAL_EXTRA_HOLIDAYS_FOR_P3_PERIOD) that only covers years up to 2025.

This has been reported in multiple issues:

The root cause is that the code owner @azogue (who also maintains the aiopvpc library) has been inactive since 2024. No new releases of aiopvpc have been published, no PRs have been reviewed, and no issues have been responded to.

Current workarounds in the community

Several custom integrations have appeared to work around this:

  1. [HA-PVPC-Updated](https://github.com/oscarrgarciia/HA-PVPC-Updated) — Uses defaultdict(set) to prevent the KeyError. However, this means no national holidays are recognized as P3 for 2026+, so days like May 1st, October 12th, etc. are incorrectly billed at P1/P2 rates instead of P3 (valley) all day.

  2. [ha-pvpc-next](https://github.com/privatecoder/ha-pvpc-next) — A more comprehensive fork that replaces the hardcoded holidays with dynamic sources (python-holidays or CSV from seg-social.es). This is a full rewrite with many additional sensors.

Proposed solution

The fix in aiopvpc itself is trivial — change dict[year] to dict.get(year, set()) at minimum. A better long-term fix would be to replace the hardcoded dictionary with:

  • An external JSON file that users can update yearly (only the Good Friday date changes; the other 9 national holidays are fixed dates)
  • Or use the python-holidays library for Spain
  • Or fetch the calendar from an official source like seg-social.es

Request

Since the current code owner is inactive and the integration is broken for all Spanish PVPC users (which is a significant user base — Spain has ~10 million households on regulated tariffs), I'd like to request:

  1. Adoption of the integration by the HA Core team or a new volunteer maintainer
  2. A fix for the immediate KeyError — either by bumping aiopvpc with the fix, or by applying a workaround in the integration's __init__.py

I am willing to volunteer as a new code owner if needed, and have prepared a fix that loads holidays from an external JSON file (/config/pvpc_festivos_p3.json) which is user-editable and doesn't require code changes when a new year starts.

Environment

  • Home Assistant Core version: Any version since 2026.1.x
  • Affected integration: pvpc_hourly_pricing
  • Underlying library: aiopvpc 4.2.2 (latest on PyPI)
  • Impact: Integration completely non-functional since January 1st, 2026

Related


What version of Home Assistant Core has the issue?

2026.3.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

pvpc_hourly_pricing

Link to integration documentation on our website

https://www.home-assistant.io/integrations/pvpc_hourly_pricing/

Diagnostics information

No response

Example YAML snippet

Anything in the logs that might be useful for us?

Additional information

No response

Metadata

Metadata

Assignees

Type

No type

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions