cd /news/ai-tools/show-hn-levoit-air-purifier-scolds-m… · home › topics › ai-tools › article
[ARTICLE · art-178216] src=github.com ↗ pub= topic=ai-tools verified=true sentiment=↑ positive

Show HN: Levoit air purifier scolds me over Sonos like an angry mom when I smoke

A developer released levoit-mom-mode, an open-source Python 3.12+ tool that polls Levoit air purifier PM2.5 readings through the VeSync cloud via pyvesync and, when particulate levels spike past a configurable PM25_THRESHOLD or PM25_DELTA, plays a scolding voice clip on a Sonos speaker. The clips are generated with Google's Gemini TTS model gemini-2.5-flash-preview-tts using the Kore voice and an acting prompt, in Turkish, English or any language set via --language, with fallbacks to Edge TTS and macOS say when offline. The script uses SoCo Snapshot to save and restore Sonos playback, caches audio in audio_cache/, enforces a COOLDOWN_SECONDS between scoldings, and adds support for newer purifiers such as the Eleva 300X (LAP-C341S-WEU) through direct deviceProp parsing.

key takeaway

The levoit-mom-mode CLI polls Levoit PM2.5 data via pyvesync, triggers on an absolute PM25_THRESHOLD or PM25_DELTA with a COOLDOWN_SECONDS gap, and generates speech with gemini-2.5-flash-preview-tts (Kore voice), falling back to Edge TTS then macOS say when offline.

read4 min views4 publishedNov 29, 2026
Show HN: Levoit air purifier scolds me over Sonos like an angry mom when I smoke
Image: Michielbdejong (auto-discovered)

Your Levoit air purifier doesn't have a speaker—but your Sonos does.

Whenever PM2.5 spikes in the room, this script uses Gemini TTS to scold you out loud over your Sonos speaker like an angry mom who literally just finished cleaning.

Levoit Purifier ──► VeSync Cloud (pyvesync) ──► PM2.5 Spike Detector
                                                         │
Sonos Speaker ◄── Local HTTP Audio Server ◄── Gemini TTS (Kore + acting prompt)
  • Angry Mom Voice Persona: Powered by Gemini TTS (gemini-2.5-flash-preview-tts , voiceKore ) with expressive acting direction—supports Turkish (tr ), English (en ), or any language via--language .

  • Broad Levoit Support: Works with standardpyvesync air purifiersplus newer models not yet inpyvesync 's device map (like theEleva 300X / LAP-C341S-WEU ) via direct deviceProp parsing.

  • Smart Spike Detection: Triggers on either an absolutePM25_THRESHOLD or a sudden upward jump (PM25_DELTA ), with a configurableCOOLDOWN_SECONDS so it doesn't yell every 45 seconds.

  • Sonos Snapshot & Resume: UsesSoCo`` Snapshot to capture current Sonos state, play the scolding clip at your chosen volume, and restore playback afterward.

  • On-Demand Trigger & Custom Lines: Speak immediately withlevoit-blame say or pass-s /--sentence to deliver any exact phrase.

  • Clip Caching & Offline Fallbacks: Caches generated audio inaudio_cache/ and automatically falls back from Gemini TTS → Edge TTS → macOSsay if offline or unconfigured.

  • Python 3.12+ anduv

  • macOS (uses/usr/bin/afconvert and/usr/bin/afinfo for M4A conversion & duration inspection, plussay as the offline fallback)

  • A Levoit smart air purifier connected toVeSync

  • A Sonos speaker on the same local network

  • A Google Gemini API key (optional if you use--backend edge or--backend macos )

Clone and install dependencies:

git clone https://github.com/guneriu/levoit-mom-mode.git
cd levoit-mom-mode
uv sync

Create your .env file from .env.example:

cp .env.example .env

Fill in your credentials in .env:

  • VESYNC_EMAIL &VESYNC_PASSWORD : Your VeSync mobile app email and password.Signed up with Google? VeSync doesn't provide a separate API key andpyvesync cannot use Google SSO directly. Log out of the VeSync mobile app, tapForgot Password with the same Gmail address, and set a standalone VeSync password (this does not change your Google password).
  • VESYNC_COUNTRY_CODE : Your VeSync account region (US ,DE , etc.).
  • GEMINI_API_KEY : Your Gemini API key for Gemini TTS.
  • SONOS_IP : Optional—leave blank to auto-discover your Sonos speaker, or set its LAN IP.

Check Sonos discovery (read-only) and live Levoit PM2.5 telemetry:

uv run levoit-blame status --sonos-only
uv run levoit-blame status

Generate a TTS clip locally without playing on Sonos:

uv run levoit-blame test-tts -l tr
uv run levoit-blame test-tts -l en -s "I just cleaned it, why are you doing this?!"

Trigger an immediate scolding clip on Sonos (say or test-sonos):

uv run levoit-blame say -l tr

uv run levoit-blame say -l en

uv run levoit-blame say -l en -s "I just cleaned it, why are you doing this?!"
uv run levoit-blame test-sonos -l tr -s "Ya daha yeni temizledim burayı!"

Simulate a PM2.5 spike end-to-end (dry-run by default; add --play-sonos to play):

uv run levoit-blame simulate --pm25 45 -l tr
uv run levoit-blame simulate --pm25 45 -l en --play-sonos

Run the continuous polling monitor:

uv run levoit-blame run --dry-run
uv run levoit-blame run -l tr
uv run levoit-blame run -l en -s "I just cleaned it, why are you doing this?!"
Variable Default Description
VESYNC_EMAIL "" VeSync account email
VESYNC_PASSWORD "" VeSync account password
VESYNC_TIMEZONE Europe/Berlin IANA timezone
VESYNC_COUNTRY_CODE DE VeSync account country code
SONOS_IP "" Sonos speaker IP (blank = auto-discover)
SONOS_VOLUME 35 Announcement volume ( 0–100 )
PM25_THRESHOLD 20 Trigger when PM2.5 reaches this value (µg/m³)
PM25_DELTA 10 Or trigger on a single-poll jump of this size
POLL_INTERVAL_SECONDS 45 VeSync polling interval (keep ≥ 30s to avoid rate limits)
COOLDOWN_SECONDS 300 Minimum seconds between announcements
TTS_BACKEND gemini gemini ,edge , ormacos
GEMINI_API_KEY "" Google Gemini API key
TTS_MODEL gemini-2.5-flash-preview-tts Gemini TTS model
TTS_VOICE Kore Voice name ( Kore ,Gacrux ,Algenib ,Charon , etc.)
TTS_LANGUAGE tr Default phrase & prompt language ( tr ,en , or any code)
TTS_STYLE_PROMPT Angry Turkish mom prompt Custom acting direction prepended for Gemini TTS
HTTP_PORT 8765 Local HTTP port for serving clips to Sonos

Want to switch back to a grumpy uncle or try another vibe? Update .env:

  • Angry Mom (default):TTS_VOICE=Kore (orGacrux for a slightly more mature tone)
  • Grumpy Uncle:TTS_VOICE=Algenib (deep/gravelly) and customizeTTS_STYLE_PROMPT
uv run pytest -v
── more in #ai-tools 4 stories · sorted by recency
── more on @levoit 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/show-hn-levoit-air-p…] indexed:0 read:4min 2026-11-29 · —