>>> Join Us in the Fight Against Air Pollution

AirGradient Forum

Debugging local MQTT connectivity

I’m trying to use the mqtt connection setting on the api page to send data from my diy pro model to my local MQTT broker (on an IoT stack). I’ve verified that the MQTT broker works with other systems, but can’t get the airgradient to push to it.

Is it actually sending MQTT from the server backend, not the local device on my network?

Thanks,
J

This functionality is currently not supported for the DIY firmware but you could probaby pull the data via our API.
https://api.airgradient.com/public/docs/api/v1/

is LOCAL API available on AirGradient ONE?
I checked API documentation, but it’s not clear whether this is cloud-only API or we can also query local device?

Currently you cannot query the local device. The device will only push out data as POST requests.
Since firmware is open source you can probably change that and implement a local server.

It would be great if local API endpoints were exposed for querying the device periodically.
Flashing the firmware is always a risk. It would allow to pull information into Home Assistant easilly via endpoint polling.

Somebody has done it already: AirGradient Integrations - #3 by Themis3000

This is super disappointing. I bought this device thinking it had MQTT support built in and this doesn’t work?

1 Like

I’m pretty sure it does not at this time. But I believe it is on the roadmap for the official Arduino code.

There is also ESPHome firmware you could flash. It doesn’t have mqtt enabled by default, as it is normally used to communicate directly with HomeAssistsnt, but there are instructions to add it with just a few lines

The aim is to get feature complete with our old generation of the monitor which had the local MQTT functionality. I will discuss with our dev team and get back to you.

1 Like

Hey Chuck, I got this code working on mine relatively painlessly. Note, I think it switches the air gradient API dashboard call for the local MQTT. You’d need to modify it if you wanted both.

1 Like