azogue / aiopvpc

Simple aio library to download Spanish electricity hourly prices (PVPC) from esios.ree.es
MIT License
42 stars 10 forks source link

Implement ESIOS API Token support #47

Closed azogue closed 1 year ago

azogue commented 1 year ago

closes #9 #45

EddieKnight1 commented 1 year ago

Sorry @azogue if I'm posting this in the wrong place.

How do I add this new version to HA? Is it already available as an integration? or should I download it from somewhere else and place it in the custom_components folder?

azogue commented 1 year ago

Sorry @azogue if I'm posting this in the wrong place.

How do I add this new version to HA? Is it already available as an integration? or should I download it from somewhere else and place it in the custom_components folder?

I have to make a PR in ha-core, and another one in the ha-docs. Then goes the review process, and after the merge, these kind of changes are published in the monthly releases. I'll try to make it for v2023.2.0 🤞, but I'm not sure it will be on time 😰

In the meanwhile, for beta-testing it, you may copy and decompress this pvpc_hourly_pricing.zip into your config/custom_components, to swap the official integration for the new one to come. After release, just remove it 👍

(zip updated at 2023-01-11 09:55h)

enredador commented 1 year ago

Thank you for the new version @azogue. I have installed it successfully (I will report any other issues). I see that the hourly prizes (current and next day) included in the sensors as attributes are now rendered in €/Mwh whereas the sensor value and some other attributes are in €/Kwh.

azogue commented 1 year ago

I see that the hourly prizes (current and next day) included in the sensors as attributes are now rendered in €/Mwh whereas the sensor value and some other attributes are in €/Kwh.

Hi @enredador, that was an error 🙈

When developing it, I saw that the new HA frontend renders numeric attributes for entities with 2 decimals max, so for most sensors with values < 100 €/MWh, the price attributes appeared as 0,00 😢

As I was not sure if it was my fault, I changed them to €/MWh, and then I forgot about them 😱

I'll revert it with a new version patch with the fix 🚀

azogue commented 1 year ago

The zip package is updated to point to "requirements": ["aiopvpc==4.0.1"] in the manifest.json (it's the only change, if already downloaded, just edit yours) (there are changes in sensor.py too)

enredador commented 1 year ago

Thank you @azogue. I made the changes and it is running ok now. May be using €-cents/kWh as unit would have been a more readable choice.

jlopez77 commented 1 year ago

This V4.0.1 works fine with the API token. I still can't see surplus (injection) prices, am I doing something wrong?

azogue commented 1 year ago

This V4.0.1 works fine with the API token. I still can't see surplus (injection) prices, am I doing something wrong?

Hi!

I just published, as a new repository, the 'custom' version of the official component, to replace directly the one included in HA, with the pending changes since January 🐢

It is here: https://github.com/azogue/ha-pvpc-custom

And it is compatible with HACS, adding that link as 'custom repository' with 'category' "Integration" 👍

I recommend everyone to install this new custom component and remove all those components downloaded in some zip (including that 'esios').