Skip to main content

Python driver for Honeywell Midas gas detectors.

Project description


Python ≥3.6 driver for Honeywell Midas gas detectors.


pip install midas


Command Line

To test your connection and stream real-time data, use the command-line interface. You can read the state with:

$ midas

This will output a JSON object which can be further manipulated. See below for object structure.


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('') as detector:
        print(await detector.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': '',       # 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

Download files

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

Files for midas, version 0.4.3
Filename, size File type Python version Upload date Hashes
Filename, size midas-0.4.3-py2.py3-none-any.whl (15.8 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size midas-0.4.3.tar.gz (8.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page