From 392ff9472b20d982d40286518cf921d90c403fa9 Mon Sep 17 00:00:00 2001 From: Jef D Date: Sat, 26 Jan 2019 21:43:05 +0100 Subject: [PATCH] Co2Signal platform (#8037) * Add CO2Signal documentation * Add logo from website * Update sensor.co2signal.markdown Modifications after review * :pencil2: Tweak * Update sensor.co2signal.markdown Update after review --- source/_components/sensor.co2signal.markdown | 102 +++++++++++++++++++ source/images/supported_brands/co2signal.png | Bin 0 -> 2348 bytes 2 files changed, 102 insertions(+) create mode 100644 source/_components/sensor.co2signal.markdown create mode 100644 source/images/supported_brands/co2signal.png diff --git a/source/_components/sensor.co2signal.markdown b/source/_components/sensor.co2signal.markdown new file mode 100644 index 00000000000..c8d268db87c --- /dev/null +++ b/source/_components/sensor.co2signal.markdown @@ -0,0 +1,102 @@ +--- +layout: page +title: "CO2Signal" +description: "Instructions on how to use CO2Signal data within Home Assistant" +date: 2019-01-01 21:47 +sidebar: true +comments: false +sharing: true +footer: true +logo: co2signal.png +ha_category: Environment +ha_release: 0.87 +ha_iot_class: "Cloud Polling" +--- + +The `co2signal` sensor platform queries the [CO2Signal](https://www.co2signal.com/) 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](https://www.co2signal.com/). 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. +

+ +## {% linkable_title Configuration %} + +To set up this platform, get your [API key](https://www.co2signal.com/) and add the following lines to your `configuration.yaml` file: + +```yaml +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 %} +token: + description: Your CO2Signal API key. + required: true + type: string +latitude: + description: The latitude of the location to monitor. + required: false + type: string + default: "The latitude defined under the `homeassistant` key in `configuration.yaml`." +longitude: + description: The longitude of the location to monitor. + required: false + type: string + default: "The longitude defined under the `homeassistant` key in `configuration.yaml`." +country_code: + description: The country code or region code. + required: false + type: string +{% endconfiguration %} + +To enable the platform and gather data via a specific latitude/longitude, add the following lines to your `configuration.yaml` file: + +```yaml +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: + +```yaml +sensor: + - platform: co2signal + token: YOUR_CO2SIGNAL_API_KEY + country_code: YOUR_COUNTRY_CODE +``` + +## {% linkable_title Example Configurations %} + +Configuration using custom latitude and longitude: + +```yaml +sensor: + - platform: co2signal + token: YOUR_CO2SIGNAL_API_KEY + latitude: 55.4 + longitude: 5.5 +``` + +Configuration using a country code: + +```yaml +sensor: + - platform: co2signal + token: YOUR_CO2SIGNAL_API_KEY + country_code: BE +``` + +## {% linkable_title Sensor Types %} + +When configured, the platform will create one sensor for each configured location. + diff --git a/source/images/supported_brands/co2signal.png b/source/images/supported_brands/co2signal.png new file mode 100644 index 0000000000000000000000000000000000000000..32879acab9d262b94bcf35300bdbc7080188e73a GIT binary patch literal 2348 zcmV+{3Dfq8P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGmbN~PnbOGLGA9w%&2*F82K~#8N?OW+{ z6h##G-y$cuc9Vcdc~D-!2c;-bP(Tq;)DK=&poo+QC=^r)q9T-FA!0ZJ0iyg3h7fX_ zgB&E;gKFQeXL@&Lws$i--91UPKm6+L+nwp-^{-#Q_h$B?2Y;<(4{i~xG%m^5E1WN^ zG%hW(W0aQJF-pI&`3hLwlx~?FqjZcdR=`T5(q*=Q`=iy3=+_eCR{J=5$ig1o<_4!^N)c|M2G(^pzp z&)O=fAyv@*R0SK@Qo|+=G_q7%OVR$9ny&1#2j8fb8cZj!17Li(p-jipWxlep$M+Zd zZKGJZjPZI-SoWrTO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