Skip to content

feat: add universal smoke and gas detector input plugin#2481

Open
Wanbogang wants to merge 1 commit intoOpenMind:mainfrom
Wanbogang:feature/smoke-gas-detector-input
Open

feat: add universal smoke and gas detector input plugin#2481
Wanbogang wants to merge 1 commit intoOpenMind:mainfrom
Wanbogang:feature/smoke-gas-detector-input

Conversation

@Wanbogang
Copy link
Copy Markdown
Contributor

@Wanbogang Wanbogang commented Mar 17, 2026

Summary

Adds a universal smoke and gas detector input plugin for OM1 that reads
air quality sensor data and converts readings into natural language context
for the LLM. Designed for fire hazard detection in warehouse and industrial
patrol scenarios. #365

Supported Hardware

  • Arduino MQ-2/MQ-7/MQ-135 — via pyserial (serial connector)
  • ENS160 — ScioSense multi-gas sensor via I2C
  • SGP30 — Sensirion air quality sensor via I2C
  • Mock — Simulated data for development and testing

Features

  • Three alert levels: normal, warning (>300 ppm), and danger (>600 ppm)
  • Cooldown logic to suppress repeated identical LLM alerts
  • Optional imports pattern — no hard dependency on hardware libraries
  • Configurable thresholds for smoke and gas independently
  • Arduino sketch example included in docstring

Files Changed

  • src/inputs/plugins/smoke_gas_detector.py — plugin implementation
  • tests/inputs/plugins/test_smoke_gas_detector.py — 51 tests, 97% coverage
  • config/smoke_gas_detector.json5 — example config for safety patrol use case
  • docs/developing/4_inputs.md — added Smoke and Gas Detector to examples list

- Support 4 hardware backends: Arduino MQ sensors via serial, ENS160, SGP30, mock
- Detect normal/warning/danger air quality levels for fire hazard detection
- Cooldown logic to suppress repeated LLM alerts
- Optional imports pattern for hardware libraries
- 51 tests, 97% coverage
- Add smoke_gas_detector.json5 example config
- Add Smoke and Gas Detector to docs/developing/4_inputs.md
@Wanbogang Wanbogang requested review from a team as code owners March 17, 2026 01:31
@github-actions github-actions bot added documentation Improvements or additions to documentation robotics Robotics code changes python Python code tests Test files config Configuration files labels Mar 17, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 17, 2026

Codecov Report

❌ Patch coverage is 97.32143% with 6 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/inputs/plugins/smoke_gas_detector.py 97.32% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration files documentation Improvements or additions to documentation python Python code robotics Robotics code changes tests Test files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant