falkaer / bme680-mqtt

Publish bme680 data via MQTT

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bme680-mqtt

Modifies example by Pimoroni to publish bme680 data via MQTT.

To add the MQTT output to Home-assistant, we use an MQTT-switch. Assuming you have your Home-assistant config split into seperate files, in your sensors.yaml file, add the following:

- platform: mqtt
  name: 'bme680-temperature'
  state_topic: 'bme680-temperature'
  unit_of_measurement: '°C'
- platform: mqtt
  name: 'bme680-humidity'
  state_topic: 'bme680-humidity'
  unit_of_measurement: '%'
- platform: mqtt
  name: 'bme680-pressure'
  state_topic: 'bme680-pressure'
  unit_of_measurement: 'hPa'
- platform: mqtt
  name: 'bme680-air_qual'
  state_topic: 'bme680-air_qual'
  unit_of_measurement: '%'

I then created a group, in groups.yaml:

BME680:
  entities:
    - sensor.bme680temperature
    - sensor.bme680pressure
    - sensor.bme680humidity
    - sensor.bme680air_qual

Finally you may want to customise the look of the sensors in the Home-assistant front end.

About

Publish bme680 data via MQTT

License:MIT License


Languages

Language:Python 92.3%Language:Dockerfile 7.7%