← 返回
AI智能 Key 中文

Living Room Smoke Detector

Simple smoke/fire detector for living room. Queries Dirigera air sensor every 5 minutes, detects dangerous PM2.5 over 250 or CO2 over 2000 levels, and broadc...
{"answer":"客厅简易烟感探测器。每5分钟查询Dirigera空气传感器,检测PM2.5超250或CO2超2000的危险水平并广播..."}
maverick-2
AI智能 clawhub v1.0.0 1 版本 99889.9 Key: 需要
★ 0
Stars
📥 907
下载
💾 12
安装
1
版本
#latest

概述

Living Room Smoke Detector

A simple, focused smoke and fire detection system that monitors the living room ALPSTUGA air sensor via the Dirigera hub.

What It Does

  • Queries Dirigera directly every 5 minutes (not from database)
  • Simple state only - keeps just the latest reading, no history
  • Detects danger: PM2.5 > 250 µg/m³ OR CO2 > 2000 ppm
  • Continuous alert - plays "Attention! Abnormal smoke level detected" on Mac speaker
  • Loops until cleared - keeps playing every 5 seconds until air quality normalizes
  • Backup smoke alarm - works alongside your regular smoke detector

Setup

1. Copy Alert Sound (optional)

If you already have the alert sound from the air monitor skill:

cp ~/.openclaw/workspace/skills/living-room-air-monitor/data/smoke_alert_message.mp3 \
   ~/.openclaw/workspace/skills/living-room-smoke-detector/data/alert.mp3

Otherwise it will auto-generate on first run.

2. Cron Setup

Add to crontab to check every 5 minutes:

*/5 * * * * /opt/homebrew/bin/python3 /Users/macmini/.openclaw/workspace/skills/living-room-smoke-detector/scripts/smoke_detector.py >> /tmp/smoke_detector.log 2>&1

Usage

Manual Check

python3 ~/.openclaw/workspace/skills/living-room-smoke-detector/scripts/smoke_detector.py

View Status

# Latest reading
cat ~/.openclaw/workspace/skills/living-room-smoke-detector/data/detector_state.json

# Log
tail -f /tmp/smoke_detector.log

How It Works

  1. Cron triggers every 5 minutes
  2. Fetches data directly from Dirigera hub
  3. Checks thresholds:
    • PM2.5 > 250 µg/m³ (smoke particles)
    • CO2 > 2000 ppm (combustion byproduct)
  4. If danger detected:
    • Saves state (alert_active = true)
    • Enters alert loop
    • Plays alert sound every 5 seconds
    • Re-checks sensor between plays
    • Exits loop when air clears
  5. If normal: Updates state and exits

State File

data/detector_state.json:

{
  "latest_reading": {
    "pm25": 3,
    "co2": 525,
    "time": "2026-02-25T20:30:00"
  },
  "alert_active": false,
  "last_check": "2026-02-25T20:30:00"
}

Alert Behavior

When danger is detected:

  • Mac speaker plays: "Attention! Abnormal smoke level detected"
  • Waits 5 seconds
  • Checks sensor again
  • Repeats until PM2.5 ≤ 250 AND CO2 ≤ 2000
  • Press Ctrl+C to stop manually if needed

Files

FilePurpose
---------------
scripts/smoke_detector.pyMain detection script
data/alert.mp3Alert sound file
data/detector_state.jsonLatest reading and status

Dependencies

  • Python 3.x
  • Dirigera hub access (192.168.1.100)
  • Auth token at ~/.openclaw/workspace/.dirigera_token
  • macOS afplay (built-in)
  • say and ffmpeg (for alert generation)

Differences from Air Monitor Skill

FeatureAir MonitorSmoke Detector
--------------------------------------
Data storageFull SQLite databaseLatest reading only
Query sourceDatabaseDirigera directly
FrequencyEvery 2 minEvery 5 min
PurposeHistory + chartsImmediate alerting
AlertSingle playContinuous loop
ComplexityMulti-featureSingle-purpose

Use both for complete coverage: air monitor for data logging, smoke detector for focused alerting.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 17:40 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 714 📥 244,054

Living Room Air Monitor

maverick-2
监测并报告客厅空气质量数据。每小时从Dirigera连接的空气传感器收集温度、湿度、PM2.5和CO2读数。
★ 0 📥 289
ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,362 📥 318,871