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.