Skip to content

Commit

Permalink
Amber: use advanced price forecasts for tariffs (#15892)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffborg authored Sep 28, 2024
1 parent 15483ad commit a539310
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
3 changes: 3 additions & 0 deletions tariff/amber.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ func (t *Amber) run(done chan error) {
End: endTime.Local(),
Price: r.PerKwh / 1e2,
}
if r.AdvancedPrice != nil {
ar.Price = r.AdvancedPrice.Predicted / 1e2
}
data = append(data, ar)
}
}
Expand Down
33 changes: 20 additions & 13 deletions tariff/amber/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,25 @@ package amber

const URI = "https://api.amber.com.au/v1/sites/%s/prices?resolution=30"

type AdvancedPrice struct {
Low float64 `json:"low"`
Predicted float64 `json:"predicted"`
High float64 `json:"high"`
}

type PriceInfo struct {
Type string `json:"type"`
Date string `json:"date"`
Duration int `json:"duration"`
StartTime string `json:"startTime"`
EndTime string `json:"endTime"`
NemTime string `json:"nemTime"`
PerKwh float64 `json:"perKwh"`
Renewables float64 `json:"renewables"`
SpotPerKwh float64 `json:"spotPerKwh"`
ChannelType string `json:"channelType"`
SpikeStatus string `json:"spikeStatus"`
Descriptor string `json:"descriptor"`
Estimate bool `json:"estimate"`
Type string `json:"type"`
Date string `json:"date"`
Duration int `json:"duration"`
StartTime string `json:"startTime"`
EndTime string `json:"endTime"`
NemTime string `json:"nemTime"`
PerKwh float64 `json:"perKwh"`
Renewables float64 `json:"renewables"`
SpotPerKwh float64 `json:"spotPerKwh"`
ChannelType string `json:"channelType"`
SpikeStatus string `json:"spikeStatus"`
Descriptor string `json:"descriptor"`
Estimate bool `json:"estimate"`
AdvancedPrice *AdvancedPrice `json:"advancedPrice,omitempty"`
}

0 comments on commit a539310

Please sign in to comment.