From 350bc7015583daffdc0107e38ff2667f50a76234 Mon Sep 17 00:00:00 2001 From: ross-w Date: Mon, 28 Jul 2025 00:59:17 +1000 Subject: [PATCH] Amber: use billing-native resolution, request up to 72 hours ahead (#22538) --- tariff/amber/types.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tariff/amber/types.go b/tariff/amber/types.go index d41bf3c3a..2c721a43e 100644 --- a/tariff/amber/types.go +++ b/tariff/amber/types.go @@ -1,6 +1,14 @@ package amber -const URI = "https://api.amber.com.au/v1/sites/%s/prices/current?resolution=30&next=96" +import "fmt" + +const ( + // ForecastIntervals represents 72 hours of 5-minute intervals for price forecasting + // This is an "up to" figure, so it should still be OK for 30-minute billing customers + ForecastIntervals = 864 // 72 hours * 12 intervals per hour +) + +var URI = fmt.Sprintf("https://api.amber.com.au/v1/sites/%%s/prices/current?next=%d", ForecastIntervals) type AdvancedPrice struct { Low float64 `json:"low"`