Skip to main content
# Get Readings from an Airthings Wave and publish to MQTT server

[Airthings](http://airthings.com) makes a BTLE Radon detector called "Wave". This is an executable intended to be called periodically from Cron or some other scheduler to publish readings to an MQTT server.

## Limitations

This application doesn't implement 'find' as provided in the example at https://airthings.com/raspberry-pi/

## API

```Python
class AirthingsWave:
def __init__(self, config_file):
```

Class instantiation requires a path to a config file in YAML format.

```
mqtt:
broker: 192.168.30.18
port: 1883

waves:
- name: "basement-radon"
addr: 98:07:2d:43:4d:ff
```

Before taking a reading, you should:

```
def ble_connect(self, addr):
```

Then you can:

```
def get_readings(self, p):
def publish_readings(self, name, readings):
```

## Example

From __main__.py:
```python
c = sys.argv[1]

atw=airthingswave.AirthingsWave_mqtt(c)

count=len(atw.waves)
if count > 0:
iter=0
while iter<count:
handle = atw.ble_connect(atw.waves[iter]["addr"])
r = atw.get_readings(handle)
atw.ble_disconnect(handle)
atw.publish_readings(atw.waves[iter]["name"], r)
iter = iter+1
return True
```

Metadata

Release files for airthingswave-mqtt 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for airthingswave-mqtt 0.2
File Size Uploaded Provenance Actions
airthingswave-mqtt-0.2.tar.gz 4.9 kB Without provenance Details for airthingswave-mqtt-0.2.tar.gz

Release files / airthingswave-mqtt-0.2.tar.gz

Download URL airthingswave-mqtt-0.2.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9eb984a3f282e61784ab52d483a1025abd6c442812b35d3dafcc6b9f6e4f6659
BLAKE2b-256 checksum
How to use checksums
932b450fede825f25fcccefcbb05f1fd3cb15b15a8393c743811d2182e26baaa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.9.1 pkginfo/1.4.1 requests/2.18.4 setuptools/36.3.0 requests-toolbelt/0.8.0 tqdm/4.15.0 CPython/3.5.2

Security for airthingswave-mqtt 0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page