Skip to main content

API and CLI for Ecosense RadonEye devices

Project description

Ecosense RadonEye CLI and API for Python

Provides simple and convinient Python API to communicate with RadonEye bluetooth devices.

Built as an alternative to half done similar projects where either 1 or 2 version is supported, not all status properties are decoded, no history support, no beep and alarm support etc.

Device support list:

Name API Supported Tested by
RD200 v1 YES Tested by henry@fiatlux.us
RD200P ? ?
RD200N v2 YES Tested by author
RD200P2 ? ?
RD200V3 v2 YES Tested by @PhLacoude

Capability support list:

Name Version 1 Version 2
Read serial number YES YES
Read software version YES YES
Read latest level YES YES
Read daily average level YES YES
Read monthly average level YES YES
Read peak historical level YES YES
Read raw particle counts YES YES
Read uptime YES YES
Read history YES YES
Read shock status NO NO
Trigger beep YES YES
Read alarm settings YES YES
Write alarm settings YES YES
Read unit settting YES YES
Write unit settting YES YES
Erase all data NO NO

Usage (API)

Scan for all available devices, beep, read status and history:

import asyncio
import json
from sys import stderr

from radoneye import RadonEyeClient, RadonEyeScanner


async def main():
    for dev in await RadonEyeScanner.discover():
        print(f"Device: {dev}")

        async with RadonEyeClient(dev) as client:
            try:
                await client.beep()
                print("Beep: ok")
            except Exception:
                print("Unable to beep due to error", file=stderr)

            try:
                print(f"Status: {json.dumps(await client.status())}")
            except Exception:
                print("Unable to obtain status due to error", file=stderr)

            try:
                print(f"History: {json.dumps(await client.history())}")
            except Exception:
                print("Unable to obtain history due to error", file=stderr)

            try:
                print("Setting up alarm")
                await client.set_alarm(enabled=True, level=2.0, unit="pci/l", interval=60)
            except Exception:
                print("Unable to set alarm due to error", file=stderr)

            try:
                print("Setting up unit")
                await client.set_unit("pci/l")
            except Exception:
                print("Unable to set unit due to error", file=stderr)


if __name__ == "__main__":
    asyncio.run(main())

Usage (CLI)

$ pip3 install radoneye

$ radoneye --help

$ radoneye list --help
$ radoneye list
70C12E8A-27F6-3AEC-0BAD-95FA94BF17A9	FR:RU22201030383
3775964E-C653-C00C-7F02-7C03F9F0122D	FR:RU22204180050

$ radoneye beep --help
$ radoneye beep 70C12E8A-27F6-3AEC-0BAD-95FA94BF17A9
beep

$ radoneye status --help
$ radoneye status 70C12E8A-27F6-3AEC-0BAD-95FA94BF17A9
alarm_enabled	yes
alarm_interval_minutes	60
alarm_level_bq_m3	74
alarm_level_pci_l	2.0
counts_current	0
counts_previous	1
counts_str	0/1
day_avg_bq_m3	7
day_avg_pci_l	0.19
display_unit	pci/l
firmware_version	V2.0.2
latest_bq_m3	7
latest_pci_l	0.19
model	RD200N
month_avg_bq_m3	0
month_avg_pci_l	0.0
peak_bq_m3	35
peak_pci_l	0.95
serial	RU22201030383
uptime_minutes	20734
uptime_str	14d09h34m

$ radoneye history --help
$ radoneye history 70C12E8A-27F6-3AEC-0BAD-95FA94BF17A9
#	Bq/m3	pCi/L
1	2	0.05
2	9	0.24
3	20	0.54
4	10	0.27
5	10	0.27
6	5	0.14
7	5	0.14
8	3	0.08
9	10	0.27
10	10	0.27
...

$ radoneye unit --help
$ radoneye unit 70C12E8A-27F6-3AEC-0BAD-95FA94BF17A9
pci/l
$ radoneye unit 70C12E8A-27F6-3AEC-0BAD-95FA94BF17A9 --unit bq/m3
bq/m3
$ radoneye unit 70C12E8A-27F6-3AEC-0BAD-95FA94BF17A9
bq/m3

$ radoneye alarm --help
$ radoneye alarm 70C12E8A-27F6-3AEC-0BAD-95FA94BF17A9
alarm_enabled	yes
alarm_interval_minutes	60
alarm_level_bq_m3	74
alarm_level_pci_l	2.0
$ radoneye alarm --status on --level 2.0 --unit pci/l --interval 60
alarm_enabled	yes
alarm_interval_minutes	60
alarm_level_bq_m3	74
alarm_level_pci_l	2.0

NOTE: On macOS bluetooth addresses are obfuscated to UUIDs.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

radoneye-2.0.3.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

radoneye-2.0.3-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file radoneye-2.0.3.tar.gz.

File metadata

  • Download URL: radoneye-2.0.3.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for radoneye-2.0.3.tar.gz
Algorithm Hash digest
SHA256 930a9ec3ca6523d504d62c295a1fa7d784a01b4f107b3aebcaabed78394231de
MD5 60a3d9f4cce7f27fc990ab9993127b43
BLAKE2b-256 5c51f5cdadf7d78fd7dbb39c677f0772c3d7bf83862211470f562df3951cc69f

See more details on using hashes here.

File details

Details for the file radoneye-2.0.3-py3-none-any.whl.

File metadata

  • Download URL: radoneye-2.0.3-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for radoneye-2.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4c9c0acad54d55a1cfdb3f94311c471b9909bd67850c81926cf0880baf28f99b
MD5 75e4b272c2c3ac78dd0789b1acb5d71e
BLAKE2b-256 118813bba84846f6bb596f9b6efaa2095c418ed998dce284b61304ecd316dd4b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page