Skip to content

A setting

Let each tile choose its own label.

Configurable label
<p>{{ settings.label }}</p>{% if cap.measure_temperature.value != nil %}  <p class="reading">{{ cap.measure_temperature.value | temp: 1 }}</p>{% else %}  <p>No temperature available</p>{% endif %}

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.

How it works

The setting is declared in tiledash.json with a name, a type and a default. The template reads it as settings.label. Each tile that uses the widget fills it in separately.

A text setting is shown as typed; there is no translation for the viewer.

Files

Download the package

template.liquid
<p>{{ settings.label }}</p>{% if cap.measure_temperature.value != nil %}  <p class="reading">{{ cap.measure_temperature.value | temp: 1 }}</p>{% else %}  <p>No temperature available</p>{% endif %}
style.css
:host {  display: flex;  flex-direction: column;  gap: 12px;  padding: 12px;}p {  margin: 0;}.reading {  font: var(--hd-number-weight) 36px var(--hd-font-display);}button {  color: var(--hd-text);  background: var(--hd-surface);  border: 1px solid var(--hd-border);  padding: 10px;  border-radius: var(--hd-control-radius);}
tiledash.json
{  "id": "@your-handle/label-setting",  "title": "A setting",  "summary": "Let each tile choose its own label.",  "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": "label",        "label": "Label",        "required": true,        "group": "content",        "type": "text",        "default": "Room temperature",        "maxLength": 80,        "multiline": false      }    ],    "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: Settings · Liquid