Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pvainio/scd30-mqtt

Sensirion SCD30 CO2 sensor MQTT gateway with Home Assistant MQTT discovery
https://github.com/pvainio/scd30-mqtt

co2 co2-sensor home-assistant home-automation homeassistant iot mqtt scd30 sensirion sensirion-scd30

Last synced: 22 days ago
JSON representation

Sensirion SCD30 CO2 sensor MQTT gateway with Home Assistant MQTT discovery

Awesome Lists containing this project

README

        

# Sensirion SCD30 CO2 sensor MQTT gateway for Home Assistant

## Overview

This gateway can be used to publish measurements SCD30 to mqtt.

It supports Home Assistant MQTT Discovery but can also be used without Home Assistant.

Only requirement is MQTT Broker to connect to.

## Example usecase

Attach SCD30 to Raspberry Pi Zero W I2C bus and run this gateway to publish CO2, temperature and humidity to Home Assistant.

## Configuration

Application is configure with environment variables

| variable | required | default | description |
|-----------------|:--------:|---------|-------------|
| SCD30_MQTT_URL | x | | mqtt url, for example tcp://10.1.2.3:8883 |
| SCD30_MQTT_USER | | | mqtt username |
| SCD30_MQTT_PASSWORD | | | mqtt password |
| SCD30_MQTT_CLIENT_ID | | scd30 | mqtt client id |
| SCD30_DEBUG | | false | enable debug output, true/false |
| SCD30_ID | | scd30 | home assistant discovery id |
| SCD30_TEMP_OFFSET | | 150 | temperature compensation offset |
| SCD30_NAME | | SCD30 | home assistant device name |
| SCD30_INTEVAL | | 50 | measurement interval in seconds |
| SCD30_AUTOCAL | | 1 | 1 to enable automatic calibration, 0 to disable |
| SCD30_FORCECAL | | | CO2 ppm to force calibration to |

## Usage

For example with following script
```sh
#!/bin/sh

# Change to your real mqtt url
export MQTT_URL=tcp://localhost:8883

./scd30-mqtt
```

## MQTT Topics used

- homeassistant/status subscribe to HA status changes
- scd30/_id_/co2 publish co2
- scd30/_id_/temperature publish temperature
- scd30/_id_/humidity publish humidity