Skip to content

feat(telemetry): surface frzWater and sensHealth in the UI (#873) - #876

Draft
onemec wants to merge 7 commits into
sleepypod:devfrom
onemec:feat/stream-groups-telemetry
Draft

onemec wants to merge 7 commits into
sleepypod:devfrom
onemec:feat/stream-groups-telemetry

Conversation

@onemec

@onemec onemec commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #872, addressing all three telemetry features tracked in #873 to surface frzWater and sensHealth in the UI:

  1. Stream Groups: Mapped frzWater → freezer and sensHealth → presence in streamGroups.ts for the live stream inspector.
  2. Cover Disconnect Alerting: Driven by sensHealth, surfacing explicit left/right cover sensor disconnect warnings in:
    • System Dashboard Attention Card (cover-disconnect item)
    • Sidebar Footer status (usePodHealth)
    • Sensors view Presence Card (Disconnected state & badge)
      Strictly avoids false alarms on pods running older firmware that never emit sensHealth.
  3. Capacitive Water Tank Gauge: 5-bar gauge (WaterTankGauge) and priming status in WaterLevelCard (Status / Hardware view) and FreezerHealthCard (System → Sensors view), with fallback to binary OK/Low when frzWater is absent or capValid is false.

Verification

  • Unit & Component Tests: 227 passing Vitest tests across status, Sensors, diagnostics, and AppShell.
  • Typecheck & Lint: pnpm exec tsc --noEmit and pnpm eslint clean with 0 errors.
  • Live Hardware: Deployed and verified on Pod 3 hub (STM32 firmware cover sensor v5.5.22.0, thermal controller v1.6.114) via ./scripts/deploy. Service running with zero unknown frame warnings and clean HTTP 200 responses on /en/system and /en/system?tab=sensors.

Closes #873

@vercel

vercel Bot commented Oct 29, 2026

Copy link
Copy Markdown

@onemec is attempting to deploy a commit to the therealng's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@onemec

onemec commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

Verification & Acceptance Findings Against Live Pod 3 and Test Matrix

Detailed validation results confirming all criteria from #873:

Validation Matrix

Feature / Criteria from #873 Validation Method What It Yielded (Observed Result)
1. Stream Groups Mapping
streamGroups.ts maps frzWater → freezer and sensHealth → presence
• Vitest: sensorLogic.test.ts
• Web UI inspect on pod: /en/system?tab=sensors
PASS: streamGroups.freezer contains frzWater; streamGroups.presence contains sensHealth. Verified packet inspect displays them in respective sensor cards.
2. Capacitive Gauge (0–5 bars)
Renders 5-bar meter when capValid: true
• Vitest: WaterTankGauge.test.tsx, WaterLevelCard.test.tsx, sensorCards.test.tsx PASS: Renders 5 distinct segments for levels 0 through 5, dynamic accessibility aria-valuenow (0–5), and percentage badge (20%, 40%, 60%, 80%, 100%).
3. Priming Indicator
Shows priming and needs-priming states
• Vitest: WaterTankGauge.test.tsx
• Live Pod WebSocket: Captured live frame frzWater (isPriming: 1)
PASS: Live pod returned {"type":"frzWater","version":1,"isPriming":1,"hasWater":1,"capValid":0,"capLevel":0,"needsPriming":0}. UI rendered active status "Priming tank...".
4. Water Gauge Fallback (Older Pods or capValid: false)
Falls back to binary OK / Low when frzWater is absent or uncalibrated
• Vitest: WaterTankGauge.test.tsx
• Live Pod Telemetry: Live pod currently has capValid: 0
PASS: In both unit tests (frame = null) and live pod telemetry (capValid: 0), gauge gracefully bypassed the 5-bar meter and cleanly displayed OK based on hasWater: 1 / DAC deviceStatus.waterLevel.
5. Cover Disconnect Alerting
Per-side cover disconnect warning driven by sensHealth
• Vitest: dashboardLogic.test.ts, footerStatus.test.ts, sensorCards.test.tsx PASS:
• Left disconnected → "Left cover sensor disconnected"
• Right disconnected → "Right cover sensor disconnected"
• Both disconnected → "Cover sensor disconnected"
• Presence Card reflects Disconnected badge and caption.
6. No False Alarms on Older Firmware
Older pods that never emit sensHealth must not flag disconnect warnings
• Vitest: dashboardLogic.test.ts (sensHealth: null)
• Vitest: footerStatus.test.ts
PASS: When sensHealth is null or version !== 1, zero attention items are generated and footer remains healthy.
7. Pod Service Stability & Daemon Log Integrity
No crashes, memory pressure, or unknown frame warnings
• Pod SSH: systemctl status sleepypod.service
• Pod SSH: journalctl -u sleepypod.service
PASS: Service active and running (PID 1219 next-server v16.4.3). 0 unknown frame warning messages in journal logs since deployment. HTTP 200 on /en/system and /en/system?tab=sensors.

Acceptance Criteria Status (#873)

  • streamGroups.ts maps frzWater → freezer and sensHealth → presence, with a test
  • Water gauge renders capLevel when capValid, shows priming state, and falls back to binary ok/low when no frzWater frame has arrived
  • Per-side cover disconnect warning is driven by sensHealth, with no false alarm on pods that never emit it
  • Each piece tested on a Pod 3 running the new firmware and verified with fallback behavior for older firmware

@codecov

codecov Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: surface frzWater and sensHealth telemetry in the UI

1 participant