kichappa/ha-house3d
Über uns
A live 3D model of your home for Home Assistant: control lamps and devices in 3D, edit the plan in HA, turn room photos into a plan. Runs at 60 fps on a 2017 tablet.
Design und MedienGemessener Sternzuwachs
- in 24h
- +2
- in 7 days
- Verlauf wird gesammelt
- in 15 days
- Verlauf wird gesammelt
- in 1 month
- Verlauf wird gesammelt
Nettoänderungen in überlappenden Zeiträumen, keine Tagessummen. Fehlende Messwerte bleiben leer. Sterne zeigen Interesse, nicht Qualität.
README.md
OriginalHouse 3D for Home Assistant
▶ Live demo: runs in your browser with simulated devices, no Home Assistant needed.

House 3D is a live 3D model of your home that runs as a Home Assistant dashboard. Tap a lamp in
the model to switch it; press and hold for brightness and colour. Every light, plug, fan, TV and
thermostat shows its real state as it changes. Sunlight follows HA's sun.sun through your
windows, presence sensors appear as people, and auto-off timers count down over the devices.
You draw the plan in an editor inside HA, or build it from photos of your rooms with pretrained
vision models. It runs at close to 60 fps on a 2017 Android tablet mounted on the wall.
Built on the web front-end of house-control (MIT).
Feature tour
![]() |
Real sunlight. The sun follows HA's sun.sun and your plan's true north. It enters only through the windows: an invisible roof and outer walls cast the shadows, rooms with windows get a soft daylight fill, and window glass glows with the sky. |
![]() |
A day in 12 seconds. Low warm sun in the morning, white at noon, moonlight at night. |
![]() |
Every lamp is a light. Each fixture drives a real three.js light with glow and soft shadows, in its colour or white temperature. Lamps that can't change colour get a fixed LED tint. |
![]() |
Plan editor inside HA. Rooms (L-shaped too), walls, doors and windows, furniture and devices, with snapping, rotate by right-drag or a two-finger twist, and undo. Link each item to an entity from a sorted list of your HA devices. Saves to HA. |
![]() |
People from presence sensors. An LD2410-style radar puts a glowing figure at the measured distance, swaying while moving, or lying on the bed when the "in bed" sensor is on. |
![]() |
Auto-off timers, found automatically: a plug's own auto-off (TP-Link/Tapo), a Tuya countdown, or an automation that turns a device off after a delay. A draining ring counts down in 3D; the tile says "off in 1h26". |
![]() |
Detailed controls. Press and hold any tile, lamp or group: brightness, white, colour, and per-device options. |
![]() |
TV remote and an ambient backlight. D-pad, volume, sources. A small script on an Android TV box sends the average colour of the top of the picture to HA, and the lamp behind the TV follows it (example). |
![]() |
Rooms and groups. Pick a room to fly to it. HA light groups become chips and rounded floor zones. Dumb devices (a fan on a wall switch, a lamp on a smart plug) point to the switch that powers them. |
![]() |
Made for a wall tablet. Kiosk mode hides HA's chrome per device. Each device opens on its own room and returns to it after two minutes. Touch targets are sized for standing in front of it. Recorded on a Galaxy Tab S3. |
Also included:
- A Display panel with per-device graphics: presets, resolution when still and while moving, glow, shadows, a 60 fps cap, and a built-in benchmark.
- A photo pipeline: photograph a room, and VGGT reconstructs it while OWLv2 finds the furniture and devices. The editor then shows the proposal for you to accept item by item.
- Safety options: confirm before switching, and "critical" devices (a fridge's plug) that bulk actions never touch.
Performance
The render path has a low-power mode for old tablets: static geometry batched into a few draw
calls, a light budget, shader light culling, lean bloom, dynamic resolution and flat UI. It is
picked automatically on old GPUs and every part can be toggled in the Display panel.
Measured with the built-in benchmark (world.bench(4): a 4 s orbit at 40°/s) on a 6-room
apartment plan.
Galaxy Tab S3 (2017, Adreno 530, Android 9, Chrome/WebView 103). Stage ~690×880 CSS px, evening, 2 lamps lit:
| fps | frame p90 | CPU per frame | draw calls | |
|---|---|---|---|---|
| Before: stock render path, 1× resolution, sun shadow, no glow, no lamp shadows | ~24 | n/a | ~26 ms | 923 |
| Before, with bloom glow | ~11 | n/a | n/a | 923 |
| After: low preset, 1× while moving, glow + sun + 2 lamp shadows | 58 | 16.8 ms | ~9 ms | 130 |
| After, at native 1.75× while moving | 32 | n/a | n/a | 130 |
The tablet draws at 1× while the camera moves and redraws at native resolution with a 150 ms crossfade once it settles. By day with ~4 lamps lit and window light on it runs at ~28 fps; with window light off, ~36 fps. The remaining cost there is the light count.
Desktop (RTX 5070 Ti, headless Chromium, 1920×1080 viewport, 2× pixel density, full preset): ~100 fps, 168 draw calls, ~1.3 ms CPU per frame. Headless Chromium's frame pacing is the limit there, not the GPU. The full preset batches too: 669 → 107 draw calls and 17 → 7 lights in the shaders on the apartment plan, with practically the same image (0.001 % of pixels differ).
Known issue: on Adreno 530 / Chrome 103, a lamp's cube shadow in the same shader as a 2D sun or
spot shadow can make every lit draw fail (a black stage). The low preset never mixes the two
kinds (shadowMix: false), and a GL-error safety net falls back further if anything else fails.
Install
You need Home Assistant (admin user), a way to copy files to /config/www (the Samba share or
SSH add-on), and Node.js 20+ to build.
git clone https://github.com/kichappa/ha-house3d && cd ha-house3d
tools/install.sh [email protected]:/config/www/house3d # or a mounted folder; Windows: tools\install.ps1
HASS_URL=http://homeassistant.local:8123 HASS_TOKEN=<long-lived token> python3 tools/setup_dashboard.py
setup_dashboard.py creates the House 3D sidebar dashboard (an iframe on
/local/house3d/index.html) and two hidden admin dashboards that store the plan and scan jobs.
Run both commands again after updating: HA caches /local for 31 days, so each build gets a new URL.
Then open House 3D and press the sliders button for the editor. Draw your rooms, add lamps and devices, link each to an entity ("Real device"), and press Save & apply.
- Plan format: docs/plan-format.md. The demo home,
web/public/plans/demo.json, is a full example, andtools/check_plan.pychecks a plan for furniture in walls, overlaps and blocked doors. - Develop:
cd web && npm ci && npm run dev. The demo runs withnpm run dev:demo, andnpm run build:demobuilds the static site indist-demo/.
Photos → plan
- On the dashboard, press the camera button, pick a room and upload photos. They go to HA's media folder; create
/media/house3d/scansfirst. - A worker on a PC with an NVIDIA GPU picks up the job:
pip install -r tools/pipeline/requirements.txt # after installing torch for your CUDA HASS_URL=... HASS_TOKEN=... python tools/pipeline/worker.py # Windows: tools\pipeline\worker.ps1 - The worker runs
heic2jpg.py→reconstruct.py(VGGT: camera poses and a point cloud, ~1 min on an RTX 5070 Ti) →place.py(OWLv2 detections, aligned to your plan's room). - The proposal appears in the editor for review.
Model licences. VGGT's code allows commercial use (except military), but the facebook/VGGT-1B
weights are CC BY-NC 4.0: non-commercial only. For commercial use, swap in the separately
licensed facebook/VGGT-1B-Commercial.
OWLv2 is Apache-2.0.
TV colour watcher & TV/soundbar setup
tools/tv_setup.py sets up each TV for you. It describes your TV setup to House 3D (the TV, an
optional soundbar, a remote, and where volume goes) and, if you want, installs the TV colour
watcher. The watcher is a small script that runs on the TV box. It averages the top of the
picture on the box itself and sends only {r, g, b, dark} to a Home Assistant webhook, and a lamp
behind the TV takes that colour. No pixels leave the TV. One file, Python standard library only.
You need:
- An Android TV / Google TV box with network ADB on (Developer options → network debugging), and
adbon the computer that runs the tool. The script was written on an onn 4K Plus (Android 14). - HA's Android TV integration (ADB) for the box: its
media_playerrunsandroidtv.adb_command. - Optional: the Android TV Remote integration
for the D-pad, a colour lamp for the backlight, and a soundbar or AVR
media_player. - A long-lived access token (your HA profile → Security). Inside an HA add-on, use
HASS_URL=http://supervisor/coreand the add-on's supervisor token instead.
export HASS_URL=http://homeassistant.local:8123 HASS_TOKEN=<long-lived token>
python3 tools/tv_setup.py add # asks about each TV; prints the plan of changes
python3 tools/tv_setup.py add --config tvs.yaml # or flags: --slug --name --address --media-player --remote --light --soundbar --volume
python3 tools/tv_setup.py add ... --apply # makes the changes
python3 tools/tv_setup.py list # TVs set up by the tool
python3 tools/tv_setup.py remove <slug> --apply # undoes it, stops the script on the TV and deletes it
Nothing changes without --apply. The default is a dry run that prints every change first. For
each TV, add checks ADB, pushes the script (tools/onn/topcolor_v2.sh; --script picks another)
to /data/local/tmp/ and tests it. It then creates the helpers input_boolean.<slug>_backlight_follows,
input_number.<slug>_colour_interval and <slug>_colour_band, input_select.<slug>_backlight_target
(which light follows) and input_select.<slug>_colour_fade (100 / 250 / 500 ms, default 250; set in HA, not the dashboard), a random webhook id, and two
automations. "Backlight follows the picture" colours the target lamp from the webhook. "Colour watcher
keeper" restarts the script over ADB after a reboot while the TV is on, and passes it the helpers.
It also creates script.<slug>_volume_step and links everything in the dashboard. Without a lamp,
it skips the watcher and only sets up the remote and volume. Settings stay in
tools/tv_setup.<slug>.json (git-ignored; it holds the webhook id).
The script reads the screen in one of two ways. screenrecord raw frames give 5 samples a second,
but their format and orientation differ between devices. add runs the script's probe while
the screen is on and uses raw frames only when they check out; it needs a picture with dark rows
at one end, such as a letterboxed film or a menu bar. Otherwise it uses screencap (about one
sample a second) and prints how to switch later (--mode auto --flip 0|1).
Volume routes (--volume): the TV sheet's volume rocker calls script.<slug>_volume_step with
steps: +1 / -1.
| Route | Sends |
|---|---|
tv |
media_player.volume_up / volume_down to the TV's media player |
soundbar |
volume_set on the soundbar from its current level when HA knows it, else volume_up / volume_down |
adb-cec |
input keyevent 24/25 on the TV over ADB; HDMI-CEC passes it on to the soundbar or AVR |
remote |
remote.send_command VOLUME_UP / VOLUME_DOWN (Android TV Remote) |
Linking in the dashboard: link the TV and the lamp in the editor first (Real device), then run
add. It finds the plan items by their links. If it can't tell which item is which, pass
--tv-item / --light-item. It sets remote, volumeScript and tvColour on the TV item and
follow on the lamp. Then the TV's sheet shows a remote and "Backlight from the picture" with
that TV's own switch and helpers (plan format). The tool reads the stored
plan again just before writing, and stops if it changed meanwhile. The previous plan stays in
house3d_plan_prev.
Swapping the light that follows. "Light that follows" in the TV sheet lists the plan's colour
lamps and sets the target helper; the automation reads it for every colour, so a swap needs no
edit in HA. The "Follow the TV picture" switch moves to the lamp that follows now. When the picture
is near-neutral (sky, white walls) the v2 script can send k, a colour temperature; the lamp then
shows that white, clamped to its own range.
Transitions, per lamp. The automation picks the lamp's route when each colour arrives (mode
restart, so the newest colour wins; the v2 script already eases between colours on the TV):
- A per-lamp restart-mode step script
script.lamp_step_<lamp>, if it exists. It getstransition: 0, except on an IKEA KAJPLATS. - An IKEA KAJPLATS without one goes through
script.light_soft_fade_step, if you have one. A KAJPLATS turns reds and oranges green partway through a native fade, and an instant change makes it overshoot to about twice the brightness for half a second. So it gets a short fade (0.4 s, or the fade helper if longer) through the step script, which keeps it only where it is safe.light.turn_onnever sends a KAJPLATS a transition. - Any other lamp:
light.turn_onwithhs_color(orcolor_temp_kelvin) andbrightness, and the "Fade" from the TV sheet (Off / 150 / 300 ms) as itstransition. TP-Link Tapo bulbs ignore transitions anyway.
Credits
- house-control by 0xProbabillity: the original 3D web app, plan format, furniture and lamp models (MIT, web/LICENSE.house-control).
- three.js, Lucide, Vite.
- VGGT (Meta) and OWLv2 (Google) for the photo pipeline.
License
MIT.
Ähnliche Projekte entdecken
Wird geladen…









