https://github.com/numat/spmflex
Python driver and command-line tool for Honeywell SPM Flex gas detectors.
https://github.com/numat/spmflex
Last synced: 6 months ago
JSON representation
Python driver and command-line tool for Honeywell SPM Flex gas detectors.
- Host: GitHub
- URL: https://github.com/numat/spmflex
- Owner: numat
- License: gpl-2.0
- Created: 2019-05-17T20:30:48.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-06-07T21:32:47.000Z (about 7 years ago)
- Last Synced: 2025-08-29T01:32:16.877Z (10 months ago)
- Language: Python
- Size: 9.77 KB
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
spmflex
=======
Python ≥3.5 driver for [Honeywell SPM Flex gas detectors](https://www.honeywellanalytics.com/en/products/SPM-Flex).
Installation
============
```
pip install spmflex
```
Usage
=====
### Command Line
To test your connection and stream real-time data, use the command-line
interface. You can read the state with:
```
$ spmflex 192.168.1.100
```
This will output a JSON object which can be further manipulated. See below for
object structure.
### Python
For more complex behavior, you can write a python script. This solely uses
Python ≥3.5's async/await syntax.
```python
import asyncio
from spmflex import GasDetector
async def get():
async with GasDetector('192.168.1.100') as detector:
print(await detector.get())
asyncio.run(get())
```
If the detector is operating at that address, this should output a
dictionary of the form:
###
```python
{
"concentration": 0.0,
"connected": true,
"fault": "No fault",
"flow": 256,
"gas": "AsH3 - Arsine",
"high-alarm threshold": "5.0",
"id": "SPMFLEX08000000",
"ip": "http://192.168.1.100/",
"life": 93.0,
"low-alarm threshold": "2.5",
"temperature": 0,
"units": "ppb"
}
```
This is a cleaned-up version of the data returned. If you want to see all of
it, set `raw=True`.