Skip to main content
WeeWX Weather

Sky quality readings with weewx-sqm

A WeeWX extension for the Unihedron SQM-LE sky quality meter. It polls the meter over your network, injects live readings into loop packets, and archives median values every interval, so your darkness data lives alongside your weather history.

Derived sky metrics

Beyond raw mag/arcsec², it computes NELM, NSU, and cd/m² for each reading.

Solar and lunar context

Optional Skyfield integration records solar altitude, lunar altitude, and lunar phase with every archive record.

Night-only polling

Skips polling while the sun is up and discards invalid daytime readings, so your archive stays clean.

Requirements

WeeWX 5.2, the WeeWX-Conditions extension, the Skyfield Python package for solar/lunar calculations, and an SQM-LE meter reachable over Ethernet.

Install

Clone or download weewx-sqm, then build and install the extension package (recommended):

cd /path/to/weewx-sqm
python3 build_package.py --set-version 0.1.1
sudo weectl extension install weewx-sqm-le_0.1.1.tar.gz

Restart WeeWX afterwards. Alternatively, install with pip and edit weewx.conf by hand:

cd /path/to/weewx-sqm
python3 -m pip install .
Test connectivity first

The repo includes a socket test script. Run it before installing to confirm your SQM-LE answers on the network.

Configure

Add an [SQM-LE] section to weewx.conf:

OptionWhat it does
hostIP address or hostname of the SQM-LE
portTCP port, default 10001
poll_intervalSeconds between polls
socket_timeoutHow long to wait for a response
solar_alt_maxSkip polling when the sun is above this altitude. -18.0 limits readings to astronomical night
ephemerisPath to the Skyfield ephemeris file

Then register the service under [Engine] [[Services]] by adding user.sqmle.Service to data_services.

Archive fields

The extension archives these fields, so add them to your database schema: sqm, sqmTemp, sqmTime, nelm, cdm2, nsu, solarAlt, lunarAlt, lunarPhase.

Median values are stored each archive interval, and readings of sqm <= 0.0 (daytime or invalid) are discarded. Values appear in your WeeWX output and, if you reinstall the Conditions skin, in its templates too.


Questions or a meter that isn't cooperating? Bring it to Discord or open an issue on GitHub.