Repository: azogue/aiopvpc (language: python)

Issue:
Nueva tarifa a partir del 1 de junio
Hola @azogue !

Te escribo en castellano que nos entendemos mejor 😉

Te quería preguntar sobre el cambio de tarifas que nos viene el primer día de junio. Habrá una sola tarifa con discriminación horaria en vez de tres. ¿La librería se comportará bien? Supongo que si no se ha podido probar será difícil saberlo. Bueno, estaremos pendientes. Sí necesitas ayuda en algo me ofrezco voluntario.

Saludos!


Discussion / hints:
Hola @r-jordan!

Estoy al tanto del cambio a la 2.0TD en menos de una semana, pero ando bastante perdido de cómo van a hacer los cambios en la API de Esios...

Ahora mismo la librería simplemente accede a un archivo JSON específico (y de libre acceso), y extrae los precios de las 24h... no sé si los nuevos precios se publicarán en la misma ruta (https://api.esios.ree.es/archives/70/download) o en otra nueva, pero entiendo q tendrá una estructura diferente, así que

> ¿La librería se comportará bien?

No creo 😔

La clave será **encontrar la ruta pública** de https://api.esios.ree.es donde figuren los nuevos precios, luego **adaptar la librería** y publicar una nueva versión, y finalmente **hacer cambios en la integración de HA Core** para adaptar el sensor, por lo que supongo que pasaremos algún tiempo sin los precios de la luz en HA 😢

Por mi parte, es mi intención adaptar la librería y el módulo de HA, pero no sé qué tiempo me llevará, ya que no dispongo de mucho tiempo libre últimamente 🥺

> Bueno, estaremos pendientes. Sí necesitas ayuda en algo me ofrezco voluntario.

Si te enteras de esa **URL pública con los precios**, pásamela 👍, en cuanto tengamos eso yo creo q el resto no será complicado...
Hola  Eugenio,

Por eso decía que la respuesta a la pregunta era difícil ya que no hay información por parte de REE sobre como afectará el cambio de tarifas en la API. He buscado pero no he encontrado nada :confused:

He investigado la estructura de los datos recuperados en la ruta que has compartido y veo que hay tres campos que supongo corresponden con los precios de cada tarifa: GEN, NOC y VHC. Entiendo que son los que se recuperan como datos por la librería después de dividir entre 1000 porque están en €/MWh:

{"Dia":"25/05/2021","Hora":"00-01","GEN":"154,24","NOC":"103,45","VHC":"109,28",...}

Se me ocurre :bulb: que al cambiar las tres tarifas a una sola y suponiendo que la nueva tarifa se identifique con el mismo campo "GEN" de general no habría que hacer nada para que siguiera funcionando los que tengan tarifa la tarifa general o normal. Los que tengan las otras dos tarifas, nocturna o vehículo eléctrico, simplemente tendrían que volver a dar de alta la integración en HA con la tarifa normal.

Si mis suposiciones son correctas no estaremos mucho tiempo sin datos :wink:  Veremos a ver. Estaremos atentos.

¡Gracias por todo!

Saludos
Hola @r-jordan,

> Se me ocurre 💡 que al cambiar las tres tarifas a una sola y suponiendo que la nueva tarifa se identifique con el mismo campo "GEN" de general no habría que hacer nada para que siguiera funcionando los que tengan tarifa la tarifa general o normal.

Que ocurriese eso 🦄 _sería ideal_ 🌈, que el día 1 de junio la url https://api.esios.ree.es/archives/70/download?date=2021-06-01 devolviese un JSON como el anterior 🙈, y tal vez hasta sea así 😅, pero entiendo q no todo va a ser tan cuesta abajo...

En cualquier caso, con la excusa de que llega la 2.0TD, sí me gustaría meterle algún cambio más al módulo, más allá de hacerlo funcionar, claro. 

Con el follón que se va a formar con los tramos de energía y potencia puede ser un buen momento para meterle más _features_, tratar de enlazar con los `utility_meter` de HomeAssistant, etc. También están pendientes los precios de vertido a la red para los que tienen paneles, pero es algo q no he encontrado en una url pública todavía (la idea de la integración en HA es q no necesite un token de ESIOS para funcionar!)

Si se te ocurre alguna cosa más...
Hola @azogue ,

Sobre propuestas de mejora se me ocurre añadir atributos bastante lógicos teniendo en cuenta los que ya hay:

- Precio medio del día (media aritmética)
- Precio máximo y hora del precio máximo

Yo tengo programados en HA con jinja2 sensores de tipo template más "complicados" que me ayudan a programar los automatismos:

- Número de orden del precio: Lo que hago es asignar un número correlativo a cada precio desde 0 a 23 ordenando los precios de menor a mayor. Este es muy útil ya que de esta forma si quiero que un aparato esté encendido las 3 horas más baratas de cada día programo una automatización para que se encienda cuando este valor baje de 3 y que se apague cuando suba de 2.
- Número de horas hasta que el precio baje respecto del actual (y un atributo con el % de bajada)
- Número de horas hasta que el precio suba respecto del actual (y un atributo con el % de subida)

Sobre la integración con el utility meter no veo como hacerlo ya que este lo que hace es medir el consumo en distintas tarifas pero con el PVPC hay una tarifa diferente para cada hora... es complicado. Habría que hacer un nuevo sensor que recoja los datos del sensor de PVPC y de un sensor de energía (kwh) y calcule el precio total para un periodo de tiempo (día, semana, mes).

Creo que suficiente por hoy ... ;-D

Hola @azogue @r-jordan.

Ya han salido las nuevas tarifas. La url parece la misma pero habría que cambiar el literal "GEN", "NOC", "VHC" por "PCB" (Peninsula, Canarias Baleares) o "CYM" (Ceuta y Melilla).

Un saludo.
Hola @jjprz, sí, acabo de verlo, en la misma ruta han colgado esto:

```json
{
  "PVPC": [
    {
      "Dia": "01/06/2021",
      "Hora": "00-01",
      "PCB": "116,33",
      "CYM": "116,33",
      "COF2TD": "0,000088075182000000",
      "PMHPCB": "104,00",
      "PMHCYM": "104,00",
      "SAHPCB": "3,56",
      "SAHCYM": "3,56",
      "FOMPCB": "0,03",
      "FOMCYM": "0,03",
      "FOSPCB": "0,17",
      "FOSCYM": "0,17",
      "INTPCB": "0,00",
      "INTCYM": "0,00",
      "PCAPPCB": "0,00",
      "PCAPCYM": "0,00",
      "TEUPCB": "6,00",
      "TEUCYM": "6,00",
      "CCVPCB": "2,57",
      "CCVCYM": "2,57",
      "EDSRPCB": "0,00",
      "EDSRCYM": "0,00"
    },
    {
      "Dia": "01/06/2021",
      "Hora": "01-02",
      "PCB": "115,95",
      "CYM": "115,95",
      "COF2TD": "0,000073094842000000",
      "PMHPCB": "103,18",
      "PMHCYM": "103,18",
      "SAHPCB": "3,99",
      "SAHCYM": "3,99",
      "FOMPCB": "0,03",
      "FOMCYM": "0,03",
      "FOSPCB": "0,17",
      "FOSCYM": "0,17",
      "INTPCB": "0,00",
      "INTCYM": "0,00",
      "PCAPPCB": "0,00",
      "PCAPCYM": "0,00",
      "TEUPCB": "6,00",
      "TEUCYM": "6,00",
      "CCVPCB": "2,58",
      "CCVCYM": "2,58",
      "EDSRPCB": "0,00",
      "EDSRCYM": "0,00"
    },
    {
      "Dia": "01/06/2021",
      "Hora": "02-03",
      "PCB": "114,89",
      "CYM": "114,89",
      "COF2TD": "0,000065114032000000",
      "PMHPCB": "101,87",
      "PMHCYM": "101,87",
      "SAHPCB": "4,25",
      "SAHCYM": "4,25",
      "FOMPCB": "0,03",
      "FOMCYM": "0,03",
      "FOSPCB": "0,17",
      "FOSCYM": "0,17",
      "INTPCB": "0,00",
      "INTCYM": "0,00",
      "PCAPPCB": "0,00",
      "PCAPCYM": "0,00",
      "TEUPCB": "6,00",
      "TEUCYM": "6,00",
      "CCVPCB": "2,56",
      "CCVCYM": "2,56",
      "EDSRPCB": "0,00",
      "EDSRCYM": "0,00"
    },
    {
      "Dia": "01/06/2021",
      "Hora": "03-04",
      "PCB": "114,96",
      "CYM": "114,96",
      "COF2TD": "0,000061272596000000",
      "PMHPCB": "102,01",
      "PMHCYM": "102,01",
      "SAHPCB": "4,19",
      "SAHCYM": "4,19",
      "FOMPCB": "0,03",
      "FOMCYM": "0,03",
      "FOSPCB": "0,17",
      "FOSCYM": "0,17",
      "INTPCB": "0,00",
      "INTCYM": "0,00",
      "PCAPPCB": "0,00",
      "PCAPCYM": "0,00",
      "TEUPCB": "6,00",
      "TEUCYM": "6,00",
      "CCVPCB": "2,57",
      "CCVCYM": "2,57",
      "EDSRPCB": "0,00",
      "EDSRCYM": "0,00"
    },
    {
      "Dia": "01/06/2021",
      "Hora": "04-05",
      "PCB": "114,84",
      "CYM": "114,84",
      "COF2TD": "0,000059563056000000",
      "PMHPCB": "101,87",
      "PMHCYM": "101,87",
      "SAHPCB": "4,21",
      "SAHCYM": "4,21",
      "FOMPCB": "0,03",
      "FOMCYM": "0,03",
      "FOSPCB": "0,17",
      "FOSCYM": "0,17",
      "INTPCB": "0,00",
      "INTCYM": "0,00",
      "PCAPPCB": "0,00",
      "PCAPCYM": "0,00",
      "TEUPCB": "6,00",
      "TEUCYM": "6,00",
      "CCVPCB": "2,56",
      "CCVCYM": "2,56",
      "EDSRPCB": "0,00",
      "EDSRCYM": "0,00"
    },
    {
      "Dia": "01/06/2021",
      "Hora": "05-06",
      "PCB": "116,03",
      "CYM": "116,03",
      "COF2TD": "0,000059907686000000",
      "PMHPCB": "103,14",
      "PMHCYM": "103,14",
      "SAHPCB": "4,11",
      "SAHCYM": "4,11",
      "FOMPCB": "0,03",
      "FOMCYM": "0,03",
      "FOSPCB": "0,17",
      "FOSCYM": "0,17",
      "INTPCB": "0,00",
      "INTCYM": "0,00",
      "PCAPPCB": "0,00",
      "PCAPCYM": "0,00",
      "TEUPCB": "6,00",
      "TEUCYM": "6,00",
      "CCVPCB": "2,58",
      "CCVCYM": "2,58",
      "EDSRPCB": "0,00",
      "EDSRCYM": "0,00"
    },
    {
      "Dia": "01/06/2021",
      "Hora": "06-07",
      "PCB": "116,29",
      "CYM": "116,29",
      "COF2TD": "0,000062818713000000",
      "PMHPCB": "103,64",
      "PMHCYM": "103,64",
      "SAHPCB": "3,88",
      "SAHCYM": "3,88",
      "FOMPCB": "0,03",
      "FOMCYM": "0,03",
      "FOSPCB": "0,17",
      "FOSCYM": "0,17",
      "INTPCB": "0,00",
      "INTCYM": "0,00",
      "PCAPPCB": "0,00",
      "PCAPCYM": "0,00",
      "TEUPCB": "6,00",
      "TEUCYM": "6,00",
      "CCVPCB": "2,57",
      "CCVCYM": "2,57",
      "EDSRPCB": "0,00",
      "EDSRCYM": "0,00"
    },
    {
      "Dia": "01/06/2021",
      "Hora": "07-08",
      "PCB": "115,70",
      "CYM": "115,70",
      "COF2TD": "0,000072575564000000",
      "PMHPCB": "103,85",
      "PMHCYM": "103,85",
      "SAHPCB": "3,10",
      "SAHCYM": "3,10",
      "FOMPCB": "0,03",
      "FOMCYM": "0,03",
      "FOSPCB": "0,16",
      "FOSCYM": "0,16",
      "INTPCB": "0,00",
      "INTCYM": "0,00",
      "PCAPPCB": "0,00",
      "PCAPCYM": "0,00",
      "TEUPCB": "6,00",
      "TEUCYM": "6,00",
      "CCVPCB": "2,55",
      "CCVCYM": "2,55",
      "EDSRPCB": "0,00",
      "EDSRCYM": "0,00"
    },
    {
      "Dia": "01/06/2021",
      "Hora": "08-09",
      "PCB": "152,89",
      "CYM": "152,89",
      "COF2TD": "0,000086825264000000",
      "PMHPCB": "105,65",
      "PMHCYM": "105,65",
      "SAHPCB": "2,36",
      "SAHCYM": "2,36",
      "FOMPCB": "0,03",
      "FOMCYM": "0,03",
      "FOSPCB": "0,17",
      "FOSCYM": "0,17",
      "INTPCB": "0,00",
      "INTCYM": "0,00",
      "PCAPPCB": "0,34",
      "PCAPCYM": "0,34",
      "TEUPCB": "41,77",
      "TEUCYM": "41,77",
      "CCVPCB": "2,57",
      "CCVCYM": "2,57",
      "EDSRPCB": "0,00",
      "EDSRCYM": "0,00"
    },
    {
      "Dia": "01/06/2021",
      "Hora": "09-10",
      "PCB": "150,83",
      "CYM": "150,83",
      "COF2TD": "0,000095768317000000",
      "PMHPCB": "103,77",
      "PMHCYM": "103,77",
      "SAHPCB": "2,24",
      "SAHCYM": "2,24",
      "FOMPCB": "0,03",
      "FOMCYM": "0,03",
      "FOSPCB": "0,16",
      "FOSCYM": "0,16",
      "INTPCB": "0,00",
      "INTCYM": "0,00",
      "PCAPPCB": "0,34",
      "PCAPCYM": "0,34",
      "TEUPCB": "41,77",
      "TEUCYM": "41,77",
      "CCVPCB": "2,53",
      "CCVCYM": "2,53",
      "EDSRPCB": "0,00",
      "EDSRCYM": "0,00"
    },
    {
      "Dia": "01/06/2021",
      "Hora": "10-11",
      "PCB": "242,62",
      "CYM": "149,28",
      "COF2TD": "0,000102672431000000",
      "PMHPCB": "102,38",
      "PMHCYM": "102,11",
      "SAHPCB": "2,38",
      "SAHCYM": "2,37",
      "FOMPCB": "0,03",
      "FOMCYM": "0,03",
      "FOSPCB": "0,16",
      "FOSCYM": "0,16",
      "INTPCB": "0,00",
      "INTCYM": "0,00",
      "PCAPPCB": "2,01",
      "PCAPCYM": "0,34",
      "TEUPCB": "133,12",
      "TEUCYM": "41,77",
      "CCVPCB": "2,54",
      "CCVCYM": "2,51",
      "EDSRPCB": "0,00",
      "EDSRCYM": "0,00"
    },
    {
      "Dia": "01/06/2021",
      "Hora": "11-12",
      "PCB": "240,50",
      "CYM": "240,50",
      "COF2TD": "0,000105691470000000",
      "PMHPCB": "100,14",
      "PMHCYM": "100,14",
      "SAHPCB": "2,52",
      "SAHCYM": "2,52",
      "FOMPCB": "0,03",
      "FOMCYM": "0,03",
      "FOSPCB": "0,16",
      "FOSCYM": "0,16",
      "INTPCB": "0,00",
      "INTCYM": "0,00",
      "PCAPPCB": "2,02",
      "PCAPCYM": "2,02",
      "TEUPCB": "133,12",
      "TEUCYM": "133,12",
      "CCVPCB": "2,51",
      "CCVCYM": "2,51",
      "EDSRPCB": "0,00",
      "EDSRCYM": "0,00"
    },
    {
      "Dia": "01/06/2021",
      "Hora": "12-13",
      "PCB": "238,09",
      "CYM": "238,09",
      "COF2TD": "0,000110462952000000",
      "PMHPCB": "97,58",
      "PMHCYM": "97,58",
      "SAHPCB": "2,71",
      "SAHCYM": "2,71",
      "FOMPCB": "0,03",
      "FOMCYM": "0,03",
      "FOSPCB": "0,16",
      "FOSCYM": "0,16",
      "INTPCB": "0,00",
      "INTCYM": "0,00",
      "PCAPPCB": "2,02",
      "PCAPCYM": "2,02",
      "TEUPCB": "133,12",
      "TEUCYM": "133,12",
      "CCVPCB": "2,47",
      "CCVCYM": "2,47",
      "EDSRPCB": "0,00",
      "EDSRCYM": "0,00"
    },
    {
      "Dia": "01/06/2021",
      "Hora": "13-14",
      "PCB": "235,30",
      "CYM": "235,30",
      "COF2TD": "0,000119052052000000",
      "PMHPCB": "94,65",
      "PMHCYM": "94,65",
      "SAHPCB": "2,89",
      "SAHCYM": "2,89",
      "FOMPCB": "0,03",
      "FOMCYM": "0,03",
      "FOSPCB": "0,16",
      "FOSCYM": "0,16",
      "INTPCB": "0,00",
      "INTCYM": "0,00",
      "PCAPPCB": "2,02",
      "PCAPCYM": "2,02",
      "TEUPCB": "133,12",
      "TEUCYM": "133,12",
      "CCVPCB": "2,43",
      "CCVCYM": "2,43",
      "EDSRPCB": "0,00",
      "EDSRCYM": "0,00"
    },
    {
      "Dia": "01/06/2021",
      "Hora": "14-15",
      "PCB": "137,96",
      "CYM": "231,28",
      "COF2TD": "0,000117990009000000",
      "PMHPCB": "89,95",
      "PMHCYM": "90,19",
      "SAHPCB": "3,37",
      "SAHCYM": "3,38",
      "FOMPCB": "0,03",
      "FOMCYM": "0,03",
      "FOSPCB": "0,16",
      "FOSCYM": "0,16",
      "INTPCB": "0,00",
      "INTCYM": "0,00",
      "PCAPPCB": "0,34",
      "PCAPCYM": "2,03",
      "TEUPCB": "41,77",
      "TEUCYM": "133,12",
      "CCVPCB": "2,34",
      "CCVCYM": "2,37",
      "EDSRPCB": "0,00",
      "EDSRCYM": "0,00"
    },
    {
      "Dia": "01/06/2021",
      "Hora": "15-16",
      "PCB": "132,88",
      "CYM": "132,88",
      "COF2TD": "0,000108598330000000",
      "PMHPCB": "84,43",
      "PMHCYM": "84,43",
      "SAHPCB": "3,89",
      "SAHCYM": "3,89",
      "FOMPCB": "0,03",
      "FOMCYM": "0,03",
      "FOSPCB": "0,16",
      "FOSCYM": "0,16",
      "INTPCB": "0,00",
      "INTCYM": "0,00",
      "PCAPPCB": "0,34",
      "PCAPCYM": "0,34",
      "TEUPCB": "41,77",
      "TEUCYM": "41,77",
      "CCVPCB": "2,26",
      "CCVCYM": "2,26",
      "EDSRPCB": "0,00",
      "EDSRCYM": "0,00"
    },
    {
      "Dia": "01/06/2021",
      "Hora": "16-17",
      "PCB": "131,93",
      "CYM": "131,93",
      "COF2TD": "0,000104114191000000",
      "PMHPCB": "83,66",
      "PMHCYM": "83,66",
      "SAHPCB": "3,73",
      "SAHCYM": "3,73",
      "FOMPCB": "0,03",
      "FOMCYM": "0,03",
      "FOSPCB": "0,16",
      "FOSCYM": "0,16",
      "INTPCB": "0,00",
      "INTCYM": "0,00",
      "PCAPPCB": "0,34",
      "PCAPCYM": "0,34",
      "TEUPCB": "41,77",
      "TEUCYM": "41,77",
      "CCVPCB": "2,25",
      "CCVCYM": "2,25",
      "EDSRPCB": "0,00",
      "EDSRCYM": "0,00"
    },
    {
      "Dia": "01/06/2021",
      "Hora": "17-18",
      "PCB": "135,99",
      "CYM": "135,99",
      "COF2TD": "0,000105171071000000",
      "PMHPCB": "88,07",
      "PMHCYM": "88,07",
      "SAHPCB": "3,31",
      "SAHCYM": "3,31",
      "FOMPCB": "0,03",
      "FOMCYM": "0,03",
      "FOSPCB": "0,16",
      "FOSCYM": "0,16",
      "INTPCB": "0,00",
      "INTCYM": "0,00",
      "PCAPPCB": "0,34",
      "PCAPCYM": "0,34",
      "TEUPCB": "41,77",
      "TEUCYM": "41,77",
      "CCVPCB": "2,31",
      "CCVCYM": "2,31",
      "EDSRPCB": "0,00",
      "EDSRCYM": "0,00"
    },
    {
      "Dia": "01/06/2021",
      "Hora": "18-19",
      "PCB": "231,44",
      "CYM": "138,13",
      "COF2TD": "0,000106417649000000",
      "PMHPCB": "90,57",
      "PMHCYM": "90,33",
      "SAHPCB": "3,16",
      "SAHCYM": "3,15",
      "FOMPCB": "0,03",
      "FOMCYM": "0,03",
      "FOSPCB": "0,16",
      "FOSCYM": "0,16",
      "INTPCB": "0,00",
      "INTCYM": "0,00",
      "PCAPPCB": "2,02",
      "PCAPCYM": "0,34",
      "TEUPCB": "133,12",
      "TEUCYM": "41,77",
      "CCVPCB": "2,37",
      "CCVCYM": "2,34",
      "EDSRPCB": "0,00",
      "EDSRCYM": "0,00"
    },
    {
      "Dia": "01/06/2021",
      "Hora": "19-20",
      "PCB": "240,40",
      "CYM": "240,40",
      "COF2TD": "0,000108017615000000",
      "PMHPCB": "99,53",
      "PMHCYM": "99,53",
      "SAHPCB": "3,00",
      "SAHCYM": "3,00",
      "FOMPCB": "0,03",
      "FOMCYM": "0,03",
      "FOSPCB": "0,17",
      "FOSCYM": "0,17",
      "INTPCB": "0,00",
      "INTCYM": "0,00",
      "PCAPPCB": "2,04",
      "PCAPCYM": "2,04",
      "TEUPCB": "133,12",
      "TEUCYM": "133,12",
      "CCVPCB": "2,52",
      "CCVCYM": "2,52",
      "EDSRPCB": "0,00",
      "EDSRCYM": "0,00"
    },
    {
      "Dia": "01/06/2021",
      "Hora": "20-21",
      "PCB": "246,20",
      "CYM": "246,20",
      "COF2TD": "0,000114631042000000",
      "PMHPCB": "104,32",
      "PMHCYM": "104,32",
      "SAHPCB": "3,90",
      "SAHCYM": "3,90",
      "FOMPCB": "0,03",
      "FOMCYM": "0,03",
      "FOSPCB": "0,17",
      "FOSCYM": "0,17",
      "INTPCB": "0,00",
      "INTCYM": "0,00",
      "PCAPPCB": "2,05",
      "PCAPCYM": "2,05",
      "TEUPCB": "133,12",
      "TEUCYM": "133,12",
      "CCVPCB": "2,61",
      "CCVCYM": "2,61",
      "EDSRPCB": "0,00",
      "EDSRCYM": "0,00"
    },
    {
      "Dia": "01/06/2021",
      "Hora": "21-22",
      "PCB": "248,08",
      "CYM": "248,08",
      "COF2TD": "0,000127585671000000",
      "PMHPCB": "107,28",
      "PMHCYM": "107,28",
      "SAHPCB": "2,78",
      "SAHCYM": "2,78",
      "FOMPCB": "0,03",
      "FOMCYM": "0,03",
      "FOSPCB": "0,17",
      "FOSCYM": "0,17",
      "INTPCB": "0,00",
      "INTCYM": "0,00",
      "PCAPPCB": "2,06",
      "PCAPCYM": "2,06",
      "TEUPCB": "133,12",
      "TEUCYM": "133,12",
      "CCVPCB": "2,64",
      "CCVCYM": "2,64",
      "EDSRPCB": "0,00",
      "EDSRCYM": "0,00"
    },
    {
      "Dia": "01/06/2021",
      "Hora": "22-23",
      "PCB": "155,91",
      "CYM": "249,41",
      "COF2TD": "0,000130129026000000",
      "PMHPCB": "108,02",
      "PMHCYM": "108,39",
      "SAHPCB": "2,93",
      "SAHCYM": "2,94",
      "FOMPCB": "0,03",
      "FOMCYM": "0,03",
      "FOSPCB": "0,17",
      "FOSCYM": "0,17",
      "INTPCB": "0,00",
      "INTCYM": "0,00",
      "PCAPPCB": "0,35",
      "PCAPCYM": "2,09",
      "TEUPCB": "41,77",
      "TEUCYM": "133,12",
      "CCVPCB": "2,64",
      "CCVCYM": "2,67",
      "EDSRPCB": "0,00",
      "EDSRCYM": "0,00"
    },
    {
      "Dia": "01/06/2021",
      "Hora": "23-24",
      "PCB": "156,50",
      "CYM": "156,50",
      "COF2TD": "0,000110367990000000",
      "PMHPCB": "108,02",
      "PMHCYM": "108,02",
      "SAHPCB": "3,50",
      "SAHCYM": "3,50",
      "FOMPCB": "0,03",
      "FOMCYM": "0,03",
      "FOSPCB": "0,17",
      "FOSCYM": "0,17",
      "INTPCB": "0,00",
      "INTCYM": "0,00",
      "PCAPPCB": "0,35",
      "PCAPCYM": "0,35",
      "TEUPCB": "41,77",
      "TEUCYM": "41,77",
      "CCVPCB": "2,66",
      "CCVCYM": "2,66",
      "EDSRPCB": "0,00",
      "EDSRCYM": "0,00"
    }
  ]
}
```

Efectivamente, en el _handler_ que usa HomeAssistant hay un `.tariff` que antes valía "GEN", "NOC", "VHC", y ahora hay que pasar como "PCB"/"CYM".

Hasta que se pueda actualizar la librería y pasar el cambio a HA Core, lo mejor es _clonar_ el _component_ en `config/custom_components` (como si fuese una integración de HACS) y meter el literal ahí 
Hola!

Sí, lo acabo de ver yo también. Ya tenemos datos del día 1-6-2021 recogidas de la api de ESIOS ( https://api.esios.ree.es/archives/70/download ):

`
{
    "PVPC": [
        {
            "Dia": "01/06/2021",
            "Hora": "00-01",
            "PCB": "116,33",
            "CYM": "116,33",
            "COF2TD": "0,000088075182000000",
            "PMHPCB": "104,00",
            "PMHCYM": "104,00",
            "SAHPCB": "3,56",
            "SAHCYM": "3,56",
            "FOMPCB": "0,03",
            "FOMCYM": "0,03",
            "FOSPCB": "0,17",
            "FOSCYM": "0,17",
            "INTPCB": "0,00",
            "INTCYM": "0,00",
            "PCAPPCB": "0,00",
            "PCAPCYM": "0,00",
            "TEUPCB": "6,00",
            "TEUCYM": "6,00",
            "CCVPCB": "2,57",
            "CCVCYM": "2,57",
            "EDSRPCB": "0,00",
            "EDSRCYM": "0,00"
        }, ...
`

Vale, entonces PCB es Península, Canarias y Baleares ... y CYM es Ceuta y Melilla.

Por cierto, menudo robo con la nueva tarifa. ¡¡¡Sube a 24 céntimos en las horas punta!!! :scream:
> Por cierto, menudo robo con la nueva tarifa. ¡¡¡Sube a 24 céntimos en las horas punta!!! 😱

Sí, vaya tela 🙈

Estoy viendo qué cambiar de forma sencilla para publicar un update lo antes posible, ya tengo los precios de hoy y mañana 😅
<img width="332" alt="prices-NOC-and-PCB" src="https://user-images.githubusercontent.com/9748301/120231602-04e2a080-c252-11eb-87c6-8bfab5d15348.png">

Genial @azogue !!

> 
> Estoy viendo qué cambiar de forma sencilla para publicar un update lo antes posible, ya tengo los precios de hoy y mañana 

¿Podemos clonar la librería en custom_components haciendo esas modificaciones manualmente y cargando la integración en HA de forma manual para que funcione?

¿Qué modificaciones serían? He visto las listas literales ESIOS_TARIFFS y TARIFFS. ¿Algo más?

Muchas gracias por adelantado.
> ¿Podemos clonar la librería en custom_components haciendo esas modificaciones manualmente y cargando la integración en HA de forma manual para que funcione?
> ¿Qué modificaciones serían? He visto las listas literales ESIOS_TARIFFS y TARIFFS. ¿Algo más?

Lo pongo fácil:

[custom_components.zip](https://github.com/azogue/aiopvpc/files/6571976/custom_components.zip)

1. Descargar el ZIP y descomprimirlo en la carpeta de config de HA (descomprime ficheros en `custom_components/pvpc_hourly_pricing/*`)
2. Reiniciar HA 🌈


Yo ya lo he hecho en mi _production machine_:

<img width="380" alt="pvpc-quickfix" src="https://user-images.githubusercontent.com/9748301/120234042-66593e00-c257-11eb-9a47-edea48544b68.png">

#### Pegas

1. Usa precios de "PCB", los de Ceuta y Melilla habrá que configurarlos en HA en un futuro update (o marcar el bool a cierto)
2. No sé si fallará 😅

Iré publicando versión aquí y haciendo PR en HA a lo largo de la semana (not today!), pero imagino que hasta la v2021.6.1/2 de HA no entrará el fix que pueda hacer, así que, sintiéndolo mucho, **si se quiere tener el sensor funcional en la primera quincena de junio, _this is the way_** 😜

De haber tenido ese JSON que hoy han publicado (más tarde de las 20.15 btw) hace un par de semanas, pues habría sido una transición sencilla... 😢

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 57bb194..f244052 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,14 @@
 # Changelog
 
+## [v2.1.2](https://github.com/azogue/aiopvpc/tree/v2.1.2) - Quick adapt to new tariff 2.0TD (2021-05-31)
+
+[Full Changelog](https://github.com/azogue/aiopvpc/compare/v2.1.2...v2.1.1)
+
+**Changes:**
+
+- Use "PCB" and "CYM" keys to retrieve prices for dates > 2021-06-01 to match new JSON from Esios API for new '2.0 TD' tariff.
+- Add new flag to set prices for Ceuta & Melilla (to use "CYM" identifier instead of "PCB")
+
 ## [v2.1.1](https://github.com/azogue/aiopvpc/tree/v2.1.1) - Fix prices badly assigned outside default timezone (2021-05-16)
 
 [Full Changelog](https://github.com/azogue/aiopvpc/compare/v2.1.1...v2.0.2)
diff --git a/aiopvpc/pvpc_data.py b/aiopvpc/pvpc_data.py
index 06cefbd..c8c2622 100644
--- a/aiopvpc/pvpc_data.py
+++ b/aiopvpc/pvpc_data.py
@@ -15,11 +15,14 @@
 import async_timeout
 
 from aiopvpc.pvpc_download import (
+    DATE_CHANGE_TO_20TD,
     DEFAULT_TIMEOUT,
     extract_pvpc_data,
     get_url_for_daily_json,
     REFERENCE_TZ,
     TARIFF_KEYS,
+    TARIFF_KEYS_NEW,
+    TARIFFS_NEW,
     UTC_TZ,
     zoneinfo,
 )
@@ -56,6 +59,7 @@ def __init__(
         tariff: Optional[str] = None,
         websession: Optional[aiohttp.ClientSession] = None,
         local_timezone: Union[str, zoneinfo.ZoneInfo] = REFERENCE_TZ,
+        zone_ceuta_melilla: bool = False,
         logger: Optional[logging.Logger] = None,
         timeout: float = DEFAULT_TIMEOUT,
     ):
@@ -64,7 +68,11 @@ def __init__(
         self.state_available = False
         self.attributes: Dict[str, Any] = {}
 
-        self.tariff = tariff
+        self.tariff_old = tariff
+        if tariff is None:
+            self.tariff = None
+        else:
+            self.tariff = TARIFFS_NEW[1] if zone_ceuta_melilla else TARIFFS_NEW[0]
         self.timeout = timeout
 
         self._session = websession
@@ -74,7 +82,9 @@ def __init__(
 
         self._current_prices: Dict[datetime, float] = {}
 
-        if tariff is None or tariff not in TARIFF_KEYS:
+        if tariff is None or (
+            tariff not in TARIFF_KEYS_NEW and tariff not in TARIFF_KEYS
+        ):
             self._logger.warning("Collecting detailed PVPC data for all tariffs")
 
     async def _download_pvpc_prices(self, day: date) -> Dict[datetime, Any]:
@@ -91,7 +101,11 @@ async def _download_pvpc_prices(self, day: date) -> Dict[datetime, Any]:
         """
         url = get_url_for_daily_json(day)
         assert self._session is not None
-        tariff = TARIFF_KEYS.get(self.tariff) if self.tariff else None
+        if day < DATE_CHANGE_TO_20TD:
+            tariff = TARIFF_KEYS.get(self.tariff_old) if self.tariff_old else None
+        else:
+            tariff = TARIFF_KEYS_NEW.get(self.tariff) if self.tariff else None
+
         try:
             with async_timeout.timeout(self.timeout):
                 resp = await self._session.get(url)
@@ -149,16 +163,18 @@ def process_state_and_attributes(self, utc_now: datetime) -> bool:
         If not, it is converted to UTC from the original timezone,
         or set as UTC-time if it is a naive datetime.
         """
-        attributes: Dict[str, Any] = {
-            "attribution": _ATTRIBUTION,
-            "tariff": self.tariff,
-        }
+        tariff = self.tariff
+        if utc_now.isoformat() < DATE_CHANGE_TO_20TD.isoformat():
+            tariff = self.tariff_old
+        attributes: Dict[str, Any] = {"attribution": _ATTRIBUTION, "tariff": tariff}
 
         def _local(dt_utc: datetime) -> datetime:
             return dt_utc.astimezone(self._local_timezone)
 
         utc_time = _ensure_utc_time(utc_now.replace(minute=0, second=0, microsecond=0))
         actual_time = _local(utc_time)
+        # todo current_period, next_period [P1/P2/P3], next_period_in (hours)
+        # todo power_period/power_price €/kW*año
         if len(self._current_prices) > 25 and actual_time.hour < 20:
             # there are 'today' and 'next day' prices, but 'today' has expired
             max_age = (
diff --git a/aiopvpc/pvpc_download.py b/aiopvpc/pvpc_download.py
index 9100461..e56cc04 100644
--- a/aiopvpc/pvpc_download.py
+++ b/aiopvpc/pvpc_download.py
@@ -4,6 +4,7 @@
 * URL for JSON daily files
 * Parser for the contents of the JSON files
 """
+import logging
 import sys
 from datetime import date, datetime, timedelta
 from typing import Any, Dict, Optional, Union
@@ -15,16 +16,20 @@
 
 # Tariffs as internal keys in esios API data
 ESIOS_TARIFFS = ["GEN", "NOC", "VHC"]
+ESIOS_TARIFFS_NEW = ["PCB", "CYM"]
 
 # Tariffs used in HomeAssistant integration
 TARIFFS = ["normal", "discrimination", "electric_car"]
 TARIFF_KEYS = dict(zip(TARIFFS, ESIOS_TARIFFS))
+TARIFFS_NEW = ["2.0TD", "2.0TD (Ceuta/Melilla)"]
+TARIFF_KEYS_NEW = dict(zip(TARIFFS_NEW, ESIOS_TARIFFS_NEW))
 
 # Prices are given in 0 to 24h sets, adjusted to the main timezone in Spain
 REFERENCE_TZ = zoneinfo.ZoneInfo("Europe/Madrid")
 UTC_TZ = zoneinfo.ZoneInfo("UTC")
 
 DEFAULT_TIMEOUT = 5
+DATE_CHANGE_TO_20TD = date(2021, 6, 1)
 _PRECISION = 5
 _RESOURCE = (
     "https://api.esios.ree.es/archives/70/download_json"
@@ -41,6 +46,7 @@ def extract_pvpc_data(
     data: Dict[str, Any],
     key: Optional[str] = None,
     tz: zoneinfo.ZoneInfo = REFERENCE_TZ,
+    zone_ceuta_melilla: bool = False,
 ) -> Union[Dict[datetime, float], Dict[datetime, Dict[str, float]]]:
     """Parse the contents of a daily PVPC json file."""
     ts_init = datetime(
@@ -48,6 +54,14 @@ def extract_pvpc_data(
         tzinfo=tz,
     ).astimezone(UTC_TZ)
 
+    if ts_init.date() >= date(2021, 6, 1) and key not in ESIOS_TARIFFS_NEW:
+        logging.warning(
+            "Bad call for prices with new 2.0TD tariff, "
+            "'%s' is not valid anymore :(",
+            key,
+        )
+        key = "CYM" if zone_ceuta_melilla else "PCB"
+
     def _parse_tariff_val(value, prec=_PRECISION) -> float:
         return round(float(value.replace(",", ".")) / 1000.0, prec)
 
diff --git a/pyproject.toml b/pyproject.toml
index b555190..281bc9f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -36,7 +36,7 @@ markers = [
 
 [tool.poetry]
 name = "aiopvpc"
-version = "2.1.1"
+version = "2.1.2"
 description = "Retrieval of Spanish Electricity hourly prices (PVPC)"
 authors = ["Eugenio Panadero <eugenio.panadero@gmail.com>"]
 license = "MIT"


Test patch:
diff --git a/tests/api_examples/PVPC_CURV_DD_2021_06_01.json b/tests/api_examples/PVPC_CURV_DD_2021_06_01.json
new file mode 100644
index 0000000..b59e3c7
--- /dev/null
+++ b/tests/api_examples/PVPC_CURV_DD_2021_06_01.json
@@ -0,0 +1,604 @@
+{
+  "PVPC": [
+    {
+      "Dia": "01/06/2021",
+      "Hora": "00-01",
+      "PCB": "116,33",
+      "CYM": "116,33",
+      "COF2TD": "0,000088075182000000",
+      "PMHPCB": "104,00",
+      "PMHCYM": "104,00",
+      "SAHPCB": "3,56",
+      "SAHCYM": "3,56",
+      "FOMPCB": "0,03",
+      "FOMCYM": "0,03",
+      "FOSPCB": "0,17",
+      "FOSCYM": "0,17",
+      "INTPCB": "0,00",
+      "INTCYM": "0,00",
+      "PCAPPCB": "0,00",
+      "PCAPCYM": "0,00",
+      "TEUPCB": "6,00",
+      "TEUCYM": "6,00",
+      "CCVPCB": "2,57",
+      "CCVCYM": "2,57",
+      "EDSRPCB": "0,00",
+      "EDSRCYM": "0,00"
+    },
+    {
+      "Dia": "01/06/2021",
+      "Hora": "01-02",
+      "PCB": "115,95",
+      "CYM": "115,95",
+      "COF2TD": "0,000073094842000000",
+      "PMHPCB": "103,18",
+      "PMHCYM": "103,18",
+      "SAHPCB": "3,99",
+      "SAHCYM": "3,99",
+      "FOMPCB": "0,03",
+      "FOMCYM": "0,03",
+      "FOSPCB": "0,17",
+      "FOSCYM": "0,17",
+      "INTPCB": "0,00",
+      "INTCYM": "0,00",
+      "PCAPPCB": "0,00",
+      "PCAPCYM": "0,00",
+      "TEUPCB": "6,00",
+      "TEUCYM": "6,00",
+      "CCVPCB": "2,58",
+      "CCVCYM": "2,58",
+      "EDSRPCB": "0,00",
+      "EDSRCYM": "0,00"
+    },
+    {
+      "Dia": "01/06/2021",
+      "Hora": "02-03",
+      "PCB": "114,89",
+      "CYM": "114,89",
+      "COF2TD": "0,000065114032000000",
+      "PMHPCB": "101,87",
+      "PMHCYM": "101,87",
+      "SAHPCB": "4,25",
+      "SAHCYM": "4,25",
+      "FOMPCB": "0,03",
+      "FOMCYM": "0,03",
+      "FOSPCB": "0,17",
+      "FOSCYM": "0,17",
+      "INTPCB": "0,00",
+      "INTCYM": "0,00",
+      "PCAPPCB": "0,00",
+      "PCAPCYM": "0,00",
+      "TEUPCB": "6,00",
+      "TEUCYM": "6,00",
+      "CCVPCB": "2,56",
+      "CCVCYM": "2,56",
+      "EDSRPCB": "0,00",
+      "EDSRCYM": "0,00"
+    },
+    {
+      "Dia": "01/06/2021",
+      "Hora": "03-04",
+      "PCB": "114,96",
+      "CYM": "114,96",
+      "COF2TD": "0,000061272596000000",
+      "PMHPCB": "102,01",
+      "PMHCYM": "102,01",
+      "SAHPCB": "4,19",
+      "SAHCYM": "4,19",
+      "FOMPCB": "0,03",
+      "FOMCYM": "0,03",
+      "FOSPCB": "0,17",
+      "FOSCYM": "0,17",
+      "INTPCB": "0,00",
+      "INTCYM": "0,00",
+      "PCAPPCB": "0,00",
+      "PCAPCYM": "0,00",
+      "TEUPCB": "6,00",
+      "TEUCYM": "6,00",
+      "CCVPCB": "2,57",
+      "CCVCYM": "2,57",
+      "EDSRPCB": "0,00",
+      "EDSRCYM": "0,00"
+    },
+    {
+      "Dia": "01/06/2021",
+      "Hora": "04-05",
+      "PCB": "114,84",
+      "CYM": "114,84",
+      "COF2TD": "0,000059563056000000",
+      "PMHPCB": "101,87",
+      "PMHCYM": "101,87",
+      "SAHPCB": "4,21",
+      "SAHCYM": "4,21",
+      "FOMPCB": "0,03",
+      "FOMCYM": "0,03",
+      "FOSPCB": "0,17",
+      "FOSCYM": "0,17",
+      "INTPCB": "0,00",
+      "INTCYM": "0,00",
+      "PCAPPCB": "0,00",
+      "PCAPCYM": "0,00",
+      "TEUPCB": "6,00",
+      "TEUCYM": "6,00",
+      "CCVPCB": "2,56",
+      "CCVCYM": "2,56",
+      "EDSRPCB": "0,00",
+      "EDSRCYM": "0,00"
+    },
+    {
+      "Dia": "01/06/2021",
+      "Hora": "05-06",
+      "PCB": "116,03",
+      "CYM": "116,03",
+      "COF2TD": "0,000059907686000000",
+      "PMHPCB": "103,14",
+      "PMHCYM": "103,14",
+      "SAHPCB": "4,11",
+      "SAHCYM": "4,11",
+      "FOMPCB": "0,03",
+      "FOMCYM": "0,03",
+      "FOSPCB": "0,17",
+      "FOSCYM": "0,17",
+      "INTPCB": "0,00",
+      "INTCYM": "0,00",
+      "PCAPPCB": "0,00",
+      "PCAPCYM": "0,00",
+      "TEUPCB": "6,00",
+      "TEUCYM": "6,00",
+      "CCVPCB": "2,58",
+      "CCVCYM": "2,58",
+      "EDSRPCB": "0,00",
+      "EDSRCYM": "0,00"
+    },
+    {
+      "Dia": "01/06/2021",
+      "Hora": "06-07",
+      "PCB": "116,29",
+      "CYM": "116,29",
+      "COF2TD": "0,000062818713000000",
+      "PMHPCB": "103,64",
+      "PMHCYM": "103,64",
+      "SAHPCB": "3,88",
+      "SAHCYM": "3,88",
+      "FOMPCB": "0,03",
+      "FOMCYM": "0,03",
+      "FOSPCB": "0,17",
+      "FOSCYM": "0,17",
+      "INTPCB": "0,00",
+      "INTCYM": "0,00",
+      "PCAPPCB": "0,00",
+      "PCAPCYM": "0,00",
+      "TEUPCB": "6,00",
+      "TEUCYM": "6,00",
+      "CCVPCB": "2,57",
+      "CCVCYM": "2,57",
+      "EDSRPCB": "0,00",
+      "EDSRCYM": "0,00"
+    },
+    {
+      "Dia": "01/06/2021",
+      "Hora": "07-08",
+      "PCB": "115,70",
+      "CYM": "115,70",
+      "COF2TD": "0,000072575564000000",
+      "PMHPCB": "103,85",
+      "PMHCYM": "103,85",
+      "SAHPCB": "3,10",
+      "SAHCYM": "3,10",
+      "FOMPCB": "0,03",
+      "FOMCYM": "0,03",
+      "FOSPCB": "0,16",
+      "FOSCYM": "0,16",
+      "INTPCB": "0,00",
+      "INTCYM": "0,00",
+      "PCAPPCB": "0,00",
+      "PCAPCYM": "0,00",
+      "TEUPCB": "6,00",
+      "TEUCYM": "6,00",
+      "CCVPCB": "2,55",
+      "CCVCYM": "2,55",
+      "EDSRPCB": "0,00",
+      "EDSRCYM": "0,00"
+    },
+    {
+      "Dia": "01/06/2021",
+      "Hora": "08-09",
+      "PCB": "152,89",
+      "CYM": "152,89",
+      "COF2TD": "0,000086825264000000",
+      "PMHPCB": "105,65",
+      "PMHCYM": "105,65",
+      "SAHPCB": "2,36",
+      "SAHCYM": "2,36",
+      "FOMPCB": "0,03",
+      "FOMCYM": "0,03",
+      "FOSPCB": "0,17",
+      "FOSCYM": "0,17",
+      "INTPCB": "0,00",
+      "INTCYM": "0,00",
+      "PCAPPCB": "0,34",
+      "PCAPCYM": "0,34",
+      "TEUPCB": "41,77",
+      "TEUCYM": "41,77",
+      "CCVPCB": "2,57",
+      "CCVCYM": "2,57",
+      "EDSRPCB": "0,00",
+      "EDSRCYM": "0,00"
+    },
+    {
+      "Dia": "01/06/2021",
+      "Hora": "09-10",
+      "PCB": "150,83",
+      "CYM": "150,83",
+      "COF2TD": "0,000095768317000000",
+      "PMHPCB": "103,77",
+      "PMHCYM": "103,77",
+      "SAHPCB": "2,24",
+      "SAHCYM": "2,24",
+      "FOMPCB": "0,03",
+      "FOMCYM": "0,03",
+      "FOSPCB": "0,16",
+      "FOSCYM": "0,16",
+      "INTPCB": "0,00",
+      "INTCYM": "0,00",
+      "PCAPPCB": "0,34",
+      "PCAPCYM": "0,34",
+      "TEUPCB": "41,77",
+      "TEUCYM": "41,77",
+      "CCVPCB": "2,53",
+      "CCVCYM": "2,53",
+      "EDSRPCB": "0,00",
+      "EDSRCYM": "0,00"
+    },
+    {
+      "Dia": "01/06/2021",
+      "Hora": "10-11",
+      "PCB": "242,62",
+      "CYM": "149,28",
+      "COF2TD": "0,000102672431000000",
+      "PMHPCB": "102,38",
+      "PMHCYM": "102,11",
+      "SAHPCB": "2,38",
+      "SAHCYM": "2,37",
+      "FOMPCB": "0,03",
+      "FOMCYM": "0,03",
+      "FOSPCB": "0,16",
+      "FOSCYM": "0,16",
+      "INTPCB": "0,00",
+      "INTCYM": "0,00",
+      "PCAPPCB": "2,01",
+      "PCAPCYM": "0,34",
+      "TEUPCB": "133,12",
+      "TEUCYM": "41,77",
+      "CCVPCB": "2,54",
+      "CCVCYM": "2,51",
+      "EDSRPCB": "0,00",
+      "EDSRCYM": "0,00"
+    },
+    {
+      "Dia": "01/06/2021",
+      "Hora": "11-12",
+      "PCB": "240,50",
+      "CYM": "240,50",
+      "COF2TD": "0,000105691470000000",
+      "PMHPCB": "100,14",
+      "PMHCYM": "100,14",
+      "SAHPCB": "2,52",
+      "SAHCYM": "2,52",
+      "FOMPCB": "0,03",
+      "FOMCYM": "0,03",
+      "FOSPCB": "0,16",
+      "FOSCYM": "0,16",
+      "INTPCB": "0,00",
+      "INTCYM": "0,00",
+      "PCAPPCB": "2,02",
+      "PCAPCYM": "2,02",
+      "TEUPCB": "133,12",
+      "TEUCYM": "133,12",
+      "CCVPCB": "2,51",
+      "CCVCYM": "2,51",
+      "EDSRPCB": "0,00",
+      "EDSRCYM": "0,00"
+    },
+    {
+      "Dia": "01/06/2021",
+      "Hora": "12-13",
+      "PCB": "238,09",
+      "CYM": "238,09",
+      "COF2TD": "0,000110462952000000",
+      "PMHPCB": "97,58",
+      "PMHCYM": "97,58",
+      "SAHPCB": "2,71",
+      "SAHCYM": "2,71",
+      "FOMPCB": "0,03",
+      "FOMCYM": "0,03",
+      "FOSPCB": "0,16",
+      "FOSCYM": "0,16",
+      "INTPCB": "0,00",
+      "INTCYM": "0,00",
+      "PCAPPCB": "2,02",
+      "PCAPCYM": "2,02",
+      "TEUPCB": "133,12",
+      "TEUCYM": "133,12",
+      "CCVPCB": "2,47",
+      "CCVCYM": "2,47",
+      "EDSRPCB": "0,00",
+      "EDSRCYM": "0,00"
+    },
+    {
+      "Dia": "01/06/2021",
+      "Hora": "13-14",
+      "PCB": "235,30",
+      "CYM": "235,30",
+      "COF2TD": "0,000119052052000000",
+      "PMHPCB": "94,65",
+      "PMHCYM": "94,65",
+      "SAHPCB": "2,89",
+      "SAHCYM": "2,89",
+      "FOMPCB": "0,03",
+      "FOMCYM": "0,03",
+      "FOSPCB": "0,16",
+      "FOSCYM": "0,16",
+      "INTPCB": "0,00",
+      "INTCYM": "0,00",
+      "PCAPPCB": "2,02",
+      "PCAPCYM": "2,02",
+      "TEUPCB": "133,12",
+      "TEUCYM": "133,12",
+      "CCVPCB": "2,43",
+      "CCVCYM": "2,43",
+      "EDSRPCB": "0,00",
+      "EDSRCYM": "0,00"
+    },
+    {
+      "Dia": "01/06/2021",
+      "Hora": "14-15",
+      "PCB": "137,96",
+      "CYM": "231,28",
+      "COF2TD": "0,000117990009000000",
+      "PMHPCB": "89,95",
+      "PMHCYM": "90,19",
+      "SAHPCB": "3,37",
+      "SAHCYM": "3,38",
+      "FOMPCB": "0,03",
+      "FOMCYM": "0,03",
+      "FOSPCB": "0,16",
+      "FOSCYM": "0,16",
+      "INTPCB": "0,00",
+      "INTCYM": "0,00",
+      "PCAPPCB": "0,34",
+      "PCAPCYM": "2,03",
+      "TEUPCB": "41,77",
+      "TEUCYM": "133,12",
+      "CCVPCB": "2,34",
+      "CCVCYM": "2,37",
+      "EDSRPCB": "0,00",
+      "EDSRCYM": "0,00"
+    },
+    {
+      "Dia": "01/06/2021",
+      "Hora": "15-16",
+      "PCB": "132,88",
+      "CYM": "132,88",
+      "COF2TD": "0,000108598330000000",
+      "PMHPCB": "84,43",
+      "PMHCYM": "84,43",
+      "SAHPCB": "3,89",
+      "SAHCYM": "3,89",
+      "FOMPCB": "0,03",
+      "FOMCYM": "0,03",
+      "FOSPCB": "0,16",
+      "FOSCYM": "0,16",
+      "INTPCB": "0,00",
+      "INTCYM": "0,00",
+      "PCAPPCB": "0,34",
+      "PCAPCYM": "0,34",
+      "TEUPCB": "41,77",
+      "TEUCYM": "41,77",
+      "CCVPCB": "2,26",
+      "CCVCYM": "2,26",
+      "EDSRPCB": "0,00",
+      "EDSRCYM": "0,00"
+    },
+    {
+      "Dia": "01/06/2021",
+      "Hora": "16-17",
+      "PCB": "131,93",
+      "CYM": "131,93",
+      "COF2TD": "0,000104114191000000",
+      "PMHPCB": "83,66",
+      "PMHCYM": "83,66",
+      "SAHPCB": "3,73",
+      "SAHCYM": "3,73",
+      "FOMPCB": "0,03",
+      "FOMCYM": "0,03",
+      "FOSPCB": "0,16",
+      "FOSCYM": "0,16",
+      "INTPCB": "0,00",
+      "INTCYM": "0,00",
+      "PCAPPCB": "0,34",
+      "PCAPCYM": "0,34",
+      "TEUPCB": "41,77",
+      "TEUCYM": "41,77",
+      "CCVPCB": "2,25",
+      "CCVCYM": "2,25",
+      "EDSRPCB": "0,00",
+      "EDSRCYM": "0,00"
+    },
+    {
+      "Dia": "01/06/2021",
+      "Hora": "17-18",
+      "PCB": "135,99",
+      "CYM": "135,99",
+      "COF2TD": "0,000105171071000000",
+      "PMHPCB": "88,07",
+      "PMHCYM": "88,07",
+      "SAHPCB": "3,31",
+      "SAHCYM": "3,31",
+      "FOMPCB": "0,03",
+      "FOMCYM": "0,03",
+      "FOSPCB": "0,16",
+      "FOSCYM": "0,16",
+      "INTPCB": "0,00",
+      "INTCYM": "0,00",
+      "PCAPPCB": "0,34",
+      "PCAPCYM": "0,34",
+      "TEUPCB": "41,77",
+      "TEUCYM": "41,77",
+      "CCVPCB": "2,31",
+      "CCVCYM": "2,31",
+      "EDSRPCB": "0,00",
+      "EDSRCYM": "0,00"
+    },
+    {
+      "Dia": "01/06/2021",
+      "Hora": "18-19",
+      "PCB": "231,44",
+      "CYM": "138,13",
+      "COF2TD": "0,000106417649000000",
+      "PMHPCB": "90,57",
+      "PMHCYM": "90,33",
+      "SAHPCB": "3,16",
+      "SAHCYM": "3,15",
+      "FOMPCB": "0,03",
+      "FOMCYM": "0,03",
+      "FOSPCB": "0,16",
+      "FOSCYM": "0,16",
+      "INTPCB": "0,00",
+      "INTCYM": "0,00",
+      "PCAPPCB": "2,02",
+      "PCAPCYM": "0,34",
+      "TEUPCB": "133,12",
+      "TEUCYM": "41,77",
+      "CCVPCB": "2,37",
+      "CCVCYM": "2,34",
+      "EDSRPCB": "0,00",
+      "EDSRCYM": "0,00"
+    },
+    {
+      "Dia": "01/06/2021",
+      "Hora": "19-20",
+      "PCB": "240,40",
+      "CYM": "240,40",
+      "COF2TD": "0,000108017615000000",
+      "PMHPCB": "99,53",
+      "PMHCYM": "99,53",
+      "SAHPCB": "3,00",
+      "SAHCYM": "3,00",
+      "FOMPCB": "0,03",
+      "FOMCYM": "0,03",
+      "FOSPCB": "0,17",
+      "FOSCYM": "0,17",
+      "INTPCB": "0,00",
+      "INTCYM": "0,00",
+      "PCAPPCB": "2,04",
+      "PCAPCYM": "2,04",
+      "TEUPCB": "133,12",
+      "TEUCYM": "133,12",
+      "CCVPCB": "2,52",
+      "CCVCYM": "2,52",
+      "EDSRPCB": "0,00",
+      "EDSRCYM": "0,00"
+    },
+    {
+      "Dia": "01/06/2021",
+      "Hora": "20-21",
+      "PCB": "246,20",
+      "CYM": "246,20",
+      "COF2TD": "0,000114631042000000",
+      "PMHPCB": "104,32",
+      "PMHCYM": "104,32",
+      "SAHPCB": "3,90",
+      "SAHCYM": "3,90",
+      "FOMPCB": "0,03",
+      "FOMCYM": "0,03",
+      "FOSPCB": "0,17",
+      "FOSCYM": "0,17",
+      "INTPCB": "0,00",
+      "INTCYM": "0,00",
+      "PCAPPCB": "2,05",
+      "PCAPCYM": "2,05",
+      "TEUPCB": "133,12",
+      "TEUCYM": "133,12",
+      "CCVPCB": "2,61",
+      "CCVCYM": "2,61",
+      "EDSRPCB": "0,00",
+      "EDSRCYM": "0,00"
+    },
+    {
+      "Dia": "01/06/2021",
+      "Hora": "21-22",
+      "PCB": "248,08",
+      "CYM": "248,08",
+      "COF2TD": "0,000127585671000000",
+      "PMHPCB": "107,28",
+      "PMHCYM": "107,28",
+      "SAHPCB": "2,78",
+      "SAHCYM": "2,78",
+      "FOMPCB": "0,03",
+      "FOMCYM": "0,03",
+      "FOSPCB": "0,17",
+      "FOSCYM": "0,17",
+      "INTPCB": "0,00",
+      "INTCYM": "0,00",
+      "PCAPPCB": "2,06",
+      "PCAPCYM": "2,06",
+      "TEUPCB": "133,12",
+      "TEUCYM": "133,12",
+      "CCVPCB": "2,64",
+      "CCVCYM": "2,64",
+      "EDSRPCB": "0,00",
+      "EDSRCYM": "0,00"
+    },
+    {
+      "Dia": "01/06/2021",
+      "Hora": "22-23",
+      "PCB": "155,91",
+      "CYM": "249,41",
+      "COF2TD": "0,000130129026000000",
+      "PMHPCB": "108,02",
+      "PMHCYM": "108,39",
+      "SAHPCB": "2,93",
+      "SAHCYM": "2,94",
+      "FOMPCB": "0,03",
+      "FOMCYM": "0,03",
+      "FOSPCB": "0,17",
+      "FOSCYM": "0,17",
+      "INTPCB": "0,00",
+      "INTCYM": "0,00",
+      "PCAPPCB": "0,35",
+      "PCAPCYM": "2,09",
+      "TEUPCB": "41,77",
+      "TEUCYM": "133,12",
+      "CCVPCB": "2,64",
+      "CCVCYM": "2,67",
+      "EDSRPCB": "0,00",
+      "EDSRCYM": "0,00"
+    },
+    {
+      "Dia": "01/06/2021",
+      "Hora": "23-24",
+      "PCB": "156,50",
+      "CYM": "156,50",
+      "COF2TD": "0,000110367990000000",
+      "PMHPCB": "108,02",
+      "PMHCYM": "108,02",
+      "SAHPCB": "3,50",
+      "SAHCYM": "3,50",
+      "FOMPCB": "0,03",
+      "FOMCYM": "0,03",
+      "FOSPCB": "0,17",
+      "FOSCYM": "0,17",
+      "INTPCB": "0,00",
+      "INTCYM": "0,00",
+      "PCAPPCB": "0,35",
+      "PCAPCYM": "0,35",
+      "TEUPCB": "41,77",
+      "TEUCYM": "41,77",
+      "CCVPCB": "2,66",
+      "CCVCYM": "2,66",
+      "EDSRPCB": "0,00",
+      "EDSRCYM": "0,00"
+    }
+  ]
+}
diff --git a/tests/conftest.py b/tests/conftest.py
index 832ae7d..eabecac 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -15,6 +15,7 @@
 FIXTURE_JSON_DATA_2019_10_26 = "PVPC_CURV_DD_2019_10_26.json"
 FIXTURE_JSON_DATA_2019_10_27 = "PVPC_CURV_DD_2019_10_27.json"
 FIXTURE_JSON_DATA_2019_03_31 = "PVPC_CURV_DD_2019_03_31.json"
+FIXTURE_JSON_DATA_2021_06_01 = "PVPC_CURV_DD_2021_06_01.json"
 
 _DEFAULT_EMPTY_VALUE = {"message": "No values for specified archive"}
 
@@ -49,6 +50,7 @@ def __init__(self, status=200, exc=None):
             date(2019, 3, 31): load_fixture(FIXTURE_JSON_DATA_2019_03_31),
             date(2019, 10, 26): load_fixture(FIXTURE_JSON_DATA_2019_10_26),
             date(2019, 10, 27): load_fixture(FIXTURE_JSON_DATA_2019_10_27),
+            date(2021, 6, 1): load_fixture(FIXTURE_JSON_DATA_2021_06_01),
         }
 
     async def json(self, *_args, **_kwargs):
diff --git a/tests/test_pvpc.py b/tests/test_pvpc.py
index da9ea93..a865732 100644
--- a/tests/test_pvpc.py
+++ b/tests/test_pvpc.py
@@ -25,6 +25,7 @@
         ("2019-10-27 00:00:00", REFERENCE_TZ, 25, 1, 25, True, 23),
         ("2019-03-31 20:00:00", REFERENCE_TZ, 23, 2, 23, False, 23),
         ("2019-10-26 21:00:00", REFERENCE_TZ, 49, 2, 25, True, 23),
+        ("2021-06-01 06:00:00", REFERENCE_TZ, 24, 1, 24, True, 23),
     ),
 )
 @pytest.mark.asyncio