Skip to content

Protocol Purpleair

Manuel edited this page Aug 30, 2026 · 1 revision

PurpleAir

Setting up PurpleAir hardware by hand, in weewx.conf.

Generated by tools/build_protocols.py. What each protocol needs is written in that tool; what it is called and what goes into the console comes from the code. Do not edit by hand.

There is a web interface for all of this. It is on by default, and the driver prints its address when WeeWX starts:

INFO user.ultimatepush.driver: The web interface is at
http://1.2.3.4:8080/?token=abcdefg12345

Everything on this page can be done there instead, and one thing is much easier: deciding which reading goes into which database column. See Web interface.

What it is

PurpleAir PA-II, PA-II-SD and PA-I air quality sensors

In protocols = auto no, and it does not need to be: naming it under [[polling]] is what switches it on
Named by the name you give the block
Recording from its first answer

The smallest configuration that works

[Station]
    station_type = UltimatePush

[UltimatePush]
    driver = user.ultimatepush.driver
    port = 8000

    [[polling]]
        [[[air]]]
            address = 1.2.3.4
            protocol = purpleair
            interval = 60
            role = extra
            channel = 3

There is nothing to identify and nothing to wait for. The driver knows which sensor answered because it knows which address it asked, so the block above is the whole of the station: it is recording from the first answer, with nothing to adopt and nothing to let in. role = extra puts its readings in columns of their own, which is what you want for a sensor whose thermometer is inside its own housing.

What else it takes

A PurpleAir has nowhere to type a server address into. It is asked rather than pointed, so what this driver needs is the sensor's address on your network.

Give it a fixed address in your router. A sensor whose address moves stops being found, and the log is the only place that says so.

Its thermometer sits inside the housing, next to electronics that are warm, and reads several degrees above the air outside. Set the station up as an extra one and that reading goes to a column of its own instead of into outTemp.

Options of its own

None. Everything that applies to this protocol applies to all of them, and is in Configuration.

Worth knowing

Give the sensor a fixed address in your router, under whatever the router calls a reserved lease. A sensor whose address changes stops being found, and the log is the only place that says so.

Sixty seconds is a sensible interval. The sensor averages over two minutes anyway, so asking every ten buys nothing but traffic on your own network.

Set it up as an extra station. Its thermometer sits inside the housing next to electronics that are warm and reads several degrees above the air outside; PurpleAir correct it before showing it on their map and this driver does not, because a reading adjusted by an amount nobody wrote down is worse than a reading that is plainly the inside of a box. As an extra station it lands in extraTemp, where nothing mistakes it for the air temperature.

Two laser counters means two of every particle reading. The second arrives in its own columns rather than being averaged in, because two counters disagreeing is the one thing that says a sensor is failing.

No sensor yet? python -m user.ultimatepush --fake-purpleair answers like one, and the whole of the above can be tried against it first.

When nothing arrives

Nothing is recorded and the log says the sensor cannot be reached: the address is wrong, or has moved. curl http://1.2.3.4/json from this machine settles which. It is said once and then the driver stays quiet, so look at the start of the log rather than the end.

Something answers and it is refused: whatever is at that address is not a PurpleAir. The usual cause is that the address now belongs to something else.

The temperature is too high: it is measured inside the housing. See above.

No temperature, humidity or pressure at all, and the particle counts are fine: the BME280 on the board has failed or was never fitted. hardwarediscovered in the answer names the chips the sensor found.

More than one station

This is one station among however many others. Which of them fills outTemp, and where the rest of their readings go, is in Several stations.

Clone this wiki locally