Aller au contenu principal

Intensité carbone

Traduction Bêta Non Officielle

Cette page a été traduite par PageTurner AI (bêta). Non approuvée officiellement par le projet. Vous avez trouvé une erreur ? Signaler un problème →

Description

Affiche l'intensité carbone actuelle et prévisionnelle en gCO2/kWh en utilisant les données de l'API Carbon Intensity.

note

Ce segment ne fournit actuellement des données que pour la Grande-Bretagne. La prise en charge d'autres pays pourrait être ajoutée ultérieurement.

Exemple de configuration

attention

L'API peut être lente. Il est recommandé de définir la propriété http_timeout sur une valeur élevée (par exemple 5000).

{
"type": "carbonintensity",
"style": "powerline",
"powerline_symbol": "",
"foreground": "#000000",
"background": "#ffffff",
"background_templates": [
"{{if eq \"very low\" .Index}}#a3e635{{end}}",
"{{if eq \"low\" .Index}}#bef264{{end}}",
"{{if eq \"moderate\" .Index}}#fbbf24{{end}}",
"{{if eq \"high\" .Index}}#ef4444{{end}}",
"{{if eq \"very high\" .Index}}#dc2626{{end}}"
],
"template": " CO₂ {{ .Index.Icon }}{{ .Actual.String }} {{ .TrendIcon }} {{ .Forecast.String }} ",
"options": {
"http_timeout": 5000
}
}

Options

NameTypeDefaultDescription
http_timeoutint20Timeout (in milliseconds) for HTTP requests. The default is 20ms, but you may need to set this to as high as 5000ms to handle slow API requests.

Modèle (info)

modèle par défaut
 CO₂ {{ .Index.Icon }}{{ .Actual.String }} {{ .TrendIcon }} {{ .Forecast.String }}

Propriétés

NameTypeDescription
.ForecastNumberThe forecast carbon intensity in gCO2/kWh. Equal to 0 if no data is available.
.ActualNumberThe actual carbon intensity in gCO2/kWh. Equal to 0 if no data is available.
.IndexIndexA rating of the current carbon intensity. Possible values are "very low", "low", "moderate", "high", or "very high". Equal to "??" if no data is available.
.TrendIconstringAn icon representation of the predicted trend in carbon intensity based on the Actual and Forecast values. Possible values are "↗", "↘", or "→".

Nombre

NameTypeDescription
.Stringstringstring representation of the value

Indice

NameTypeDescription
.Iconstringicon representation of the value