Spain electricity hourly pricing (PVPC)

This sensor uses the official API to get the hourly price of electricity in Spain from

Specifically, it shows the current active energy invoicing price (FEU) in €/kWh, which is the energy term hourly price applied in the consumers’ electrical bill with a contracted power not exceeding 10 kW and which are under the PVPC (Voluntary Price for Small Consumer).

It includes the energy term of the access tolls, the charges and the production cost. It does not include taxes. The hourly prices are the same throughout the Spanish territory regardless of the time zone.

It can be set up via the integrations panel in the configuration screen.

More information available at and


To configure PVPC Hourly Pricing, you can set it up via the integrations panel in the configuration screen.

Set a name for the price sensor (default is sensor.pvpc) and select one of the three tariffs, corresponding to your contracted rate, according to the number of billing periods per day (one / peak + valley / shifted peak + valley).

  • 1 period: normal, for the “Default PVPC tariff, (2.0 A)”.
  • 2 periods: discrimination, for the “Efficiency 2 periods (2.0 DHA)”, with 10h peak interval from 11:00 UTC to 21:00 UTC.
  • 3 periods: electric_car, for the “Electric vehicle tariff (2.0 DHS)”, optimized for electric car owners to charge at night.

The default is discrimination, with 2 periods, as it is usually the cheapest one for home consumers.

You can add multiple sensors (up to 3, one per tariff) by adding them again through the integrations panel.

Advanced configuration

PVPC Hourly Pricing allows manual configuration by adding a section to your configuration.yaml.

# Set up electricity price sensors as a component:
  - name: PVPC manual ve
    tariff: electric_car
  - name: PVPC manual nocturna
    tariff: discrimination

Configuration Variables

name string Required

Custom name for the sensor.

tariff string Required, default: discrimination

Contracted electric tariff.

The sensor provides an hourly price for energy consumed, but the variable cost of energy is only one of the factors that add up to the electricity bill:

  • Fixed cost of contracted power
  • Fixed cost of energy consumed
  • Variable cost of energy consumed (the sensor’s value)
  • Other fixed expenses, such as the rental of the electric meter
  • Multiple taxes applied