Using the UK carbon intensity API
sensor:
- platform: rest
name: Carbon Intensity
resource: https://api.carbonintensity.org.uk/regional/regionid/2
value_template: "{{ value_json.data[0].data[0].intensity.index }}"
json_attributes:
- "data"
Someone cleverer than I, can probably construct a widget etc for this .