platypush.plugins.gpio.sensor.bme280

class platypush.plugins.gpio.sensor.bme280.GpioSensorBme280Plugin(port=1, **kwargs)[source]

Plugin to interact with a BME280 environment sensor for temperature, humidity and pressure measurements over I2C interface

Requires:

  • pimoroni-bme280 (pip install pimoroni-bme280)
__init__(port=1, **kwargs)[source]
Parameters:port – I2C port. 0 = /dev/i2c-0 (port I2C0), 1 = /dev/i2c-1 (port I2C1)
get_measurement()[source]
Returns:dict. Example:
output = {
    "temperature": 21.0,   # Celsius
    "pressure": 101555.08, # Pascals
    "humidity": 23.543,    # percentage
    "altitude": 15.703     # meters
}