Add Airthings air quality ability#215
Add Airthings air quality ability#215brianchilders wants to merge 5 commits intoopenhome-dev:devfrom
Conversation
🔀 Branch Merge CheckPR direction: ✅ Passed — |
✅ Community PR Path Check — PassedAll changed files are inside the |
✅ Ability Validation Passed |
🔍 Lint Results🔧 Auto-formattedSome files were automatically cleaned and formatted with
✅
|
brianchilders
left a comment
There was a problem hiding this comment.
I have reviewed the changes and it looks like it's primarily formatting changes.
|
Hey @brianchilders, thanks for the submission — the ability is well structured and the error handling is thorough! Found two things that need to be addressed before this can be approved:
sample_results = []
for d in chosen_devices:
result = await self._get_latest_samples(token, d.get("id", ""))
sample_results.append(result)
|
uzair401
left a comment
There was a problem hiding this comment.
Hey @brianchilders, ran the ability through our voice naturalness audit. Here are a few suggestions to make it feel more natural on a smart speaker:
1. Hardcoded string matching — device selection
if "all" in reply_lower only catches the word "all" — a user might say "both", "every one", "all of them", "all devices", or "give me everything". Expand the check:
if any(w in reply_lower for w in ["all", "both", "every", "all of them", "all devices", "everything"]):
return devices2. No exit detection in device selection
If a user says "never mind" or "cancel" during device selection, it silently falls through to the first device instead of exiting. Add an exit check before processing the reply:
EXIT_WORDS = ["never mind", "forget it", "stop", "cancel", "exit", "quit"]
if any(w in reply_lower for w in EXIT_WORDS):
self.capability_worker.resume_normal_flow()
return []3. LLM output has no word limit
The system prompt says "Be concise" but doesn't set a hard limit — the LLM could return a long response that goes straight into speak(). Add to the system prompt:
"Respond in 1-2 sentences, maximum 30 words. Plain spoken English only."
4. A few spoken strings to tighten up
"Airthings isn't set up yet. Please add your Client ID and Client Secret to the main.py file and try again."— mentionsmain.pywhich means nothing to a voice user. Suggest: "Airthings isn't set up yet. You'll need to add your credentials first.""I found {len(devices)} devices: {device_names}. Which one would you like, or say 'all' for all of them?"— "say 'all'" is a screen instruction. Suggest: "Found {len(devices)} devices: {device_names}. Which one, or all of them?""Note: the readings for ... are more than an hour old and may not reflect current conditions."— slightly formal. Suggest: "Heads up — readings for {stale_names} are over an hour old, so they might be off.""I couldn't find a device matching that name, so I'll use {first_name}."— Suggest: "Didn't catch that, using {first_name}."
Please address all of the above along with the SDK blockers mentioned in the earlier comment, then push your fixes and we'll take another look!
…quential gather, voice naturalness fixes
|
Made recommended changes. |
What does this Ability do?
Fetches live indoor air quality readings from your Airthings devices and speaks a plain-English summary, flagging any values that exceed WHO/EPA/EU health guidelines for CO2, VOC, PM2.5, radon, and humidity.
Suggested Trigger Words
Type
External APIs
Testing
Checklist
community/my-ability-name/main.pyfollows SDK pattern (extendsMatchingCapability, hasregister_capability+call)README.mdincluded with description, suggested triggers, and setupresume_normal_flow()called on every exit pathprint()— usingeditor_logging_handlerredis,connection_manager,user_config)asyncio.sleep()orasyncio.create_task()— usingsession_tasksAnything else?
Demo Video on YouTube: https://youtu.be/WuVuMUek63c