Skip to content

hd-history

Live preview

<hd-history readings="{{ cap.measure_temperature }},{{ cap.measure_humidity }}" names="Temperature,Humidity" range="24h"></hd-history>

Attributes and example

hd-history

The history of one or more readings as a tile of its own: a chart with range chips (6 hours to a year), what to show (a meter’s usage, or the average, lowest or highest), detail, and with several readings a total, an average or a line each, and the totals under it. It shows what fits its size, keeps up to date (every minute while visible, every five on e-ink) and says so when a reading isn’t recorded or the plan keeps less than the range. What it is shown with (range, what to show, detail) can be changed on the tile and is kept only while the page is open. Its content (an icon, a name, the readings’ names) becomes its heading; the attributes only say what it starts with.

AttributeWhat it is
readingsrequiredUp to six readings separated by commas, each a live capability reference (a readings setting’s {{ r.cap }}, @<device>/<capability>), device-id/capability (3f2c…/measure_power), or one of the Homey’s energy and price values as @host/<key> (@host/prices:now, from a readings setting with energy): amounts as bars, a price as steps.
namesA name per reading for the legend and the totals, separated by commas.
rangeHow far back it starts: 6 hours, 12 hours, 24 hours, 7, 30 days or a year.One of 6h, 12h, 24h, 7d, 30d, 1y. Default 24h.
viewWhat it starts with: usage (a meter’s rise per hour or day), reading (the meter itself), avg, min, max; auto is usage for meters and the average for the rest.One of auto, usage, reading, avg, min, max. Default auto.
detailHow fine the line is: every detail (auto), or hourly or daily averages.One of auto, 1h, 1d. Default auto.
combineSeveral readings as one figure (their sum or average, which can still be split into a line each on the tile) or a line each.One of lines, sum, average. Default lines.
colorA theme colour name or #rrggbb for one reading or a total; lines get the theme’s chart colours.
<hd-history readings="{{ cap.measure_temperature }},{{ cap.measure_humidity }}" names="Temperature,Humidity" range="24h"></hd-history>

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.

No component-specific CSS variables are exposed. Use the host element’s sizing and the documented theme variables.

Style the host

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