home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.67k stars 30.42k forks source link

Cost for PVPC not working in Energy Panel with Datadis and UFD, due to a 2 day offset in energy info #64955

Closed alessbarb closed 2 years ago

alessbarb commented 2 years ago

The problem

My energy providor UFD gives energy consumption info with an offset of 2 days, so today I receive energy consumption from the day before yesterday.

PVPC only gives today's and yesterday's cost, so I understand I am not calculating costs because my data is one day further.

What version of Home Assistant Core has the issue?

2021.12.10

What was the last working version of Home Assistant Core?

never

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Spain electricity hourly pricing (PVPC)

Link to integration documentation on our website

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

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

image

probot-home-assistant[bot] commented 2 years ago

Hey there @azogue, mind taking a look at this issue as it has been labeled with an integration (pvpc_hourly_pricing) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)


pvpc_hourly_pricing documentation pvpc_hourly_pricing source (message by IssueLinks)

azogue commented 2 years ago

Hi @alessbarb,

due to a 2 day offset in energy info

If I'm understanding correctly, your problem is related to your 'energy' data, which is coming to HA with a custom integration?, and being delayed ~2 days, is that right?

In that case, you may look for help to the developers of that custom integration, but this problem is outside the scope and competences of the pvpc_hourly_pricing integration, sorry 😔

Right now, AFAIK (may be wrong), there is no (official) way to insert external 'statistics data' into HA, only internal entity states from the HA state machine can be processed (automatically) to generate hourly aggregated values, which feed the Energy panel.

How are those edata_xxxx_consumption energy values coming to HA?

Bypassing the state machine to insert stats from an external source (the data from your provider, with 2 days delay) could be a very interesting feature request with lots of potential usages, but for HA Core in general, not for the pvpc_hourly_prices integration in particular, as its mission is just to provide a sensor with the current price.

FYI, with any other 'energy sensor', like a Shelly EM, providing the current power or energy usages, the PVPC sensor works as expected in the Energy panel, calculating the cost for those energy sensors.

alessbarb commented 2 years ago

I will try in HA Community.

Thanks