CO2Signal


The co2signal sensor platform queries the CO2Signal API for the CO2 intensity of a specific region. Data can be collected via latitude/longitude or by country code. This API uses the same data as https://www.electricitymap.org/. Not all countries/regions in the world are supported so please consult this website to check local availability.

This platform requires a CO2Signal API key, which can be obtained here. Note that this API key is for personal use only and other options exist when the data is used commercially.

At the moment, the free CO2Signal API only supports the average carbon intensity of a country and not the marginal carbon intensity.

The “free” API key is limited to a limited number of calls. Too many requests can result in data loss.

Configuration

To set up this platform, get your API key and add the following lines to your configuration.yaml file:

sensor:
  - platform: co2signal
    token: YOUR_CO2SIGNAL_API_KEY

By default, the sensor will use your Home Assistant longitude and latitude. More detailed configurations to overwrite this can be found below.

Configuration Variables

token

(string)(Required)Your CO2Signal API key.

latitude

(string)(Optional)The latitude of the location to monitor.

Default value: The latitude defined under the homeassistant key in configuration.yaml.

longitude

(string)(Optional)The longitude of the location to monitor.

Default value: The longitude defined under the homeassistant key in configuration.yaml.

country_code

(string)(Optional)The country code or region code.

To enable the platform and gather data via a specific latitude/longitude, add the following lines to your configuration.yaml file:

sensor:
  - platform: co2signal
    token: YOUR_CO2SIGNAL_API_KEY
    latitude: YOUR_LATITUDE
    longitude: YOUR_LONGITUDE

A similar result can be achieved by using the country code. In that case, use the following lines in your configuration.yaml file:

sensor:
  - platform: co2signal
    token: YOUR_CO2SIGNAL_API_KEY
    country_code: YOUR_COUNTRY_CODE

Example Configurations

Configuration using custom latitude and longitude:

sensor:
  - platform: co2signal
    token: YOUR_CO2SIGNAL_API_KEY
    latitude: 55.4
    longitude: 5.5

Configuration using a country code:

sensor:
  - platform: co2signal
    token: YOUR_CO2SIGNAL_API_KEY
    country_code: BE

Sensor Types

When configured, the platform will create one sensor for each configured location.