“I have a photovoltaic system, and I need to assess whether it’s worthwhile to consume the energy myself or feed it into the grid, especially if there will be very low prices the following day. Since the GME (Italian Wholesale Electricity Market) publishes the “Day-Ahead Market Prices (MGP)” around 1:00 PM, I would need to create sensors that fetch data for the next day like this:”
If you need to optimize the charge/discharge cycle of your battery, depending on costs, load, PV prod and so on I would suggest you to give a try to this add-on, I’m already playing with:
Interesting, for the moment I’ve applied an average cost difference between buying and “ritiro dedicato (RID)” sales prices; I’ll have a look to see if it’s more precise and allows me to make this little step automatic.
GSE RID price is calculated in this way: the Hourly Zonal Price (PO), which is the price in the electricity market and depending on the time at which the energy is fed grid and the market zone in which the facility is located, so RID is multiplied by kWh fed to grid.
This in my HA:
1)
# energy meter fed to grid hourly
hourly_energy_grid_exported:
source: sensor.grid_exported
cycle: hourly
I may be wrong but I fear it’s not just the Zonal Price, updated hour by hour and day by day, but it’s rather the average over the month, per zone, per band (now I remember why I applied an average delta using current PUN as a basis, instead of pulling from the XML).
Have a look here:
as you can see for each day kWh fed to the grid is multiplied for PO price zone and every hour of every day matches PO GME price data (august, 31, 2023 PO Calabria in my example pictures)
I verified and you are right, but (at least for me) I think you may also need to consider the loss coefficient (coeff_perd = 1,052).
This is the formula I found in my detailed RID payments:
energia * coeff_perd * max(prz_ora;0)
where prz_ora is, as you said, the PUN of your geographic area.
If I sum the results of the formula, day by day, hour by hour, I get the amount I receive.
Thank you both for the very useful inputs. I’ve successfully added the MULTISCRAPE integration from HACS and the code in configuration.yalm (see below).
Just one technical question: I’ve copied/pasted your code " - select: ‘NewDataSet:nth-child(1) > Prezzi:nth-child(2) > PUN:nth-child(4)’", I understood how to change the hour (increase the number after Prezzi:nth-child( ) , but how to change the zone? Currently all the values are the same, but maybe it will be different in the future…
Another question, why did you search for the day doc named of the day after? (as_timestamp(now()) + (24*3600) ) ?
Example: to calculate the price of the energy on at 00:30 on 29-01-2024 I should look in the document named 29-01-2024 and in the time range 1:
That’s the “tricky” part of multiscrape. You have to look into the CSS code to retrieve that; try to follow the instructions of the component here.
Once you find the right column you can select the rows by increasing the index (or inspect all of them - as you prefer).
You are right. We just needed tomorrow’s prices as well.
I need today’s and tomorrow’s prices for the RID in the Calabria area (for my PV, to calculate the price of the energy fed into the grid). Tomorrow’s prices are uploaded by the GME at 14:00 every day so I can visualize them on the dashboard 24 hours in advance. It’s a pity that the limitations of Home Assistant can’t create a sensor with future data and therefore I can’t represent them graphically, but to manage they are more than fine
just a heads-up that a new website was released for GME.
Unsure if the old one will be retired at some point but we may need to re-work our code to pull the data from the new one.
@110hs , @MicheleMercuri , can you please share your entire code? I’m trying to set both RID and “PUN per fasce” in order to calculate what I’m paying and what I’m earning.
I also saw some beautiful charts in your comments, can you share please the code for them too? I’m quite new on HA and a need lots example to get something yet
For PUN values I rely on the excellent https://github.com/virtualdj/pun_sensor
For “prezzi zonali” (I use Nord - you can find some details on how to select what you need in the previous posts), needed for RID calculations, please find below my code (I’m using Multiscrape integration).
But be informed that by end of December the “old” website of GME will be retired.
The new one has some differences and I’m almost sure my current approach won’t work anymore.
Also the integration I linked above is working to adapt to the new changes and I’m sitting on the fence, waiting to see if they will incorporate prezzi zonali as well (which seems not the case at the moment), if I will try to refactor their code to scan them or switch to ENTSO-E website that receives prezzi zonali from Terna and makes some API available to retrive them.