| name | ocd-knob-routine |
| description | Kitchen safety routine for checking stove knobs before sleep or when asked to check/verify knobs, gas, stove, burners, or kitchen safety. Uses the FC22 gas sensor on Arduino UNO Q plus webcam image inspection of knobs/flames and reports a safety verdict. |
| author | Roni Bandini |
OCD Knob Routine
Use this routine to decide whether the stove appears safe, especially before sleep.
Workflow
Step 1 — Run the check script
Run:
python3 /home/arduino/.openclaw/workspace/check.py
Capture the full stdout output and the exit code.
Step 2 — Parse the output
The script prints lines in this exact format:
GAS_RAW=<number>
IMAGE_PATH=<absolute path to jpeg>
Or on failure:
ERROR=<message>
Extract GAS_RAW as an integer and IMAGE_PATH as a string.
The ADC is configured for 10-bit resolution: range 0–1023.
If ERROR is present, skip to Step 5 and report the error.
Step 3 — Evaluate the gas reading
GAS_RAW < 400 → gas level is NORMAL
GAS_RAW >= 400 → gas level is ELEVATED — issue a critical alert immediately without waiting for image analysis
Step 4 — Analyze the image
Load the image at the path returned in IMAGE_PATH.
Inspect it with vision:
- Are all visible knobs in the OFF/closed position?
- Is there any flame, glow, or burner activity visible?
- Is the image clear enough to be conclusive? If not, say so explicitly and name what is unclear.
Step 5 — Compose and SEND the reply
This step is mandatory. Always send the report as a message to the user.
Do not consider the task complete until the report has been sent through the active channel (Telegram or whichever is configured).
Format the reply exactly as:
🛡️ Kitchen Safety Report
FC22 Reading: <GAS_RAW>/1023 — <NORMAL ✅ / ELEVATED ⚠️>
Knob Inspection: <brief visual findings>
Verdict: <final safety message>
Then send the captured image as a media attachment on its own line:
MEDIA:<IMAGE_PATH>
Rules
- Gas has priority:
GAS_RAW >= 400 means danger regardless of what the image shows.
- Only declare safe when gas is
< 400 AND all visible knobs look closed/off.
- If image quality, angle, or occlusion prevents certainty, verdict is INCONCLUSIVE — name what is unclear.
- Never say "no extra reply needed" or consider the task done before the report is sent.
- Keep the report concise and action-oriented.