And I need help to get the data to MQTT to home assistant. That I believe would be the easiest way to get data to HASS.
Before you ask why not the use the BME680 sensor component. It’s a way more sophisticated implementation made by the manufacturer that calibrates itself that hopefully will give more meaningful results for air quality.
People did their best to get to work here but unfortunately, Bosch doesn’t offer its library in python.
The answer to 1. is to use the mosquitto_dev package, which installs libmosquitto
If all you are doing is posting messages, it should be straightforward.
But you might be able to publish data from your existing app using a pipe directly to mosquitto_pub. This is an example from the man page
Send parsed electricity usage data from a Current Cost meter, reading
from stdin with one line/reading as one message:
· read_cc128.pl | mosquitto_pub -t sensors/cc128 -l
The mosquitto_pub works however I’m not sure if I can make it send as JSON to be parsed by Home Assistant. Couldn’t find on the mosquitto_pub documentation.
I think it might be easy to adapt the example to this code
You don’t necessarily have to convert to JSON prior to publishing to MQTT for HA to consume. You can always parse the text as-is. Here is a sample code that parses individual values from the text.
Yes, luckily it had a friendly print output part that I added the {" " : " "}.
This is how it looks home/pizero/bme680 {"IAQ_Accuracy": "1","IAQ":"25.00","Temperature": "25.19","Humidity": "44.71","Pressure": "994.80","Gas": "226105","Status": "0"}
Excellent thread and may rescue me as I have been a bit stupid! I assumed the BME680 component would allow access to a remote Rpi (or similar) via IP Address! I have some experience of using MQTT as currently using it to monitor heat pump metrics but is there a simple guide on how to get the BME680 connected to a remote Rpi to the HA system?
I am impressed with this sensor’s capabilities though. Pretty awesome for something so small and relatively inexpensive. I now need a way to get the sensor away from the CPU as the temp is showing about 7c too high.