azogue / ha-pvpc-custom

HomeAssistant custom integration for Spain electricity hourly pricing (PVPC)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Time zone Atlantic/Canary. The value of the hourly price and the value shown in the graph do not match.

carsanch opened this issue · comments

Hello,

As you can see in the screenshot attached to the issue, the value of the price does not match the one indicated in the graph. It is one hour off. The screenshot was taken at 8:45 a.m. localtime.
screenshot

My time zone is (UTC/GMT +00:00) Atlantic/Canary. Could this be related?

If you need more information, feel free to ask.

Regards.

Hi @carsanch

My time zone is (UTC/GMT +00:00) Atlantic/Canary. Could this be related?

Probably 🙈

As it is implemented right now in aiopvpc, the price for 8-9AM in Canary Islands should be 0.13999, and the same for the península (even if 8AM in one place are not 8AM in the other!)

When calling to aiopvpc, the HA timezone is passed, to make these 'offsets' in the prices, which get stored always in UTC internally.

To render the current price, the prices are accessed with the current UTC time.

This way, getting injection prices for 2023-11-17 from different timezones gives the same values once the UTC datetimes are localised again to the current HA timezone.

If you need more information, feel free to ask.

  • What TZ do you have configured in HA?

  • This offset error in the plot is showing ONLY in the custom-lovelace-card, or it appears too in the normal HA history plot for the sensor entity?

If it's an error of the lovelace-card, you missed the repo to report it 😅 It is in https://github.com/danimart1991/pvpc-hourly-pricing-card 😜. Maybe the card has a fixed TZ ?