docs: refresh the current user experience guide

Issue: #35
User-Visible: no
This commit is contained in:
Sergey Matyunin
2026-08-16 01:12:14 +03:00
parent 053e2a9b68
commit 88a647f6b2
36 changed files with 1408 additions and 664 deletions
+11 -10
View File
@@ -249,18 +249,19 @@ metadata). Only an explicit owner-approved emergency hotfix may skip this gate.
2. GitHub auth: fine-grained PAT (Contents R/W, issued 2026-07-23) in the sandbox
`~/.git-credentials`; pushes go over SSH with the `ha_jb` key. The old classic PAT
expired and is gone.
3. Privacy: legacy real-house plan sources (`assets/`) removed from the tree in
v1.13.3, but they persist in git history and old release archives; 8 README
screenshots in docs/images are still from the real house (replacement with
synthetic ones is a standing watchlist item). History rewrite deliberately NOT
done — it would break existing release tags/HACS installs.
3. Privacy: legacy real-house plan sources (`assets/`) and screenshots were
removed from the current tree. Public documentation images are generated
from synthetic fixtures by `npm run docs:capture` and indexed in
`docs/images/manifest.json`. Old images persist in git history and release
archives; history rewrite is deliberately not done because it would break
release tags and HACS installs.
4. Stale files on the mount that cannot be deleted from the sandbox: `src/data/` leftovers,
`brand_preview.png`, old nested bundle copies — ignore, git is authoritative.
4. Roadmap: phases 7–10 are DONE (v1.12.0 quality scale, v1.13.0 universality,
v1.13.1 distribution). Next candidates: replace the remaining real-house README
screenshots with synthetic ones; measure backend coverage (>95% goal); mypy strict.
5. The demo harness lives in /tmp/demo (synthetic home: demo.html + capture.mjs) —
rebuildable from this repo + docs/DEVELOPMENT.md notes; frames → PIL → GIF.
5. Roadmap: phases 7–10 are DONE (v1.12.0 quality scale, v1.13.0 universality,
v1.13.1 distribution). Next candidates: measure backend coverage (>95% goal);
mypy strict.
6. The public-doc screenshot harness is versioned in `demo/docs/capture.mjs` and
reuses the production component plus deterministic golden fixtures.
## How to resume work in a fresh session (checklist)
+580
View File
@@ -0,0 +1,580 @@
# House Plan — complete user guide
Current for **v1.64.0**. This guide describes the interface implemented by the
current source. [Русская версия](USER-GUIDE.ru.md).
House Plan installs two Lovelace cards together:
- `custom:houseplan-card` — the live plan, editors, state and actions;
- `custom:houseplan-space-card` — an inert rendering of one space with a link
to the full plan.
Configuration, uploaded files and shared positions stay inside Home Assistant.
House Plan does not use a House Plan cloud service.
> **Input support.** View and kiosk are supported on phones, tablets and wall
> touch panels. Create and maintain a plan on a desktop browser with a mouse
> and keyboard. Touch editing is best effort: an operation may be awkward,
> limited or absent, but it must not corrupt data or trigger an accidental
> Home Assistant action. The authority is [TOUCH-SUPPORT.md](TOUCH-SUPPORT.md).
## Contents
1. [Data model and terms](#1-data-model-and-terms)
2. [Installation and access](#2-installation-and-access)
3. [Adding a card](#3-adding-a-card)
4. [Quick start](#4-quick-start)
5. [Interface modes](#5-interface-modes)
6. [Navigation, zoom and input](#6-navigation-zoom-and-input)
7. [Spaces](#7-spaces)
8. [Rooms and walls](#8-rooms-and-walls)
9. [Doors, windows, gates and locks](#9-doors-windows-gates-and-locks)
10. [Devices](#10-devices)
11. [Tap actions](#11-tap-actions)
12. [Device visual states](#12-device-visual-states)
13. [Room fills and light](#13-room-fills-and-light)
14. [Background editor](#14-background-editor)
15. [Sun background and window rays](#15-sun-background-and-window-rays)
16. [Robot vacuums](#16-robot-vacuums)
17. [Kiosk](#17-kiosk)
18. [Static space card](#18-static-space-card)
19. [Plan maintenance](#19-plan-maintenance)
20. [Storage, multiple cards and backups](#20-storage-multiple-cards-and-backups)
21. [Current limitations](#21-current-limitations)
22. [Troubleshooting](#22-troubleshooting)
<!-- docs-section: model -->
## 1. Data model and terms
Settings form a hierarchy. Global settings provide defaults; a space may
override them; a room may override its space; a marker may override its room.
| Level | Meaning | Stored data |
|---|---|---|
| Card | One dashboard instance | Initial space, language, icon size, value/LQI display, live state, kiosk and cycle |
| Global settings | Defaults for all spaces | Fill palette, background, Glow radius, north, sun, weather and icon rules |
| Space | Floor, yard, garage or building | Plan image, scale, rooms, walls, openings, decor and display settings |
| Room | A closed outline | Name, optional HA area, temperature/humidity source and local fill |
| Wall | A side of a room outline | Optional physical thickness and virtual spans on a shared boundary |
| Opening | Door, window or gate on a wall | Size, orientation, contact and optional lock |
| Marker | A device shown on the plan | HA binding, room, action, presentation, light role and attachments |
| Background item | Visual context | Line, shape, text, furniture or plan-image transform |
A room is the spatial unit that owns area and an optional HA area. A partition
or column affects the physical rendering and light but does not create a room.
<!-- docs-section: installation -->
## 2. Installation and access
### Requirements
| Component | Requirement |
|---|---|
| Home Assistant | 2024.6.0 or newer |
| Installation | Any installation that supports custom integrations |
| Browser | Web Components, SVG and Pointer Events |
| Editing permission | Administrators by default |
### HACS
1. Add `https://github.com/Matysh/houseplan-card` to HACS as a custom
**Integration** repository.
2. Install House Plan and restart Home Assistant.
3. Open **Settings → Devices & services → Add integration → House Plan**.
4. Keep “administrators only” enabled unless other users must edit the plan.
The integration registers its Lovelace resource. With YAML-managed resources,
add:
```yaml
resources:
- url: /houseplan_files/houseplan-card.js
type: module
```
Do not use `/custom_components/houseplan/frontend/houseplan-card.js`; it is an
on-disk path, not the JavaScript URL served by Home Assistant.
### Manual installation
Copy the release folder to `config/custom_components/houseplan`, restart Home
Assistant, add the integration, then add the resource above only if Lovelace
resources are YAML-managed.
### Permissions
Every signed-in user can view the plan. Home Assistant permissions still govern
device service calls. With the default integration option, only administrators
can edit configuration or upload files. Plan optimization and its undo always
require an administrator.
## 3. Adding a card
Minimal configuration:
```yaml
type: custom:houseplan-card
title: House plan
```
| Field | Default | Purpose |
|---|---:|---|
| `title` | empty | Card title |
| `default_floor` | first/last opened | Initial space for this card |
| `language` | HA language | `auto`, `ru` or `en` |
| `icon_size` | `2.5` | Base marker size, 1–6% of plan width |
| `show_temperature` | `true` | Compact temperature and humidity values |
| `live_states` | `true` | Work/open/unavailable presentation and activity; alarms remain visible |
| `show_signal` | `true` | Base LQI display, overridable by a space |
| `kiosk` | `false` | Full plan without editors or header |
| `cycle` | `0` | Kiosk auto-cycle interval in seconds; `0` disables it |
The legacy card-level `tap_action` is ignored. Each marker owns its action.
<!-- docs-section: first-run -->
## 4. Quick start
Use this order for a first working room:
1. Add a space with **+**, or import Home Assistant floors.
2. Upload SVG/PNG/JPG/WebP, reuse an uploaded plan, or choose no image.
3. Set the real size of a grid cell. It controls wall, opening, furniture and
area measurements.
4. In Plan choose **Room outline**, click the vertices, then click the first
point to close the outline.
5. Name the room and bind it to an HA area, or use **No area**.
6. Add wall thickness and openings if needed.
7. In Device, position auto-discovered markers and choose their actions.
8. In Background, align the plan image and add labels, lines or furniture.
9. Return to View and confirm live values and actions.
![Creating the first space with synthetic data](images/03-space-create.png)
![Closing a new room outline on its first point](images/04-room-contour-close.png)
Do all plan creation on desktop. Phone, tablet and wall-panel View remain full
product surfaces after setup.
<!-- docs-section: modes -->
## 5. Interface modes
View is the state with no editor open. Close the active editor to return to it.
| Mode | Devices | Geometry | Background/openings |
|---|---|---|---|
| View | Live and actionable | Read-only; room hover shows summary | Visible according to space settings |
| Plan | Hidden | Rooms, walls, columns and openings editable | Openings always visible |
| Device | Draggable; click opens settings | Read-only background | Read-only background |
| Background | Dimmed and inert | Dimmed | Background objects editable |
| Kiosk | Actionable as in View | Read-only | Read-only; no editors |
| Static card | Not live or interactive | Render only | Render only |
Each editor has a stable primary toolbar. Tool parameters and selected-object
actions appear in a context tray over the top of the canvas. On a narrow screen
the tray scrolls horizontally instead of shrinking the plan.
<!-- docs-section: input -->
## 6. Navigation, zoom and input
The canvas grows with actual content. **Fit all** frames rooms and any distant
objects; each space keeps its local View viewport.
| Scenario | Mouse | Touch View | Touch editors | Keyboard |
|---|---|---|---|---|
| Zoom and pan | Wheel; drag empty space; `−`/`+` | Pinch; drag; double-tap resets kiosk | Available but precision is not guaranteed | — |
| Change space | Click a tab | Tap; kiosk swipe at 1:1 | Tap a tab | — |
| Device | Click/double-click per mode | Tap; safe actions equal desktop | Drag/properties are best effort | `Esc` closes the top surface |
| Draw or precise drag | Full contract | Not applicable | Best effort; use desktop for Resize and exact nodes | `Shift` changes magnet/angle; `Esc` cancels the operation |
| Editor history | Undo/Redo controls | Not applicable | Controls may work; no gesture guarantee | `Ctrl/Cmd+Z`, `Ctrl/Cmd+Shift+Z`, `Ctrl+Y` |
| Kiosk sizing | — | Hold empty space for 3 seconds | — | — |
At zoom above 1:1 a horizontal kiosk gesture pans instead of changing space.
Any manual kiosk operation pauses auto-cycle for 60 seconds.
### Cancel and undo
- `Esc` cancels an unfinished path, current drag/resize/rotation, or the top
dialog without undoing an already committed action.
- `Ctrl/Cmd+Z` undoes an editor command; redo is `Ctrl/Cmd+Shift+Z` or `Ctrl+Y`.
- Undo/Redo stores up to 50 named commands for Plan and Background.
<!-- docs-section: spaces -->
## 7. Spaces
A space may represent a floor, garden, garage or separate structure. It stores
its image, grid scale, geometry, Background layer and display overrides.
### Plan source
- upload SVG, PNG, JPG or WebP;
- select a previously uploaded plan;
- choose no image and draw the geometry by hand.
The plan image keeps its proportions initially. Background can later move,
scale or rotate it. Detaching a plan never deletes its server file; deletion
requires an explicit user action.
### Display settings
A space can show/hide room borders, names, LQI, Background and openings. It can
override fill mode, Glow, day-cycle background, north, sun rays, room-card font
scale and which room metrics are visible.
Room cards are positioned and scaled on the plan. View renders only the metrics
enabled for that space.
![Room card with temperature, LQI and light state](images/08-room-card.png)
<!-- docs-section: plan-tools -->
## 8. Rooms and walls
### Create a room
Select **Room outline** and click grid nodes. The current segment shows its real
length. Clicking the first point closes the outline and opens the room dialog.
Rooms may share boundaries but may not overlap. A closed room has area; an open
wall path does not.
Existing segment endpoints and lines appear above walls while drawing. An
endpoint grows when the next click will join it. A point on a line shows where
the click will create a valid junction.
### Plan tools at a glance
| Tool | Result | Room area | Light and shadow | Main limit |
|---|---|---|---|---|
| Room outline | Closed room or persisted open wall segments | Only a closed saved outline has area | Physical segments block light; openings pass it | Rooms cannot overlap; close on the first point |
| Partition | Independent wall segment | Does not split or change area | Blocks light and casts a wall shadow | Does not create a room or HA-area binding |
| Column | Square or circular support | Does not change area | Blocks light inside its shape | One shape/size/rotation; not a wall or room |
| Boundary | Virtual span of a shared wall | Geometry and area stay unchanged | Light passes; no physical wall is painted | Only a shared boundary between adjacent rooms |
| Opening | Door, window or gate | Does not change area | Door/gate passage follows state; window may cast sun | Must fit completely on a suitable wall segment |
Other operations edit existing geometry:
| Operation | Result |
|---|---|
| Merge | Joins adjacent rooms; a dialog chooses the surviving identity, name and area |
| Split | Cuts a room from one wall to another; the larger part keeps the original room |
| Resize | Moves a wall with shared geometry or scales a room by corner handles |
| Thickness | Changes one physical span or every wall of a room |
| Delete room | Deletes only the selected room after confirmation |
![Selected partition and its Plan context tray](images/05-plan-context-tray.png)
Wall thickness is stored in real units. A room may have different thicknesses
on different spans. Open wall branches and T-junctions are allowed; shared
geometry remains joined without painted end caps.
### HA area binding
One HA area may be bound to one room. The binding drives automatic device
placement, room LQI, light and aggregate climate. A room without an area may
still contain manually assigned devices and explicit measurement sources.
## 9. Doors, windows, gates and locks
Choose Opening, select door/window/gate, and click a wall. Defaults are 90 cm,
120 cm and 300 cm. The complete opening must fit on the wall.
An opening may bind a contact; doors and gates may also bind a lock. View paints
the moving leaf and state. A lock badge is green when locked and orange when
unlocked. A plan tap never toggles a lock. The opening card provides a labelled
lock/unlock control, with confirmation before unlocking.
Openings may slide along joined wall corners. A double click in Plan opens
properties. Thick walls keep visible jambs and align the symbol to the correct
face.
<!-- docs-section: devices -->
## 10. Devices
House Plan reads Home Assistant device, entity and area registries. A device in
a bound HA area receives an automatic marker. Service-only records, bridges and
other non-spatial records are filtered; a light group may replace its members.
Newly discovered devices get a red dot until first opened in Device.
### Bindings
| Binding | Use |
|---|---|
| HA device | Uses its related entities and resolves a primary function |
| HA entity | Exact entity binding after enabling “Show entities” |
| Virtual device | Label/icon/description only, with no live active state |
The same binding cannot be used by two markers.
### Device editor
- drag a marker to save its server-side position;
- click it to edit name, binding, room, tap action and presentation;
- **Add** creates a virtual marker or picks a binding manually;
- **Hidden and disabled** reveals user-hidden and HA-disabled records only in
the editor;
- **Icon rules** edits the first-match regular-expression list.
The dialog shows binding provenance, exact next tap result, skipped targets and
a live presentation preview. A saved missing source is shown as missing rather
than silently replaced.
![Device editor with binding provenance and the exact action result](images/06-device-editor.png)
![Live preview of the selected device presentation](images/06-device-display-preview.png)
Hidden markers keep configuration and may still contribute to area aggregates.
An HA-disabled binding is excluded from rendering, state, actions, light and
aggregates until the same ID becomes active again.
## 11. Tap actions
| Gesture | View | Device editor |
|---|---|---|
| Short click/tap | Configured action | Open marker settings |
| Hold 600 ms | House Plan device card | No device control |
| Right click | Native HA more-info for the primary entity | Browser/editor context |
| Action | Behaviour | Safety |
|---|---|---|
| Device card | House Plan card with entities, model, description, links and files | No state change |
| HA more-info | Native dialog for the exact primary entity | No state change |
| Toggle state | Toggles the exact binding, supported device function or configured light-source group | Locks, alarm panels and protective garage/door/gate targets are no-op; confirmation is optional |
| Run | Runs an automation, script or scene | Explicit target; confirmation is optional |
A light defaults to Toggle; other devices default to the House Plan card. An
unsupported Toggle remains a visible no-op and is never changed into another
action behind the user's back.
![House Plan device card with state and safe actions](images/09-device-info.png)
<!-- docs-section: visual-states -->
## 12. Device visual states
Presentation has three independent layers: stable marker background, icon or
value, and optional activity pulse. Priority is **alarm → working → open →
neutral**.
| State | Meaning | Examples |
|---|---|---|
| Red alarm | Critical condition, even with live states disabled | Smoke, gas, CO, leak, tamper/problem/safety, triggered alarm |
| Yellow | Device is doing its main job | Light/switch/fan on, active climate, vacuum cleaning, known appliance work |
| Orange | Physically open or unlocked | Door/window contact, unlocked lock, opening valve |
| Faded | Data unavailable | All relevant entities unknown, unavailable or absent |
| Neutral | No alarm, work or open condition | Off, closed, idle, standby, docked |
Activity may be a finite three-wave event, persistent presence, a travelling
transition, or persistent work. `prefers-reduced-motion` replaces ordinary
motion with a compact indicator while the alarm remains clear.
The four display choices are icon + state; icon + state + activity; value +
state; and always-static icon. A separate value badge can show an entity state,
useful attribute, average LQI or linked light state on any side of the marker.
Virtual devices use the ordinary neutral/hover background with a dashed outer
circle. They cannot have active state or pulse. Unavailable keeps the ordinary
presentation with the standard icon opacity reduction. Zigbee LQI remains a
separate badge.
## 13. Room fills and light
Space fill modes include user colour, temperature comfort range and LQI. Room
settings may override the space. Glow is independent from the base fill.
A light source may come from automatic classification, an explicit Always
role, or a controlled source group. Walls, partitions and columns occlude Glow;
open passages transmit it. When a configured light source disappears or loses
its valid binding, its contribution is removed instead of keeping stale light.
Overlapping Glow pools add brightness and colour where browser SVG blending is
supported; otherwise House Plan uses a safe normal blend without changing the
saved setting.
<!-- docs-section: background -->
## 14. Background editor
The authoritative technical interaction contract is
[DECOR-EDITOR.md](DECOR-EDITOR.md).
| Tool | Create | Edit |
|---|---|---|
| Select | Select an item | Move, scale, rotate; double click properties; Delete/Backspace removes |
| Backdrop | Available when a plan image exists | Move, corner-scale, rotate; double click numeric size/angle |
| Line | Drag endpoints | Colour/opacity, physical thickness and solid/dashed style |
| Rectangle | Drag diagonal; Shift makes a square | Stroke plus independent fill, size and angle |
| Oval | Drag bounds; Shift makes a circle | Stroke plus independent fill, radii and angle |
| Text | Click to open dialog | Multiline text, HA tokens, colour, physical size and angle |
| Furniture | Pick symbol, then click | Symbol, size, colour, outline and wall magnet |
| Erase | Click an item | Confirmed deletion, undoable |
Creation and transform snap to the grid plus nearby room/background anchors.
The plan image is interactive only with Backdrop selected. Undo/Redo shares the
50-command editor history.
![Selected line in the Background editor](images/07-background-editor.png)
Live text accepts `{sensor.entity}` and
`{climate.entity:current_temperature}` tokens. Missing, unavailable or complex
object values render as `—`; long values are shortened.
## 15. Sun background and window rays
These are independent features. **Follow the sun** changes the background from
day through golden hour to night and can fall back to browser time. Window rays
require `sun.sun`, a configured north direction and suitable exterior windows.
Weather cloud cover may reduce ray intensity.
Rays remain visual only: they do not change Home Assistant state. Walls and
physical obstacles clip them; changing north or window geometry recalculates
the result.
## 16. Robot vacuums
The dock marker stays at its saved location while a live puck and path follow a
supported map source. Calibration maps source coordinates to plan coordinates.
Automatic room-name matching is a starting point; manual drag/stretch corrects
it. A diagnostic source picker reports missing or incompatible sources instead
of silently rebinding.
Multiple maps are represented as distinct sources/calibrations. A vacuum is
shown only in the space whose saved mapping currently matches the active map;
the dock remains in its configured space. See [VACUUM.md](VACUUM.md) for the
source dialect and calibration contract.
## 17. Kiosk
Set `kiosk: true` on a card in a Panel view. Editors and the ordinary header are
removed. Pinch/drag navigate, double-tap resets, and a 1:1 horizontal swipe
changes space. Holding empty space for three seconds opens per-display icon and
text sizing. `cycle` enables automatic space changes; interaction pauses it for
60 seconds.
## 18. Static space card
`custom:houseplan-space-card` renders one configured space without live states,
hover, drag, more-info or actions. A footer button opens the full plan. Use it
for compact dashboard navigation, not for home control.
```yaml
type: custom:houseplan-space-card
space: ground
```
## 19. Plan maintenance
Optimization compacts old off-grid geometry and unused layout records while
preserving rooms, bindings and supported settings. It does not delete plan
images or attachments merely because nothing currently references them.
Optimization creates one server-side undo point. Any later edit makes that undo
stale, so create a Home Assistant backup before a large maintenance operation.
<!-- docs-section: multiple-cards -->
## 20. Storage, multiple cards and backups
### Portable JSON backup
**Global settings → Backup and transfer** exports either the complete House
Plan model or the current space. Import first shows a server-side preview with
type, versions, object counts, source and content-link state; nothing is written
until confirmation.
A full import replaces the model and creates one undo point. A space import
assigns new internal IDs and adds the copy without replacing global settings.
Internal uploaded files are not embedded in JSON; an import to another HA
instance must explicitly detach those links.
### Storage locations
| Data | Location |
|---|---|
| Spaces, geometry, Background and marker settings | HA storage `houseplan.config` |
| Marker and room-card positions | HA storage `houseplan.layout` |
| Plan files | `config/houseplan/plans` |
| Marker attachments | `config/houseplan/files` |
| Vacuum path | Separate House Plan HA storage |
| Cache, viewport and kiosk scale | That browser's `localStorage` |
### Several cards and clients
Several `custom:houseplan-card` instances may use different `default_floor`
values. This is the supported way to start one wall display on the ground floor
and another on a garage or upper floor.
- configuration, rooms, Background and device layout are shared server data;
- `default_floor` is an initial choice for that card;
- current mode, selected space, zoom/pan and kiosk sizing are local;
- WebSocket broadcasts saved changes and revision checks reject a stale write;
- avoid editing the same object in two browsers: the second save may need a
refresh and manual reapplication.
### Files and quotas
Plan files accept SVG/PNG/JPG/WebP up to 8 MB, with a 200-file/256-MB total.
Marker attachments accept PDF/PNG/JPG/WebP/TXT up to 50 MB, with a
1000-file/1-GB total and 50 links per marker. Writes are also refused below
512 MB free disk space. Detached files remain until explicitly deleted.
<!-- docs-section: limits -->
## 21. Current limitations
| Limitation | Practical effect |
|---|---|
| Rooms must be closed | An open path is walls, not a room with area |
| One HA area per room | To split one HA area visually, assign devices manually |
| Boundary requires adjacent rooms | It cannot open an exterior wall or branch from empty space |
| Editors are desktop-first | Touch editing may be awkward, limited or absent |
| Room details use hover in View | A touch-only user may need an editor or another visible metric |
| Sun has no exterior 3D model | It cannot know shadows from trees, awnings or neighbouring structures |
| Icon rules use regular expressions | First matching rule wins and invalid expressions are rejected |
Storage guards allow up to 50 spaces, 400 rooms per space, 2,000 markers, 500
openings, 1,000 Background items, 500 wall records and 500 virtual spans per
space. The configuration package is limited to 2 MB.
<!-- docs-section: diagnostics -->
## 22. Troubleshooting
### Card does not load
| Symptom | Check |
|---|---|
| `Custom element doesn't exist: houseplan-card` | Integration loaded; resource is `/houseplan_files/houseplan-card.js` with type `module`; hard-refresh |
| MIME `text/plain` | Replace `/custom_components/...` with `/houseplan_files/...` |
| Integration missing | Folder is exactly `custom_components/houseplan`; restart HA; inspect import errors |
### Devices or values are missing
- confirm the room's HA-area binding and the device/entity registry area;
- open Device → Hidden and disabled;
- verify the selected source still exists and is available;
- remember that a virtual marker has no active state;
- inspect the dialog's exact target and skipped-target explanation.
### Geometry looks wrong
- confirm grid cell size before judging physical dimensions;
- use Fit all to include distant objects;
- check wall thickness and whether a shared span is a virtual Boundary;
- use desktop for precise nodes, Split and Resize.
### Vacuum does not move
- confirm the active map source and map identity;
- check calibration anchors and current source availability;
- verify that the active map is assigned to this space;
- open source diagnostics instead of deleting/recreating the marker.
When reporting a problem, include House Plan version, HA version, browser,
console/server errors and reproducible steps. Replace private entity IDs and
plans with synthetic equivalents.
+91 -23
View File
@@ -1,6 +1,7 @@
# House Plan — полное руководство пользователя
Актуально для **v1.60.0**. Руководство заново составлено по исходному коду и фактическому интерфейсу этой версии. Старые README и тематические спецификации использовались только для перепроверки сценариев.
Актуально для **v1.64.0**. Руководство составлено по исходному коду и
фактическому интерфейсу этой версии. [English version](USER-GUIDE.md).
House Plan — локальная интеграция и две Lovelace-карточки для Home Assistant:
@@ -27,7 +28,7 @@ House Plan — локальная интеграция и две Lovelace-кар
6. [Навигация, масштаб и жесты](#6-навигация-масштаб-и-жесты)
7. [Пространства](#7-пространства)
8. [Комнаты и стены](#8-комнаты-и-стены)
9. [Двери, окна и замки](#9-двери-окна-и-замки)
9. [Двери, окна, ворота и замки](#9-двери-окна-ворота-и-замки)
10. [Устройства](#10-устройства)
11. [Действия по нажатию](#11-действия-по-нажатию)
12. [Визуальные состояния устройств](#12-визуальные-состояния-устройств)
@@ -42,6 +43,8 @@ House Plan — локальная интеграция и две Lovelace-кар
21. [Ограничения текущей версии](#21-ограничения-текущей-версии)
22. [Диагностика](#22-диагностика)
<!-- docs-section: model -->
## 1. Модель данных и терминология
Настройки образуют иерархию: общие значения задают базовый вид, пространство может их переопределить, затем отдельная комната, затем устройство.
@@ -59,6 +62,8 @@ House Plan — локальная интеграция и две Lovelace-кар
Важное ограничение версии: стена пока не существует отдельно от комнаты. Она выводится из границы замкнутого контура. Незамкнутые и свободно стоящие стены пока не поддерживаются.
<!-- docs-section: installation -->
## 2. Установка и доступ
### Требования
@@ -128,6 +133,8 @@ title: План дома
Карточечный `tap_action` из старых конфигураций игнорируется. Действие задаётся отдельно для каждого устройства.
<!-- docs-section: first-run -->
## 4. Быстрый старт
Рекомендуемый порядок настройки:
@@ -148,6 +155,12 @@ title: План дома
последующего просмотра и управления домом, но не гарантированной средой
редактирования.
![Создание первого пространства на синтетических данных](images/03-space-create.png)
![Замыкание нового контура комнаты на первой точке](images/04-room-contour-close.png)
<!-- docs-section: modes -->
## 5. Режимы интерфейса
Обычный просмотр — не отдельная вкладка: это состояние, в которое возвращает крестик активного редактора.
@@ -173,6 +186,8 @@ title: План дома
область и не меняет масштаб плана. На узком экране действия прокручиваются
горизонтально внутри самой суб-панели.
<!-- docs-section: input -->
## 6. Навигация, масштаб и жесты
Холст практически бесконечен: элементы можно рисовать и размещать за пределами исходного квадрата плана. Команда **Показать всё** подбирает вид по фактическому содержимому.
@@ -182,15 +197,14 @@ Touch-жесты просмотра и киоска из таблицы ниже
desktop: для точного рисования, Resize, модификаторов клавиатуры и свойств по
двойному клику используйте компьютер.
| Действие | Мышь/клавиатура | Сенсорный экран |
|---|---|---|
| Масштаб | Колесо, кнопки `−`/`+` | Щипок двумя пальцами |
| Панорама | Перетаскивание пустого места | Перетаскивание |
| Показать всё | Центральная кнопка масштаба | Та же кнопка вне киоска |
| Привязка объектов | Выполняется автоматически и всегда | Выполняется автоматически и всегда |
| Сброс киоск-масштаба | — | Двойной тап |
| Следующее пространство в киоске | — | Горизонтальный свайп при масштабе 1:1 |
| Локальный размер киоска | — | Удерживать пустое место 3 секунды |
| Сценарий | Мышь | Touch в просмотре | Touch в редакторах | Клавиатура |
|---|---|---|---|---|
| Масштаб и панорама | Колесо; drag пустого места; кнопки `−`/`+` | Щипок; drag; двойной тап сбрасывает киоск | Работает, но точность не гарантируется | — |
| Переключение пространства | Клик по вкладке | Клик; в киоске свайп при масштабе 1:1 | Клик по вкладке | — |
| Устройство | Клик/двойной клик по правилам режима | Tap; безопасные действия как на desktop | Drag и свойства — best effort | `Esc` закрывает верхнюю поверхность |
| Рисование и точный drag | Полный контракт | Не применяется | Best effort; для Resize и точных точек используйте мышь | `Shift` меняет магнит/угол; `Esc` отменяет операцию |
| История редактора | Кнопки Undo/Redo | Не применяется | Кнопки могут работать, жест не гарантирован | `Ctrl/Cmd+Z`, `Ctrl/Cmd+Shift+Z`, `Ctrl+Y` |
| Киоск-размеры | — | Удерживать пустое место 3 секунды | — | — |
Особенности:
@@ -218,6 +232,8 @@ desktop: для точного рисования, Resize, модификато
кнопку или объект, которыми диалог был открыт. При открытии вложенного окна
возврат сначала происходит в родительский диалог.
<!-- docs-section: spaces -->
## 7. Пространства
Пространство подходит не только для этажа: это может быть двор, гараж, баня или отдельное строение.
@@ -243,6 +259,11 @@ desktop: для точного рисования, Resize, модификато
| Отображение | Скрыть проёмы | Скрывает только символы дверей, окон и ворот; свет, солнечные лучи и датчики проёмов продолжают работать |
| Карточка комнаты | Температура/влажность/LQI/свет | Добавляет выбранные показатели под названием комнаты |
| Карточка комнаты | Общий размер шрифта | Масштабирует все комнатные карточки пространства, 50–300% |
Карточка комнаты остаётся частью плана: её можно перемещать и масштабировать в
редакторе, а в просмотре она собирает только включённые метрики.
![Карточка комнаты с температурой, LQI и состоянием света](images/08-room-card.png)
| Стиль | Цвет и прозрачность | Общий цвет границ и названий |
| Фон | Наследовать/статический/день-ночь | Управляет фоном вокруг плана |
| Солнце | Север и лучи | Локально переопределяет общие настройки |
@@ -251,6 +272,8 @@ desktop: для точного рисования, Resize, модификато
Удаление пространства удаляет его комнаты и разметку после подтверждения. Файл подложки при этом автоматически не удаляется: им можно управлять через список уже загруженных планов.
<!-- docs-section: plan-tools -->
## 8. Комнаты и стены
### Создание комнаты
@@ -299,18 +322,27 @@ T-соединение входит в проходящую стену без в
### Инструменты плана
| Инструмент | Что выбирать | Результат и ограничения |
|---|---|---|
| Контур комнаты | Точки контура | Создаёт комнату; незаконченный контур сохраняется и допускает разную толщину сегментов |
| Перегородка | Две точки | Создаёт одну независимую стену с текущей толщиной; комнату и HA-зону не делит |
| Колонна | Одну точку | Создаёт квадратную колонну с текущим размером; форму, размер и поворот можно изменить в свойствах |
| Объединить | Две соседние комнаты | Объединяет геометрию; в диалоге выбирается, чья идентичность/название/HA-зона сохранится |
| Split | Комнату, старт на стене, путь внутри, финиш на стене | Делит комнату; большая часть сохраняет исходную комнату, меньшая получает новое имя/HA-зону |
| Resize | Ручку стены или комнату | Двигает стену с общей геометрией; по клику на комнату даёт угловую рамку масштабирования |
| Проём | Сначала тип в подменю, затем точку на стене | Создаёт окно 120 см, дверь 90 см или ворота 300 см; клик существующего проёма открывает его настройки |
| Граница | Две точки общей стены или существующий пунктир | Два клика делают участок общей стены виртуальным; один клик по пунктиру целиком восстанавливает физическую стену |
| Толщина | Реальный участок стены | Задаёт толщину выбранному участку или всем стенам комнаты |
| Удалить комнату | Точку внутри комнаты | После подтверждения удаляет только эту комнату; стены не запускают другие скрытые действия |
#### Инструменты плана в короткой таблице
| Инструмент | Что создаёт | Площадь комнаты | Свет и тени | Главное ограничение |
|---|---|---|---|---|
| Контур комнаты | Замкнутую комнату или сохраняемые отрезки незавершённой стены | Только замкнутый сохранённый контур имеет площадь | Физические сегменты блокируют свет; проёмы пропускают его | Комнаты не могут перекрываться; контур замыкается на первой точке |
| Перегородка | Независимый отрезок стены | Не делит и не меняет площадь | Блокирует свет и отбрасывает тень как стена | Не создаёт комнату и не связывается с HA-зоной |
| Колонна | Квадратную или круглую опору | Не меняет площадь комнаты | Блокирует свет внутри своей формы | Имеет одну форму/размер/поворот, но не является стеной или комнатой |
| Граница | Виртуальный участок общей стены | Не меняет геометрию и площадь | Свет проходит, физическая стенка не рисуется | Работает только на общей границе соседних комнат |
| Проём | Дверь, окно или ворота на стене | Не меняет площадь | Дверь/ворота пропускают свет по состоянию; окно может давать солнечный луч | Должен целиком помещаться на подходящем отрезке стены |
Остальные операции меняют уже созданную геометрию:
| Операция | Результат |
|---|---|
| Объединить | Склеивает соседние комнаты; в диалоге выбирается сохраняемая идентичность, имя и HA-зона |
| Split | Делит комнату путём от одной стены до другой; большая часть сохраняет исходную комнату |
| Resize | Двигает стену с общей геометрией либо масштабирует выбранную комнату угловой рамкой |
| Толщина | Задаёт толщину выбранному участку или всем стенам комнаты |
| Удалить комнату | После подтверждения удаляет только выбранную комнату |
![Выбранная перегородка и её контекстная панель](images/05-plan-context-tray.png)
### Merge
@@ -449,6 +481,8 @@ Glow и солнечные лучи, но при Resize комнаты оста
Солнце проходит только через наружные окна. Внутренние окна солнечных лучей не создают.
<!-- docs-section: devices -->
## 10. Устройства
### Как маркеры появляются автоматически
@@ -479,6 +513,10 @@ House Plan читает реестры устройств, сущностей и
| **Скрытые и деактивированные** | Показывает пользовательски скрытые и отключённые в HA устройства служебными маркерами только в этой вкладке |
| **Правила иконок** | Открывает приоритетный список регулярных выражений для «имя + модель» |
![Редактор устройства: источник привязки и ожидаемое действие](images/06-device-editor.png)
![Живой предпросмотр выбранного отображения устройства](images/06-device-display-preview.png)
### Основные настройки маркера
| Поле | Назначение |
@@ -610,6 +648,10 @@ HA. «Показать» заблокировано до активации. П
получает ровно показанное доступное подмножество; собственная сущность
контроллера не подставляется вместо исчезнувших настроенных целей.
![Внутренняя карточка устройства с состоянием и безопасными действиями](images/09-device-info.png)
<!-- docs-section: visual-states -->
## 12. Визуальные состояния устройств
В динамических режимах система состоит из трёх независимых слоёв:
@@ -816,6 +858,8 @@ marker на плане при этом не меняются.
Цвет пятна выбирается по приоритету: RGB-состояние лампы → цветовая температура → общий цвет света. Яркость влияет на интенсивность, но имеет минимальный визуальный порог 15%.
<!-- docs-section: background -->
## 14. Редактор подложки
### Инструменты
@@ -842,6 +886,8 @@ marker на плане при этом не меняются.
показывает «Свойства» и «Удалить». Палитра мебели использует расширенный вариант
той же поверхности и также не меняет высоту или масштаб рабочей области.
![Выбранная линия в редакторе подложки](images/07-background-editor.png)
Редактор подложки использует тот же именованный Undo/Redo на 50 команд, что и геометрия плана. `Esc` отменяет только незавершённое рисование или текущий drag/resize/поворот; после отпускания указателя используйте `Ctrl+Z`/`Cmd+Z`. Повтор — `Ctrl+Shift+Z` либо `Ctrl+Y`.
### Двойной клик в «Выбрать»
@@ -1087,6 +1133,8 @@ show_signal: true
Старые и импортированные объекты между узлами будут привязаны к сетке. Новые редакторы такие координаты не создают. После оптимизации доступна одна серверная отмена, но только до следующего изменения плана. Новый edit делает резервную копию оптимизации устаревшей.
<!-- docs-section: multiple-cards -->
## 20. Хранение, совместная работа и резервные копии
### Переносимая JSON-копия House Plan
@@ -1133,6 +1181,22 @@ JSON хранит названия, идентификаторы HA и точн
- Масштаб просмотра, последнее открытое пространство и киоск-размеры локальны браузеру.
- Если открыт несохранённый диалог и Lovelace быстро пересобирает карточку, текущая версия пытается восстановить черновик в течение короткого окна.
### Несколько карточек и стартовые пространства
На одном или разных дашбордах можно разместить несколько
`custom:houseplan-card` и задать каждой собственный `default_floor`. Это
поддерживаемый способ открыть, например, первый этаж на настенном планшете, а
гараж — на отдельном экране.
- конфигурация, комнаты, декор и layout устройств общие и серверные;
- `default_floor` применяется как стартовый выбор конкретной карточки;
- текущий режим, выбранное пространство, масштаб/панорама и киоск-размеры
локальны браузеру или экземпляру карточки;
- WebSocket доставляет сохранённые изменения другим клиентам, а серверные
ревизии не позволяют молча перезаписать более новую модель;
- два пользователя не должны одновременно редактировать один и тот же объект:
второй save может потребовать обновить состояние и повторить изменение.
### Файлы и квоты
| Объект | Форматы | Лимит одного файла | Общий лимит |
@@ -1142,6 +1206,8 @@ JSON хранит названия, идентификаторы HA и точн
Запись также отклоняется, если на разделе HA остаётся меньше 512 МБ свободного места. Файлы не удаляются только из-за возраста. Подложка, отсоединённая от пространства, остаётся на сервере до явного удаления. Незавершённые временные загрузки очищаются автоматически.
<!-- docs-section: limits -->
## 21. Ограничения текущей версии
| Ограничение | Практическое следствие |
@@ -1158,6 +1224,8 @@ JSON хранит названия, идентификаторы HA и точн
Технические пределы защиты хранилища: до 50 пространств, 400 комнат на пространство, 2000 маркеров, 500 проёмов, 1000 элементов декора, 500 записей стен и 500 виртуальных участков на пространство. Конфигурационный пакет ограничен 2 МБ.
<!-- docs-section: diagnostics -->
## 22. Диагностика
### Карточка не загрузилась
+9
View File
@@ -0,0 +1,9 @@
{
"transientHosts": [
"demo.houseplan.tech",
"github.com",
"hacs.xyz",
"my.home-assistant.io",
"t.me"
]
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 308 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 853 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

+119
View File
@@ -0,0 +1,119 @@
{
"version": 1,
"fixture": "synthetic-only",
"sourceFingerprint": "7f726b212839add4f9fc4491fd23f053b09bf82e38ea380a7cc84d1dc2bcf81a",
"captureScriptSha256": "a0022c98553c5baae8335d7ba26f64129699c4ef6162dd1d88df9f70226ec404",
"command": "npm run docs:capture",
"scenarios": {
"view-desktop": {
"file": "01-view-desktop.png",
"viewport": {
"width": 1180,
"height": 900
},
"theme": "dark",
"language": "en",
"sourceSha256": "7f726b212839add4f9fc4491fd23f053b09bf82e38ea380a7cc84d1dc2bcf81a",
"imageSha256": "d36b6f9f8139f31ef73a780c6511a640a26055efd9d7a24c24fd48b1d8379bf0"
},
"view-touch": {
"file": "02-view-touch.png",
"viewport": {
"width": 390,
"height": 760
},
"theme": "dark",
"language": "en",
"sourceSha256": "7f726b212839add4f9fc4491fd23f053b09bf82e38ea380a7cc84d1dc2bcf81a",
"imageSha256": "358e25ff9984d0fb0c03cfbb848df40c425fdfe64cd5f4f613b1e754ca9d4249"
},
"space-create": {
"file": "03-space-create.png",
"viewport": {
"width": 900,
"height": 850
},
"theme": "dark",
"language": "en",
"sourceSha256": "7f726b212839add4f9fc4491fd23f053b09bf82e38ea380a7cc84d1dc2bcf81a",
"imageSha256": "c53db2e5c642a5549c13f3c93a5b359fed69bdb2621bf71a243a877ffcb95e6b"
},
"room-contour-close": {
"file": "04-room-contour-close.png",
"viewport": {
"width": 1180,
"height": 900
},
"theme": "dark",
"language": "en",
"sourceSha256": "7f726b212839add4f9fc4491fd23f053b09bf82e38ea380a7cc84d1dc2bcf81a",
"imageSha256": "59fe5b9df034d255840e7ae6984efb675d39e84ad80dee6f9ad9394c54fb9cda"
},
"plan-context-tray": {
"file": "05-plan-context-tray.png",
"viewport": {
"width": 1180,
"height": 900
},
"theme": "dark",
"language": "en",
"sourceSha256": "7f726b212839add4f9fc4491fd23f053b09bf82e38ea380a7cc84d1dc2bcf81a",
"imageSha256": "997bba208897b219051131dc51254ee3c76ed9f73597fde33070ac8cefdcd745"
},
"device-editor": {
"file": "06-device-editor.png",
"viewport": {
"width": 1180,
"height": 1100
},
"theme": "dark",
"language": "en",
"sourceSha256": "7f726b212839add4f9fc4491fd23f053b09bf82e38ea380a7cc84d1dc2bcf81a",
"imageSha256": "7a22a81e2abedf5a520bd36b7509d953cbfa9962b48c0ffbc233666a6215c04b"
},
"device-display-preview": {
"file": "06-device-display-preview.png",
"viewport": {
"width": 1180,
"height": 1100
},
"theme": "dark",
"language": "en",
"sourceSha256": "7f726b212839add4f9fc4491fd23f053b09bf82e38ea380a7cc84d1dc2bcf81a",
"imageSha256": "f6014caed7b7d28790b8548996ba09d806a4e4d51fbb7e8d3fb3c582ebe49167"
},
"background-editor": {
"file": "07-background-editor.png",
"viewport": {
"width": 1180,
"height": 900
},
"theme": "dark",
"language": "en",
"sourceSha256": "7f726b212839add4f9fc4491fd23f053b09bf82e38ea380a7cc84d1dc2bcf81a",
"imageSha256": "4e7b3b1220a3fe104cf11e5b32a31b343dc95c45fd2cbe3365d145f0a66a560d"
},
"room-card": {
"file": "08-room-card.png",
"viewport": {
"width": 1180,
"height": 900
},
"theme": "dark",
"language": "en",
"sourceSha256": "7f726b212839add4f9fc4491fd23f053b09bf82e38ea380a7cc84d1dc2bcf81a",
"imageSha256": "176abba71d41cfb045a33f82a794d9fbb2a5d3c48e6df66e6ec3a8e448311b11"
},
"device-info": {
"file": "09-device-info.png",
"viewport": {
"width": 1000,
"height": 900
},
"theme": "dark",
"language": "en",
"sourceSha256": "7f726b212839add4f9fc4491fd23f053b09bf82e38ea380a7cc84d1dc2bcf81a",
"imageSha256": "655873ba709a2a702fde533b33ef109343ce0c6ca85ff985fdd7c4d41c877b33"
}
}
}
+2 -2
View File
@@ -1,8 +1,8 @@
# ТЗ #35 — Документация текущего пользовательского опыта
- Issue: https://github.com/Matysh/houseplan-card/issues/35
- Приоритет: P1
- Статус ТЗ: ready for implementation
- Приоритет: P2
- Статус ТЗ: implemented
- Тип: docs-only, без изменения поведения
## Цель и аудитория