Release 2.7.0: house map, picture reader, managed certificate #12

Merged
domuk merged 2 commits from Dev into main 2026-11-08 14:38:25 +00:00
Owner

What changes

House map (admin page and home page module):

  • Floors drawn to real sizes, in millimetres. Rooms can be:
    • typed by size;
    • drawn corner by corner, with typed wall lengths;
    • traced over a picture after a two-click scale;
    • or drafted by planread.js, a dependency-free picture reader that runs in the browser.
  • Walls are derived from the rooms: inner walls where rooms meet, outer walls everywhere else.
  • Doors, windows, stairs, labels and furniture come from a catalog with real sizes.
  • Devices can be pinned: physical items from integrations (netmap's kit) and approved Home Assistant devices. Rooms suggest devices by matching the device's area name.
  • Undo works like the network map: snapshots, the last 50.
  • The home page module shows live status dots; tapping one opens the existing device or HA popup.
  • Migration 0018 adds the house_* tables and puts house_map at the end of every stored layout and saved view, as 0015 did for heating.

Certificate manager (acme.py, Settings → Certificate):

  • An ACME client (RFC 8555, ES256) with the DNS-01 challenge through the Cloudflare API, using only cryptography and httpx.
  • The token and account key are encrypted and stored in the cert_manager table, away from the settings table the home page reads.
  • It writes to the app's cert path, keeping a .previous copy, then reloads the running uvicorn SSL context in place.
  • Renewal is checked every 12 hours and runs when fewer than 30 days remain.
  • main.run now builds uvicorn.Config itself so the context can be reloaded.

Schema 18.

Verified

All on throwaway installs with no real Home Assistant (one fake HA device row for the HA pin path):

  • Picture reader on dom's reference plan:
    • Both floors found, with every main room.
    • All 4 first-floor windows found.
    • Takes about 1.2 seconds.
    • The plan isn't drawn to its printed sizes (up to 16% off), so it rescales from one typed room.
  • Picture reader on an exactly-to-scale plan (archlang): rooms within about 1%. Outline-style walls read roughly.
  • Editor, driven in headless Chromium:
    • Reading rooms into two floors.
    • Rescaling from a typed room, and renaming.
    • Room by size, a sofa, a door, and undo.
    • Placing a device by click and through the area suggestion.
    • Home page pins opening the NAS popup and the HA popup.
  • Certificate manager against Pebble with a fake Cloudflare API:
    • A wrong token gives a clear error.
    • It issued a certificate for a domain plus its wildcard.
    • TXT records were added and removed.
    • The running server served the new certificate with no restart.
    • .previous was kept, the token is never returned, and the endpoint gives 401 when not signed in.
  • Layout migration: stored mobile, desktop and saved-view layouts gain house_map and still validate.
  • Packaged archive on a 2.6.1 database: /, House map, Settings and the network map load with no errors.
## What changes **House map** (admin page and home page module): - Floors drawn to real sizes, in millimetres. Rooms can be: - typed by size; - drawn corner by corner, with typed wall lengths; - traced over a picture after a two-click scale; - or drafted by `planread.js`, a dependency-free picture reader that runs in the browser. - Walls are derived from the rooms: inner walls where rooms meet, outer walls everywhere else. - Doors, windows, stairs, labels and furniture come from a catalog with real sizes. - Devices can be pinned: physical items from integrations (netmap's kit) and approved Home Assistant devices. Rooms suggest devices by matching the device's area name. - Undo works like the network map: snapshots, the last 50. - The home page module shows live status dots; tapping one opens the existing device or HA popup. - Migration 0018 adds the `house_*` tables and puts `house_map` at the end of every stored layout and saved view, as 0015 did for heating. **Certificate manager** (`acme.py`, Settings → Certificate): - An ACME client (RFC 8555, ES256) with the DNS-01 challenge through the Cloudflare API, using only cryptography and httpx. - The token and account key are encrypted and stored in the `cert_manager` table, away from the settings table the home page reads. - It writes to the app's cert path, keeping a `.previous` copy, then reloads the running uvicorn SSL context in place. - Renewal is checked every 12 hours and runs when fewer than 30 days remain. - `main.run` now builds `uvicorn.Config` itself so the context can be reloaded. Schema 18. ## Verified All on throwaway installs with no real Home Assistant (one fake HA device row for the HA pin path): - **Picture reader on dom's reference plan:** - Both floors found, with every main room. - All 4 first-floor windows found. - Takes about 1.2 seconds. - The plan isn't drawn to its printed sizes (up to 16% off), so it rescales from one typed room. - **Picture reader on an exactly-to-scale plan (archlang):** rooms within about 1%. Outline-style walls read roughly. - **Editor, driven in headless Chromium:** - Reading rooms into two floors. - Rescaling from a typed room, and renaming. - Room by size, a sofa, a door, and undo. - Placing a device by click and through the area suggestion. - Home page pins opening the NAS popup and the HA popup. - **Certificate manager against Pebble with a fake Cloudflare API:** - A wrong token gives a clear error. - It issued a certificate for a domain plus its wildcard. - TXT records were added and removed. - The running server served the new certificate with no restart. - `.previous` was kept, the token is never returned, and the endpoint gives 401 when not signed in. - **Layout migration:** stored mobile, desktop and saved-view layouts gain `house_map` and still validate. - **Packaged archive on a 2.6.1 database:** `/`, House map, Settings and the network map load with no errors.
- Reader: doors by their swing (single, pairs, part-open, hung between
  two walls), windows by their glass, bays, garage doors, stairs by their
  treads; every space kept however small; leftover wall kept; a one-pixel
  wall shift fixed.
- Walls of their own (migration 0019): edit, split, lengthen to meet,
  drag, delete, draw; in undo; scaled with the floor.
- Checks on every floor: outside wall closed, a way into every room, no
  door onto a wall, nothing drawn twice.
- Fixes: "+ Floor" opened the edit dialog; adding one wall crashed.
domuk merged commit 947e0a4f9a into main 2026-11-08 14:38:25 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
domuk/Ion-Homepage!12
No description provided.