Python driver for Honeywell Midas gas detectors.
Project description
midas
Python ≥3.8 driver for Honeywell Midas gas detectors.
Installation
pip install midas
Usage
Command Line
To test your connection and stream real-time data, use the command-line interface. You can read the state with:
$ midas 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.
import asyncio
from midas 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:
{
'alarm': 'none', # Can be 'none', 'low', or 'high'
'concentration': 0.0, # Current gas concentration reading
'connected': True, # Monitors heartbeat for connection
'fault': { # Fault data, when applicable
'code': 'F39',
'condition': 'User has generated a simulated fault.',
'description': 'Simulated fault',
'recovery': 'Reset simulated fault.',
'status': 'Instrument fault'
},
'flow': 514, # Flow rate, in cc / minute
'high-alarm threshold': 2.0, # Threshold concentration for high alarm trigger
'ip': '192.168.1.192', # IP address of connection, can be used to link to Honeywell's own web interface
'life': 538.95, # Days until cartridge replacement required
'low-alarm threshold': 1.0, # Threshold concentration for low alarm trigger
'state': 'Monitoring', # Can be any option in `gas_detector.monitoring_status_options`
'temperature': 26, # Detector temperature, in celsius
'units': 'ppm' # Units for concentration values
}
Additionally, there are four commands which can be sent to the device
- Clear all alarms and faults -
detector.clear_alarms_and_faults()
- Inhibit alarms -
detector.inhibit_alarms()
- Inhibit alarms and faults -
detector.inhibit_alarms_and_faults()
- Turn off inhibition -
detector.remove_inhibit()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file midas-0.7.0.tar.gz
.
File metadata
- Download URL: midas-0.7.0.tar.gz
- Upload date:
- Size: 18.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92f2838afb0208714f440b6d867b5f2bcbeea74d16eab3b1838c32454739fe90 |
|
MD5 | ba7fb9d9b46b5948b7af7bbc5b58c671 |
|
BLAKE2b-256 | a7110e44122fe9581ac72ad791dc34834f0ea2cde7b907a191db5d102d0407b4 |
File details
Details for the file midas-0.7.0-py3-none-any.whl
.
File metadata
- Download URL: midas-0.7.0-py3-none-any.whl
- Upload date:
- Size: 17.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8882c7db8b18aac86fd1e0b1358f56f1f60a002ce881d5fd477fdced8be92cfe |
|
MD5 | fe3985cd4508a383bfe9a494ead1da9a |
|
BLAKE2b-256 | e2b14fb5f3a8b2b2ea651b16ba68deed90bdba2657c902cd7548c13dfefede64 |