Skip to main content

Python driver for Honeywell Midas gas detectors.

Project description

midas

Python driver for Honeywell Midas gas detectors.

Installation

uv 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


Download files

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

Source Distribution

midas-0.8.0.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

midas-0.8.0-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file midas-0.8.0.tar.gz.

File metadata

  • Download URL: midas-0.8.0.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for midas-0.8.0.tar.gz
Algorithm Hash digest
SHA256 f865d0f7e86671794b6941c7c782fd166683fa5834d23c2b8b5e241ea0662109
MD5 8245f6d2b206afd687380d6ca4cf9b6d
BLAKE2b-256 dad27655fcea730a5dfd54979c27f4154dc431772837c35bb1b3ad3cd4987fd5

See more details on using hashes here.

File details

Details for the file midas-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: midas-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for midas-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b8d37c1dfa35cd938ce95f6a273c314f200b01c0582a4121a0751d0340fd78c4
MD5 82e04d35be1481e338475f8b0e73add0
BLAKE2b-256 93f50ac7c8cca35c690529c776a734e63a811cc0148e3a0b42fe79ed1aa532be

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page