Skip to content

hd-dial

Live preview

<hd-dial bind="{{ cap.target_temperature }}" marker="{{ cap.measure_temperature }}" label="Heat to" caption="Now {{ cap.measure_temperature.value | temp: 1 }}" unit="°"></hd-dial>

Attributes and example

hd-dial

on change

A 270° dial you drag to set a numeric capability (target temperature): the knob is the value, an optional dot shows a second value (the room), and the value sits large in the middle. A value changed from elsewhere (the − and + buttons, the Homey, another screen) springs into place with one small overshoot; under your finger it follows exactly. Reduced motion and e-ink: it moves at once.

AttributeWhat it is
bindThe capability it is bound to, e.g. {{ settings.light.cap.dim }} (the whole capability, no .value): it shows its value, takes min, max and step from it, and sends changes back (shown at once, sprung back if refused, range checked). A device that is unavailable shows its last value, disabled.
valueThe explicit form instead of bind: what it shows, e.g. {{ cap.target_temperature.value }} (or a live capability, followed); a change only goes to data-hd-on-change, which decides what it does. Without a handler it can’t be changed.
minMinimum; defaults to the capability’s.
maxMaximum; defaults to the capability’s.
stepStep; defaults to the capability’s.
markerA second value shown as a dot, e.g. the room temperature. Or a live capability of any device, followed: {{ settings.x.cap.measure_power }}.
labelSmall text above the value, e.g. “Heat to”.
captionSmall text below the value, e.g. “Now 21.0°”.
unitShown after the value, e.g. °.
decimalsDigits after the decimal point.Default 1.
toneColours of the arc: heating runs cool to warm, cooling warm to cool.One of heat, cool, neutral. Default heat.
<hd-dial bind="{{ cap.target_temperature }}" marker="{{ cap.measure_temperature }}" label="Heat to" caption="Now {{ cap.measure_temperature.value | temp: 1 }}" unit="°"></hd-dial>

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-cool
The cool counterpart: cooling, cold water, low prices on some themes.
--hd-ease-out
The easing of most movement.
--hd-ease-spring
A springy easing, for things that bounce into place.
--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-motion-fast
A quick change, like a press. 0ms when nothing may move.
--hd-motion-tempo
CSS input read by hd-dial.
--hd-number-weight
How bold big numbers are.
--hd-text-muted
Labels and secondary text.
--hd-track
The empty part of a slider, bar or ring.

Style the host

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