Skip to content

House panel example and the sensor hub it runs on - #155

Merged
bdbarnett merged 10 commits into
mainfrom
cast/house-panel
Sep 28, 2026
Merged

bdbarnett merged 10 commits into
mainfrom
cast/house-panel

Conversation

@bdbarnett

Copy link
Copy Markdown
Collaborator

This lands the P4 house appliance as lib/examples/house/, together with the sensor hub it depends on, which until now lived only on the unmerged spike/scenarios-batch2 branch. Its README starts with what it does:

  • the rooms, their thresholds and alerts on the panel;
  • the same rooms live on a phone at http://<board ip>/;
  • a SHOW-TV button that casts the panel, with the chime, to a Roku.

Real nodes such as the FunHouse take the first cards.

What's in it:

  • Commits 1–8: the sensor hub, fleet page and FunHouse node. These are the Batch 0 and Batch 2 work from spike/scenarios-batch0/-batch2, rebased onto main. The only conflicts were in generated files (packages/examples.json, the PyScript TOML), and they're regenerated in the last commit. The spike branches stay as they were.
  • The last commit: the house app, plus one small hub change.
    • house_panel (the display, the alerts, SimHouse) and house_app (panel, dashboard and SHOW-TV on one asyncio loop).
    • house_server, the dashboard alone.
    • dashboard.html, the house page.
    • main.py, to boot into it.
    • Hub(..., page=), so an app can serve its own dashboard. The board used to overwrite the hub's dashboard.html instead.

Depends on #154, the cast example. The house app imports roku_cast/castfast from the example beside it when you press SHOW-TV, and it needs the P4 firmware with castif (PyDevices/micropython-pydevices#27). Merge #154 first.

Evidence, from the spike copy that ran as the P4's boot app on 2026-09-27:

  • The panel showed the FunHouse card, and Brad confirmed its numbers agreed with the FunHouse's own screen.
  • The dashboard answered at the board's address.
  • SHOW-TV cast the panel to the 65". Brad noted the TV redraws about once a second, because the panel only changes that often.

The landed copy differs from that one only in how it's imported. It no longer uses /cast paths, it no longer writes a painter-error log to flash (a flash write stalls a running cast), and it serves the house page through page=. That landed copy hasn't run on the board yet; it gets proven after merge, when the P4 is rebuilt from main.

Marked # gallery: skip: it needs the board.

The sensor hub runs on a board (the T-Embed for now): nodes publish readings
over UDP, HTTP or a Bluetooth GATT service, and a dashboard shows them live
over a WebSocket feed. The fleet page runs on the PC and lists every board
mpftp can reach, without interrupting any of them unless asked.
…bers

A name longer than 8 characters beside a 128-bit service UUID only arrives in
the scan response, and Chrome's chooser then shows 'Unknown or Unsupported
Device'. The hub now takes a separate ble_name, the fleet page matches on it,
and the T-Embed advertises as 'T-Embed'.
…r hub's dashboard and a SHOW-TV cast

The house display on the P4 (rooms, thresholds, alerts, the chime), the
sensor hub's server with the house dashboard for a phone, and a SHOW-TV
button that casts the panel with sound through the cast example. Real
nodes (the FunHouse) take the first cards. Hub gains an optional page=
so an app can serve its own dashboard without overwriting the hub's.
@bdbarnett

Copy link
Copy Markdown
Collaborator Author

The landed copy now runs on the board. The P4, on the #27 landing image, boots this branch's house/main.py with cast, house, sensor_hub and roku_remote/roku_engine.py installed to /lib the way mip lays them out. The panel is up. http://<board>/ serves the house page through Hub(page=) (title "PyDevices House"), and /api/readings lists the funhouse node over HTTP beside the four simulated rooms. SHOW-TV hasn't been pressed on this copy yet.

@bdbarnett
bdbarnett merged commit 6ce72e9 into main Sep 28, 2026
4 checks passed
@bdbarnett
bdbarnett deleted the cast/house-panel branch September 28, 2026 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant