Skip to content

Thermostat steps

Raise and lower a target temperature, with a sending hint.

steps.liquid
{% assign target = cap.target_temperature %}<div class="steps">  <button class="step" aria-label="Cooler" data-hd-on-click="increment('target_temperature', -0.5)">−</button>  <button class="value" data-hd-on-click="toggleState('details')" aria-expanded="{% if state.details %}true{% else %}false{% endif %}">    <span class="big">{{ target.value | decimals: 1 }}°</span>    <span class="hint">{% if pending.target_temperature %}Sending…{% else %}Target{% endif %}</span>  </button>  <button class="step" aria-label="Warmer" data-hd-on-click="increment('target_temperature', 0.5)">+</button></div>{% if state.details %}  <p class="detail">Room: {{ cap.measure_temperature.value | temp: 1 }}</p>{% endif %}

The preview runs on a made-up climate.thermostat device, so you don’t need a Homey. Edit the template or style to try something; actions don’t reach a device here.

Files

Download the package

template.liquid
{% assign target = cap.target_temperature %}<div class="steps">  <button class="step" aria-label="Cooler" data-hd-on-click="increment('target_temperature', -0.5)">−</button>  <button class="value" data-hd-on-click="toggleState('details')" aria-expanded="{% if state.details %}true{% else %}false{% endif %}">    <span class="big">{{ target.value | decimals: 1 }}°</span>    <span class="hint">{% if pending.target_temperature %}Sending…{% else %}Target{% endif %}</span>  </button>  <button class="step" aria-label="Warmer" data-hd-on-click="increment('target_temperature', 0.5)">+</button></div>{% if state.details %}  <p class="detail">Room: {{ cap.measure_temperature.value | temp: 1 }}</p>{% endif %}
style.css
:host {  display: grid;  align-content: center;  gap: 12px;}.steps {  display: flex;  align-items: center;  justify-content: space-between;  gap: 8px;}.step {  all: unset;  display: grid;  place-items: center;  width: 40px;  height: 40px;  border: var(--hd-border-width) solid var(--hd-border);  border-radius: 50%;  font: 500 22px var(--hd-font-ui);  color: var(--hd-text);  cursor: pointer;}.step:focus-visible,.value:focus-visible {  outline: 2px solid var(--hd-focus);  outline-offset: 3px;}.value {  all: unset;  display: grid;  justify-items: center;  cursor: pointer;}.big {  font: var(--hd-number-weight) 44px / 1 var(--hd-font-display);}.hint,.detail {  margin: 0;  font: 13px var(--hd-font-ui);  color: var(--hd-text-muted);  text-align: center;}
tiledash.json
{  "id": "@your-handle/thermostat-steps",  "title": "Thermostat steps",  "summary": "Raise and lower a target temperature, with a sending hint.",  "version": "1.0.0",  "licence": "MIT",  "tags": [],  "kind": "widget",  "widget": {    "kind": "device",    "match": {      "classes": [        "thermostat",        "heater",        "heatpump",        "airconditioning",        "boiler",        "waterheater"      ],      "requires": [        "target_temperature"      ],      "optional": [        "measure_temperature",        "thermostat_mode",        "onoff",        "heat_pump_mode",        "is_burning",        "is_tapping",        "alarm_generic",        "measure_pressure",        "cook_status",        "status_text",        "measure_duration.time_left",        "measure_temperature.heater_water",        "measure_temperature.tap_water"      ]    },    "size": {      "default": [        3,        6      ],      "min": [        1,        1      ],      "max": [        6,        10      ]    },    "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": "Room 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"      }    ],    "basedOn": "climate.thermostat"  }}

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: Actions · Filters