Climate with a sparkline
A reading with its recent history as a small chart.
{% assign reading = cap.measure_temperature %}<header class="head"> <hd-icon name="device.temperature"></hd-icon> {{ device.name }}</header><p class="big">{{ reading.value | temp: 1 }}</p><p class="sub">{{ cap.measure_humidity.value | round }} % humidity</p><hd-sparkline variant="area"> <hd-series bind="{{ reading }}"></hd-series></hd-sparkline>The preview runs on a made-up sensor.climate device, so you don’t need a Homey. Edit the template or style to try something; actions don’t reach a device here.
Files
{% assign reading = cap.measure_temperature %}<header class="head"> <hd-icon name="device.temperature"></hd-icon> {{ device.name }}</header><p class="big">{{ reading.value | temp: 1 }}</p><p class="sub">{{ cap.measure_humidity.value | round }} % humidity</p><hd-sparkline variant="area"> <hd-series bind="{{ reading }}"></hd-series></hd-sparkline>:host { display: flex; flex-direction: column; gap: 4px;}.head { display: flex; align-items: center; gap: 8px; margin: 0; font: 500 11px var(--hd-font-mono); letter-spacing: var(--hd-label-tracking); text-transform: var(--hd-label-transform); color: var(--hd-text-muted);}.big { margin: auto 0 0; font: var(--hd-number-weight) 52px / 1 var(--hd-font-display);}.sub { margin: 0; font: 13px var(--hd-font-ui); color: var(--hd-text-muted);}hd-sparkline { height: 44px;}{ "id": "@your-handle/home-climate", "title": "Climate with a sparkline", "summary": "A reading with its recent history as a small chart.", "version": "1.0.0", "licence": "MIT", "tags": [], "kind": "widget", "widget": { "kind": "device", "match": { "requires": [ "measure_temperature" ], "optional": [ "measure_humidity", "measure_co2", "measure_battery", "alarm_battery" ] }, "size": { "default": [ 3, 4 ], "min": [ 1, 1 ], "max": [ 6, 8 ] }, "align": { "y": "end" }, "settings": [ { "name": "tileTap", "label": "The tile", "required": false, "group": "tap", "type": "tap", "gesture": "tap", "default": { "type": "none" }, "hold": { "type": "device" }, "double": { "type": "none" }, "allow": [ "toggle", "device", "dashboard", "flow", "mood", "variable", "request" ] }, { "name": "temperatureTap", "label": "Temperature", "required": false, "group": "tap", "type": "tap", "gesture": "tap", "default": { "type": "none" }, "hold": { "type": "none" }, "double": { "type": "none" }, "allow": [ "toggle", "device", "history", "dashboard", "flow", "mood", "variable", "request" ], "capability": "measure_temperature" }, { "name": "humidityTap", "label": "Humidity", "required": false, "group": "tap", "type": "tap", "gesture": "tap", "default": { "type": "none" }, "hold": { "type": "none" }, "double": { "type": "none" }, "allow": [ "toggle", "device", "history", "dashboard", "flow", "mood", "variable", "request" ], "capability": "measure_humidity" } ], "basedOn": "sensor.climate" }}Use it
In the editor, start from the widget it’s based on and paste the template and style; or unzip the package, replace your-handle with your name in the Community and publish it. Build your first widget walks through both.
Read more: Components · Filters