Skip to content

hd-floorplan

Attributes and example

hd-floorplan

on change

One level of one of your floor plans (drawn under Floor plans), from above and fitted to the tile, in the theme’s colours (white floors and black walls on Paper). room focuses on one room: it fills the tile and the rooms around it fade. An hd-room inside gives a room its values, shown under its name where the room has space; a small tile shows the shapes only. Touching a room does what the plan’s room panel set (tap, hold, double tap: a dashboard, a flow, a mood, a variable); a tap also passes the room’s id to data-hd-on-change. Says so when the plan is loading, paused, gone or its level is. Nothing moves by itself. look="picture" shows a picture of the level made in the floor planner instead (F20). Parts: ::part(room), ::part(wall), ::part(label), ::part(notice), ::part(picture), ::part(ring), ::part(switch).

AttributeWhat it is
planrequiredThe plan’s id, e.g. {{ settings.plan.id }} (a floor plan setting).
levelrequiredThe level’s id, e.g. {{ settings.plan.level.id }}.
roomA room to focus on, e.g. {{ settings.plan.room.id }}; empty for the whole level.
fade-surroundingsWhen focused on one room, fade the surroundings. false keeps them at full strength; only the chosen room shows labels either way. Raised views keep solid walls opaque.Default true.
fade-levelHow strongly surroundings fade when focusing on one room, from 0 (full strength) to 100 (fully faded). Only applies while fade-surroundings is true.Default 92.
turnTurns the plan clockwise, in degrees; words stay upright.One of 0, 90, 180, 270. Default 0.
furniturefalse leaves the furniture drawn in the plan out.Default true.
action-sourceUse plan defaults (plan) or existing tile device gestures (legacy). Object overrides apply to both.One of plan, legacy. Default legacy.
device-tapWhat a tap on a device does: switch it (lights, plugs, a TV; a cover opens or closes, a player plays or pauses; locks and sensors open their popup), its quick actions card, or its popup.One of switch, actions, popup. Default switch.
device-holdWhat holding a device does: its quick actions card, its popup, or nothing.One of actions, popup, none. Default actions.
device-doubleWhat a double tap on a device does: its popup, its quick actions card, or nothing. While it does something, a single tap waits a moment for a second one.One of popup, actions, none. Default popup.
glowHow lights that are on glow: a pool around each light that walls stop and that adds up where pools meet. Off on Paper.One of off, soft, bright. Default soft.
view25d shows the level raised, from a fixed angle above (turned by turn); 3d as a dollhouse to turn and zoom (Pro). Both need WebGL 2: low-power screens and Paper show 2D.One of 2d, 25d, 3d. Default 2d.
angleIn 25d, the angle the level is seen from: isometric (35°, the three axes shortened alike), game (30°, the 2:1 look of pixel-art games) or steep (50°, more from above).One of isometric, game, steep. Default isometric.
tintTints the rooms on a fixed comfort scale by their temperature or humidity (each hd-room’s temperature or humidity).One of temperature, humidity.
tint-dayAdds a slider over the last day, with a play button, from each hd-room’s sensor history.Default false.
lookpicture starts on a picture of the level made in the floor planner (for its view, of the whole level or the room), with a button to switch to the live plan and back; live without one. Paper stays live.One of live, picture. Default live.
pictureWith look="picture": the id of the picture to show, e.g. {{ settings.picture }} (a floorplanPicture setting); left out, the one chosen in the floor planner, else the one made in the tile's view.
followFor a picture made by day and night: theme shows night on dark themes, sun from sunset to sunrise (sun-up).One of theme, sun. Default theme.
sun-upWith follow="sun": whether the sun is up, e.g. {{ weather.sun.up }}.Default false.
ringsOn a picture, rings where a tap reaches a device: flash shows them for a moment after a tap beside one.One of flash, shown, hidden. Default flash.
<hd-floorplan plan="{{ settings.plan.id }}" level="{{ settings.plan.level.id }}" room="{{ settings.plan.room.id }}">  {% for room in settings.plan.rooms %}<hd-room room="{{ room.id }}" value="{{ room.temperature.text }}°"></hd-room>{% endfor %}</hd-floorplan>

Styling

Set CSS variables on the component element. Its internal elements live in Shadow DOM; only the exposed named parts can be styled with ::part.

--hd-accent
The theme’s accent: active controls, links, highlights.
--hd-appearance
`light`, `dark` or `paper`, for what colours alone can’t decide.
--hd-border
Lines round tiles and between parts.
--hd-border-width
How thick borders are.
--hd-danger
Act now: smoke, a leak, an alarm.
--hd-focus
The outline round what has keyboard focus.
--hd-font-display
The font of big numbers and headings.
--hd-font-ui
The font of labels and running text.
--hd-lit
The warm colour of a device that is on.
--hd-motion-base
An ordinary change, like a value sliding.
--hd-number-weight
How bold big numbers are.
--hd-on-accent
Text and icons on the accent.
--hd-overlay
Menus, dialogs and popups over the page.
--hd-radius-sm
Small corners: chips, small buttons.
--hd-surface
A tile’s colour.
--hd-surface-raised
Something on a tile that stands out from it, like a button.
--hd-text
Text and big numbers.
--hd-text-2xl
CSS input read by hd-floorplan.
--hd-text-2xs
CSS input read by hd-floorplan.
--hd-text-lg
CSS input read by hd-floorplan.
--hd-text-md
CSS input read by hd-floorplan.
--hd-text-muted
Labels and secondary text.
--hd-text-sm
CSS input read by hd-floorplan.
--hd-text-xs
CSS input read by hd-floorplan.
--hd-warn
Worth a look: a low battery, a door open for a while.

Exposed parts

hd-floorplan::part(adjuster) {  /* Your styles */}hd-floorplan::part(heat) {  /* Your styles */}hd-floorplan::part(label) {  /* Your styles */}hd-floorplan::part(mark) {  /* Your styles */}hd-floorplan::part(notice) {  /* Your styles */}hd-floorplan::part(picture) {  /* Your styles */}hd-floorplan::part(quick) {  /* Your styles */}hd-floorplan::part(ring) {  /* Your styles */}hd-floorplan::part(room) {  /* Your styles */}hd-floorplan::part(switch) {  /* Your styles */}hd-floorplan::part(wall) {  /* Your styles */}

Style the host

hd-floorplan {  --hd-accent: #2563eb;  max-width: 100%;}
Theme variables