radoneye


Nameradoneye JSON
Version 2.0.1 PyPI version JSON
download
home_pageNone
SummaryAPI and CLI for Ecosense RadonEye devices
upload_time2024-06-18 03:27:59
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT License Copyright (c) 2022 Artem Butusov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords ecosense radoneye rd200 rd200n rd200p
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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   | Version | Supported | Tested by                  |
| ------ | ------- | --------- | -------------------------- |
| RD200  | 1       | YES       | Tested by henry@fiatlux.us |
| RD200N | 2       | YES       | Tested by author           |
| RD200P | 2       | YES?      | Pending testing            |

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       |
| 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:

```py
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)

```sh
$ 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

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "radoneye",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "Ecosense, RadonEye, RD200, RD200N, RD200P",
    "author": null,
    "author_email": "Artem Butusov <art.sormy@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/f3/7f/b7a49db3a278dde23f5dbc1b2a321c233343a91cd04778395559dba0b65c/radoneye-2.0.1.tar.gz",
    "platform": null,
    "description": "# Ecosense RadonEye CLI and API for Python\n\nProvides simple and convinient Python API to communicate with RadonEye bluetooth devices.\n\nBuilt as an alternative to half done similar projects where either 1 or 2 version is supported, not\nall status properties are decoded, no history support, no beep and alarm support etc.\n\nDevice support list:\n\n| Name   | Version | Supported | Tested by                  |\n| ------ | ------- | --------- | -------------------------- |\n| RD200  | 1       | YES       | Tested by henry@fiatlux.us |\n| RD200N | 2       | YES       | Tested by author           |\n| RD200P | 2       | YES?      | Pending testing            |\n\nCapability support list:\n\n| Name                       | Version 1 | Version 2 |\n| -------------------------- | --------- | --------- |\n| Read serial number         | YES       | YES       |\n| Read software version      | YES       | YES       |\n| Read latest level          | YES       | YES       |\n| Read daily average level   | YES       | YES       |\n| Read monthly average level | YES       | YES       |\n| Read peak historical level | YES       | YES       |\n| Read raw particle counts   | YES       | YES       |\n| Read uptime                | YES       | YES       |\n| Read history               | YES       | YES       |\n| Trigger beep               | YES       | YES       |\n| Read alarm settings        | YES       | YES       |\n| Write alarm settings       | YES       | YES       |\n| Read unit settting         | YES       | YES       |\n| Write unit settting        | YES       | YES       |\n| Erase all data             | NO        | NO        |\n\n## Usage (API)\n\nScan for all available devices, beep, read status and history:\n\n```py\nimport asyncio\nimport json\nfrom sys import stderr\n\nfrom radoneye import RadonEyeClient, RadonEyeScanner\n\n\nasync def main():\n    for dev in await RadonEyeScanner.discover():\n        print(f\"Device: {dev}\")\n\n        async with RadonEyeClient(dev) as client:\n            try:\n                await client.beep()\n                print(\"Beep: ok\")\n            except Exception:\n                print(\"Unable to beep due to error\", file=stderr)\n\n            try:\n                print(f\"Status: {json.dumps(await client.status())}\")\n            except Exception:\n                print(\"Unable to obtain status due to error\", file=stderr)\n\n            try:\n                print(f\"History: {json.dumps(await client.history())}\")\n            except Exception:\n                print(\"Unable to obtain history due to error\", file=stderr)\n\n            try:\n                print(\"Setting up alarm\")\n                await client.set_alarm(enabled=True, level=2.0, unit=\"pci/l\", interval=60)\n            except Exception:\n                print(\"Unable to set alarm due to error\", file=stderr)\n\n            try:\n                print(\"Setting up unit\")\n                await client.set_unit(\"pci/l\")\n            except Exception:\n                print(\"Unable to set unit due to error\", file=stderr)\n\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n## Usage (CLI)\n\n```sh\n$ pip3 install radoneye\n\n$ radoneye --help\n\n$ radoneye list --help\n$ radoneye list\n70C12E8A-27F6-3AEC-0BAD-95FA94BF17A9\tFR:RU22201030383\n3775964E-C653-C00C-7F02-7C03F9F0122D\tFR:RU22204180050\n\n$ radoneye beep --help\n$ radoneye beep 70C12E8A-27F6-3AEC-0BAD-95FA94BF17A9\nbeep\n\n$ radoneye status --help\n$ radoneye status 70C12E8A-27F6-3AEC-0BAD-95FA94BF17A9\nalarm_enabled\tyes\nalarm_interval_minutes\t60\nalarm_level_bq_m3\t74\nalarm_level_pci_l\t2.0\ncounts_current\t0\ncounts_previous\t1\ncounts_str\t0/1\nday_avg_bq_m3\t7\nday_avg_pci_l\t0.19\ndisplay_unit\tpci/l\nfirmware_version\tV2.0.2\nlatest_bq_m3\t7\nlatest_pci_l\t0.19\nmodel\tRD200N\nmonth_avg_bq_m3\t0\nmonth_avg_pci_l\t0.0\npeak_bq_m3\t35\npeak_pci_l\t0.95\nserial\tRU22201030383\nuptime_minutes\t20734\nuptime_str\t14d09h34m\n\n$ radoneye history --help\n$ radoneye history 70C12E8A-27F6-3AEC-0BAD-95FA94BF17A9\n#\tBq/m3\tpCi/L\n1\t2\t0.05\n2\t9\t0.24\n3\t20\t0.54\n4\t10\t0.27\n5\t10\t0.27\n6\t5\t0.14\n7\t5\t0.14\n8\t3\t0.08\n9\t10\t0.27\n10\t10\t0.27\n...\n\n$ radoneye unit --help\n$ radoneye unit 70C12E8A-27F6-3AEC-0BAD-95FA94BF17A9\npci/l\n$ radoneye unit 70C12E8A-27F6-3AEC-0BAD-95FA94BF17A9 --unit bq/m3\nbq/m3\n$ radoneye unit 70C12E8A-27F6-3AEC-0BAD-95FA94BF17A9\nbq/m3\n\n$ radoneye alarm --help\n$ radoneye alarm 70C12E8A-27F6-3AEC-0BAD-95FA94BF17A9\nalarm_enabled\tyes\nalarm_interval_minutes\t60\nalarm_level_bq_m3\t74\nalarm_level_pci_l\t2.0\n$ radoneye alarm --status on --level 2.0 --unit pci/l --interval 60\nalarm_enabled\tyes\nalarm_interval_minutes\t60\nalarm_level_bq_m3\t74\nalarm_level_pci_l\t2.0\n```\n\nNOTE: On macOS bluetooth addresses are obfuscated to UUIDs.\n\n## License\n\nMIT\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2022 Artem Butusov  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "API and CLI for Ecosense RadonEye devices",
    "version": "2.0.1",
    "project_urls": {
        "Homepage": "https://github.com/sormy/radoneye",
        "Issues": "https://github.com/sormy/radoneye/issues"
    },
    "split_keywords": [
        "ecosense",
        " radoneye",
        " rd200",
        " rd200n",
        " rd200p"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "57529471c9e22acb4321b3690a64f79c239385acad73bbdfd96f87ba38675637",
                "md5": "6b90bc1e7d3f5d943ab6cd0436af586f",
                "sha256": "27a8c7aa80d7e025dd39c313d2d48dac2b0f3438031edf77e792879dde5f037a"
            },
            "downloads": -1,
            "filename": "radoneye-2.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6b90bc1e7d3f5d943ab6cd0436af586f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 16340,
            "upload_time": "2024-06-18T03:27:56",
            "upload_time_iso_8601": "2024-06-18T03:27:56.437682Z",
            "url": "https://files.pythonhosted.org/packages/57/52/9471c9e22acb4321b3690a64f79c239385acad73bbdfd96f87ba38675637/radoneye-2.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f37fb7a49db3a278dde23f5dbc1b2a321c233343a91cd04778395559dba0b65c",
                "md5": "2da83b9d3262937082fb716266dc1af6",
                "sha256": "8da311e1f603e555cdffb5507043004c9dfb15b1fe2e67574f7f83270d63b356"
            },
            "downloads": -1,
            "filename": "radoneye-2.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "2da83b9d3262937082fb716266dc1af6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 14275,
            "upload_time": "2024-06-18T03:27:59",
            "upload_time_iso_8601": "2024-06-18T03:27:59.996669Z",
            "url": "https://files.pythonhosted.org/packages/f3/7f/b7a49db3a278dde23f5dbc1b2a321c233343a91cd04778395559dba0b65c/radoneye-2.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-18 03:27:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sormy",
    "github_project": "radoneye",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "tox": true,
    "lcname": "radoneye"
}
        
Elapsed time: 0.35165s