Tariffs: add outdoor temperature type and OpenMeteo (#27780)

Co-authored-by: Michael Geers <michael@geers.tv>
This commit is contained in:
Daniel Martin 2026-07-17 14:54:56 +02:00 • committed by GitHub
parent 68db0b7727
commit d68e5e5809
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 449 additions and 135 deletions

View file

@ -272,3 +272,6 @@ tariffs:
type: template
template: demo-co2-forecast
base: 350
temperature:
type: template
template: demo-temperature-forecast

View file

@ -97,19 +97,7 @@ func collectTariffRefs() error {
}
// Collect all non-empty refs
if refs.Grid != "" {
references.tariff = append(references.tariff, refs.Grid)
}
if refs.FeedIn != "" {
references.tariff = append(references.tariff, refs.FeedIn)
}
if refs.Co2 != "" {
references.tariff = append(references.tariff, refs.Co2)
}
if refs.Planner != "" {
references.tariff = append(references.tariff, refs.Planner)
}
references.tariff = append(references.tariff, refs.Solar...)
references.tariff = slices.AppendSeq(references.tariff, refs.Used())
return nil
}

View file

@ -1214,6 +1214,7 @@ func configureTariffs(conf *globalconfig.Tariffs, names ...string) (*tariff.Tari
eg.Go(func() error { return configureTariff(conf.Co2, refs.Co2, &tariffs.Co2) })
eg.Go(func() error { return configureTariff(conf.Planner, refs.Planner, &tariffs.Planner) })
eg.Go(func() error { return configureSolarTariffs(conf.Solar, refs.Solar, &tariffs.Solar) })
eg.Go(func() error { return configureTariff(conf.Temperature, refs.Temperature, &tariffs.Temperature) })
if err := eg.Wait(); err != nil {
return &tariffs, &ClassError{ClassTariff, err}
}