Closed Mijawel closed 2 months ago
The app shows 30 minutes prices. It looks like you are requested 5 minute prices from the API.
What API call are you making?
But the price in the app changes approx. every 5 mins? Then at the end of the 30 min period, seems to settle on the last price of the period (or some kind of average, not 100% sure).
For example, if you look at the two screenshots above, at 9:54am and 9:59am, it shows two different prices (e.g. the price is changed more than once in a 30 min interval). And when I look at the app now, for the 9:30-10am period, it shows the last price from that period (32c/kWh).
So my assumption was, if I look at the app and see a price at lets say 9:43am, then pull the current interval for the period 9:40-9:45am, that price would be the same.
Here is the API call: curl -X GET "https://api.amber.com.au/v1/sites/$siteId/prices/current?previous=1&next=1&resolution=5" \ -H "Authorization: Bearer $apiKey"
Yep, it does, but the app shows the average 30 minute price, not the 5 minutes settlement price, which is the price will bill on. For the moment, the app is correct. Actuals will match up with the final price that occurs in the 25th and 55th minute of each 30 minute interval.
https://help.amber.com.au/hc/en-us/articles/4411273786637-Five-minute-settlement-explained
Ah so if I understand correctly, it sort of builds up the average as it moves through the 30 min period? E.g.
For example, lets say we have the following 5 min settlement prices: 9:30am: 20c = app will show 20c 9:35am: 10c = app will show 15c i.e. (20+10)/2 9:40am: 30c = app will show 20c i.e (20+10+30)/3 And so on...
Whereas the API would have shown the actual 5 min prices: 9:30am: 20c 9:35am: 10c 9:40am: 30c
Almost. We back(front?) fill the missing intervals with 5-minute forecasts. Right now there are 4 known prices, and 2 unknown prices that use forecasts to fill.
Ah. Kk thanks for the clarification, makes sense.
I'm just wondering why I am seeing a different price perKwh in the API and in the app? And there doesn't seem to be a delay on either version, as the prices never match up during the period either before or after. E.g. At no time within 1 hour before or after was there a price from the API between 26.5-27.5 or 31.5-32.5, however I saw a 27c/kWh and 32c/kWh in the app during that period.
Given the above, I'm just wondering which is the price that is actually correct? The app or the API. Or am I making a mistake in understanding the data?
First example interval:
{ "type":"CurrentInterval", "date":"2024-09-12", "duration":5, "startTime":"2024-09-11T23:50:01Z", "endTime":"2024-09-11T23:55:00Z", "nemTime":"2024-09-12T09:55:00+10:00", "perKwh":19.39453, "renewables":51.027, "spotPerKwh":11.6314, "channelType":"general", "spikeStatus":"none", "tariffInformation":{ "demandWindow":false }, "descriptor":"veryLow", "estimate":false }
The following interval:
{ "type":"CurrentInterval", "date":"2024-09-12", "duration":5, "startTime":"2024-09-11T23:55:01Z", "endTime":"2024-09-12T00:00:00Z", "nemTime":"2024-09-12T10:00:00+10:00", "perKwh":37.94418, "renewables":49.873, "spotPerKwh":29.32436, "channelType":"general", "spikeStatus":"none", "tariffInformation":{ "demandWindow":false }, "descriptor":"low", "estimate":false }
And afterwards I pulled the actual intervals recorded for that period (including) one before and one after:
[ { "type":"ActualInterval", "date":"2024-09-12", "duration":5, "startTime":"2024-09-11T23:45:01Z", "endTime":"2024-09-11T23:50:00Z", "nemTime":"2024-09-12T09:50:00+10:00", "perKwh":36.55951, "renewables":53.380395291151416, "spotPerKwh":28.00364, "channelType":"general", "spikeStatus":"none", "tariffInformation":{ "demandWindow":false }, "descriptor":"low" }, { "type":"ActualInterval", "date":"2024-09-12", "duration":5, "startTime":"2024-09-11T23:50:01Z", "endTime":"2024-09-11T23:55:00Z", "nemTime":"2024-09-12T09:55:00+10:00", "perKwh":19.39453, "renewables":51.02671276365013, "spotPerKwh":11.6314, "channelType":"general", "spikeStatus":"none", "tariffInformation":{ "demandWindow":false }, "descriptor":"veryLow" }, { "type":"ActualInterval", "date":"2024-09-12", "duration":5, "startTime":"2024-09-11T23:55:01Z", "endTime":"2024-09-12T00:00:00Z", "nemTime":"2024-09-12T10:00:00+10:00", "perKwh":37.94418, "renewables":49.87315445494173, "spotPerKwh":29.32436, "channelType":"general", "spikeStatus":"none", "tariffInformation":{ "demandWindow":false }, "descriptor":"low" }, { "type":"ActualInterval", "date":"2024-09-12", "duration":5, "startTime":"2024-09-12T00:00:01Z", "endTime":"2024-09-12T00:05:00Z", "nemTime":"2024-09-12T10:05:00+10:00", "perKwh":4.54744, "renewables":51.46624722522672, "spotPerKwh":-2.53, "channelType":"general", "spikeStatus":"none", "tariffInformation":{ "demandWindow":false }, "descriptor":"extremelyLow" } ]