Python driver for Honeywell Midas gas dectectors.
Project description
midas
Python ≥3.5 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
}
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
midas-0.3.2-py2.py3-none-any.whl
(15.5 kB
view hashes)
Close
Hashes for midas-0.3.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90e1168cc2b9c099376cc35dde8c3e3ca0a240211c699dd4d3a9dabd54f05537 |
|
MD5 | 21716b6946b27d409f2ae82060cd2be5 |
|
BLAKE2b-256 | cbd01c87a9ee2c9d156cd9fd7594b58dba82529cdede178fb5f9598b88ed5b85 |