mirror of
https://github.com/ocueye2/ha3dgenerator.git
synced 2026-12-01 17:57:48 -05:00
turn a glb of your room into a 3d interactive home assistant control dashbord
- JavaScript 79.6%
- CSS 13.5%
- HTML 6.7%
- Shell 0.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| shared | ||
| vendor | ||
| viewer | ||
| editor.css | ||
| editor.js | ||
| index.html | ||
| README.md | ||
| serve.sh | ||
| zip.js | ||
GLB Scene Builder — 3D Home Assistant environments
Build interactive 3D Home Assistant scenes from any .glb model. Upload a model,
click meshes to select them, bind several meshes to one device, map it to a Home
Assistant entity, add behaviors per mesh (spin, glow, color change, show/hide,
pulse), then export a static bundle.
Run it
./serve.sh
# open http://localhost:8123/editor.html
ES modules don't run from file://, so serve over http (any static server works).
Workflow
- Upload GLB (button or drag & drop).
- Click a mesh in the viewport to select it — selection is always exactly one mesh.
- New device from selection (or add the mesh to an existing device).
- Set the device kind (
light,fan,switch,media_player,generic), type the HA entity_id, choose active when states. - Add behaviors. Each behavior can target all of the device's meshes or only specific ones — e.g. bulb mesh glows blue while shade mesh shifts color.
- Preview with the per-device simulate toggles (off / on / playing).
- Setup tab: enter your HA URL + long-lived token once. The editor uses it for entity autocomplete, and the export bakes it in so the viewer auto-connects.
- Export bundle — downloads a
.zipcontaining only static files.
Export bundle layout
index.html viewer shell
app.js viewer logic
viewer.css viewer styles
config.js your devices, behaviors, mesh mapping (+ baked HA creds)
model.glb your model
shared/ ha client, behavior engine, Music Assistant browser
vendor/ three.js (no CDN needed)
Drop it on any static host and open index.html. No build step, no server code.
Viewer features
- Bottom dock lists every device; click a card to expand all its controls:
- light: on/off, color, brightness, color temperature, effects list
- fan: on/off, speed, preset modes
- media_player: play/pause, volume, prev/next, browse library (Music Assistant: artists, albums, tracks, playlists, radio, search — play anything on the player)
- switch/generic: on/off
- Tap a 3D object to toggle it. ⌖ focuses the camera on a device.
- Dock filters (All / Lights / Fans / Media / Other), auto-rotate, reset view.
- Settings (gear via the connection pill) can override the baked credentials.
Notes
- Mesh mapping uses GLB node names with an index-path fallback, so it survives Blender renames that only change spacing.
- Behaviors clone materials per device — shared materials elsewhere in the model are never affected.
- Baked credentials are readable in the exported files. Only share the bundle with people you trust; uncheck the bake option to ship without them.