Context
The context is the data a widget is given each time it is drawn.
A template reads it by name: {{ device.name }}, {{ cap.measure_power.text }}, {% if settings.pump %}.
The Data panel in the editor shows the same tree with live values for the device you preview with.
Nothing outside the context can be read, and nothing in it can be changed. Values that don’t exist are empty, not errors, so test for them where a widget has to work without.
Where each name can be read
| Name | In the template and expressions | In handlers |
|---|---|---|
device, cap, settings, devices, variables, state, pending, item, flow, mood | Yes | Yes |
event | No | In a change handler |
now, dashboards, taps, prices, energy, weather, weatherNote, appliance, alert, tileChart | Yes | No |
An expression reads any variable of the template, including the ones you assign, let or loop over.
device
The tile’s own device: its names and state, without its readings, which are in cap.
It is null for a widget without a device of its own, which reads everything from its settings.
| Field | Type | What it holds |
|---|---|---|
id | text | Tiledash’s id of the device. Actions take it as their device. A test device’s is test-<uuid>: test- and the id it was made with. |
name | text | Its name in Homey. |
class | text | The class its driver gives it: light, socket, evcharger. |
virtualClass | text or null | The class set in Homey (“What is plugged in?”), or null. |
icon | text | The registry icon of its class, for hd-icon. |
zone | text or null | Its zone in Homey. null when the name already says it, as in “Living room thermostat”. |
available | yes/no | false while Homey can’t reach it. Show a calm “Unavailable”. |
images | list | Names of its pictures, such as albumart and snapshot, for hd-image. |
videos | list | Names of its live videos, a camera’s, for hd-camera. |
cap
Every reading of the tile’s device, by its id: cap.onoff, cap.measure_power.
A reading the device doesn’t have is missing, so {% if cap.dim %} tests whether the device can dim.
Each reading has these fields:
| Field | Type | What it holds |
|---|---|---|
value | any | As Homey reports it, in its own unit, not scaled. null before the first reading. |
text | text | Formatted for showing, without its unit: scaled with it, and with the tile’s decimals. 1.82. |
unit | text or null | The unit to show after text, scaled with it: kW for 7400 W. null without one. |
title | text | Its name, such as “Power”. |
units | text or null | Its unit as Homey declares it: W. Not scaled. |
min | number or null | The lowest value it takes. |
max | number or null | The highest value it takes. |
step | number or null | The step it changes in. |
setable | yes/no | Whether it can be changed. Actions are refused on a read-only reading. |
values | list | The choices of an enum reading, each with an id and a title. Empty for the others. |
lastUpdated | time or null | When Homey last reported it, as an ISO time. |
Written whole into an attribute, with no field after it, a reading turns into a live reference to it, such as @<device id>/<reading id>.
That is how bind="{{ cap.dim }}" and <hd-series bind="{{ cap.measure_power }}"> know which reading you mean, whichever device it belongs to.
Sub-capabilities
Homey’s sub-capabilities have a dot in their id, such as measure_temperature.inside.
Read them as plain paths, cap.measure_temperature.inside.value, when both parts are plain names and no part is named like one of the fields above.
Otherwise use brackets, cap['meter_power.T1-high'].
A loop over cap sees only the main readings, and every sub-capability is also reachable the long way, cap['measure_temperature.inside'].
settings
What the tile chose for each setting the widget declares, by name: settings.title, settings.pump.
What each kind reads as is in the settings reference.
A setting that isn’t chosen, is gone from the Homey or no longer fits is null.
| Kind | settings.<name> is |
|---|---|
| Device | A device with its own readings: .id, .name, .zone, .cap.<id>… |
| Capability | A reading as in cap, with .id as well |
| Flow, mood | The flow or mood, with .id and .name |
| Dashboard | { id, name } |
A device, flow, mood or dashboard with multiple | A list of those, empty (never null) when none |
| Number, percentage, yes/no, text, choice, size, spot | The value itself |
| Colour, icon | The value, or null without one |
| The bigger kinds | A list or object as the reference describes |
state and pending
| Name | What it holds |
|---|---|
state | What the widget keeps for itself with setState and toggleState: state.details. At most 32 values, kept per tile on a screen, remembered after a reload unless set for a time. |
pending | Commands sent for the tile’s own device that Homey hasn’t answered yet, by reading: pending.target_temperature.value. Mostly empty. |
item, devices and variables
| Name | What it holds |
|---|---|
item | The tile: item.id is its id on the dashboard. |
devices | Devices you name by id, devices['<id>'], each like a device setting with its own cap. They only exist on your Homey, so a device setting is better. |
variables | Homey Logic variables you name by id, variables['<id>']. They only exist on your Homey, so a value setting is better. |
A variable has name, value (a number, true or false, or text), text (ready to show: Yes or No, a number as it reads well), type (boolean, number or string) and lastUpdated, when Tiledash saw it change.
Only the variables a template names are read, and they are followed live.
The id stays the same when the variable is renamed in Homey.
In the editor, the Data panel lists your variables by name, and typing variables[ offers them; either puts in the id.
Make this a setting turns one into a value setting, so each tile picks its own.
flow and mood
Set for a widget of the kind flow or mood, null for the others.
| Name | Fields |
|---|---|
flow | id, name, kind (basic or advanced), folder, enabled, triggerable |
mood | id, name, zone |
dashboards
The Homey’s dashboards, a list of { id, name }, for a widget that points at one.
taps
The tap settings that do something on this tile, by their name: taps.lampTap.
A tap that is set to nothing isn’t there, so {% if taps.lampTap %} tells you whether a part is worth showing as tappable.
Each is an object with a type (toggle, history, device, dashboard, flow or mood) and what it acts on.
The runtime runs these for the parts you mark with data-hd-tap, so you rarely need to read them.
now
When the data was put together, as an ISO time such as 2026-10-12T07:00:00.000Z.
It moves on with each live update, not every second.
Use it with since(), until() and isToday() or the date filter.
A template that reads it is drawn again every minute.
Liquid’s own variables
Inside a {% for %}, forloop says where you are: index, index0, rindex, first, last and length.
The loop variable you name, and anything you assign, capture or let, is a variable too.
prices
The Homey’s electricity prices, from the source chosen in Energy settings.
It is null while there are none.
| Field | Type | What it holds |
|---|---|---|
source | text | Where they come from: homey, energyzero, entsoe or fixed. |
sourceName | text | Its name: “EnergyZero”. |
currency, symbol | text | The ISO code, EUR, and the symbol, €. |
unit | text | kWh. |
timeZone | text | The Homey’s time zone, which days and times are in. |
fallback | object or null | While the chosen source is down: sourceName, since, sinceText and a calm sentence in note. |
updated, updatedText | text | When it was updated, as an ISO time and as “Updated 13:04”. |
now, next | slot or null | The price slot running now, and the one after it. |
today, tomorrow | day or null | The day’s prices. Tomorrow’s are null until they are out, about 13:00. |
pending | text or null | “Tomorrow’s prices after ~13:00” while tomorrow isn’t out. |
upcoming | list | Every known slot from now on. |
bars | object | Today and tomorrow together for hd-price-bars: start, step, values, levels, slots and pending. |
cheapest | object | The cheapest run of 1 to 8 whole hours from now: prices.cheapest[3]. A window, or null. |
night | object | The same for the coming night, up to 07:00. |
readyBy | object | The same until a whole hour it has to be ready by: prices.readyBy[7][3]. |
gas, water | object or null | A price per m³: price, text and unit. null when not set. |
A slot has start, end, time (“13:00”), price, text (“€0.36”), cents, level, word, share, now and past.
level is negative, cheap, normal or high, word is its name (“Cheap”), and share places the price on its day from 0, the lowest, to 1, the highest.
A day has label, start, step, values and levels (for hd-price-bars), its slots, low and high (each with price, text and time), average (price and text) and negative, the number of slots below zero.
A window has hours, start, end, from, to, when (“Today”, “Tonight”, “Tomorrow”), average, text, level, saving (how much cheaper than the average of the hours it was picked from, 0 to 100), running, startsIn in minutes, startsInText and complete, which is false while the hours it is picked from run past the prices known.
energy
The Homey’s electricity, gas, water, solar, battery and car today, from Homey’s own energy reports and the recorded meters.
It is null while there is nothing.
| Field | What it holds |
|---|---|
updated | When it was worked out, as an ISO time. |
currency | The currency of the costs. |
day | Today on the Homey’s clock, start and end, for hd-chart’s from and to. |
cost | What electricity, gas and water cost today so far: value and text. null without prices. |
electricity | A meter whose today is what was taken from the grid (Homey’s day usage), plus imported and exported. null without one. |
gas, water | A meter each, in m³ and litres. |
solar | produced, selfUsed and exported amounts, selfUse (0 to 100), earned, peak and hours, and what a meter row needs (below). null without solar. |
battery | level, charged and discharged amounts, saved, cycles and hours. |
ev | charging, the running session, the last sessions and the month. |
top | The devices that used most today: id, name, zone, icon, used, share and percent (of what came from the grid), and estimated when Homey worked the use out rather than measured it. |
parts | The live readings behind it, such as solarPower and batteryPower, each a reading you can bind to. |
periods | Today, this week, this month and this year so far, each against the period before up to the same moment (below). null while there is nothing. |
An amount has value, text (“12.4”), unit (kWh, m³ or L), cost and costText.
A change has percent, text (“−12 %”), direction (down, up or same) and good.
A meter (electricity, gas or water) has kind, label, icon, unit, then amounts for today, yesterday and sameTimeYesterday, a change against yesterday at the same time, and:
| Field | What it holds |
|---|---|
typical | A typical day: byNow, day, a change, and share and byNowShare. null without history. |
hours | Bars for hd-bars: values, previous, labels and the running bar, current. |
compare | day, week and month, each a period against the one before: current, previous, previousWhole, a change and bars. |
flow | A live flow, such as “6.2 L/min”: value, text, unit and running. null without one. |
Solar also reads like a meter, as Energy today’s Solar row does: label, icon and unit, today (made so far), sameTimeYesterday, a change against it where more is good, bars for hd-bars (today’s hours over yesterday’s) and saved, what the power used at home was worth at the price of each hour (below zero, a cost; null without prices).
What went to the grid is in earned, already off electricity’s cost.
Like a period’s row, it says whether it is estimated.
energy.periods
energy.periods.today, .week, .month and .year are calendar periods as your Homey’s reports have them: today by the hour, a week from Monday and a month from the 1st by the day, a year by the month.
Each has the same shape, so a template can pick one with energy.periods[key].
| Field | What it holds |
|---|---|
key, period | The tab it belongs to (today, week, month, year) and the period itself (2026-W41). |
label, title, short, tab | “This week”, “Energy this week”, a short name for a small tile, and the switch’s word. |
range | Its dates: “Mon 5 – Sun 11 Oct”, “Week 39 · 21–27 Sep”, “October 2026”. |
against, previousLabel | The period before, as “vs last week” says it. |
sameMoment | The same moment in the period before (“Sat 19:40”); empty for a finished period. |
progress, finished | How far into the period (0 to 1), and whether it is over. |
cost, previousCost, costChange | What electricity, gas and water cost so far, the same for the period before up to the same moment, and a change between them. |
electricity, solar, gas, water | A row each (below), or null without that meter. |
missing | Why the comparison is left out, such as “Homey has only part of last year”; null when it isn’t. |
back, earlier, later | How many periods before the running one it is, and whether there is one before or after it to step to. |
earlierLabel, laterLabel | What stepping back or forward shows: “Last week”, “Week 39”. |
loading | true for a moment after stepping to a period, while its amounts are fetched. |
A row has kind, label, icon, unit and decimals, amounts for amount (so far), previous (the period before up to the same moment) and previousWhole, a change (where more is good for solar), bars for hd-bars (values, previous, labels, the running bar current and names for its tooltip), for solar, saved, and whether it is estimated.
Estimated amounts
Solar panels without an energy counter still count: their total is worked out from their power readings, hour by hour, which is a little less exact.
The same goes for a meter Homey approximates in its own reports.
energy.solar and every row of energy.periods say so:
| Field | What it holds |
|---|---|
estimated | true when all or part of the amount was worked out from power readings rather than counted. |
estimatedText | Why, in a sentence for a tooltip: “Estimated: worked out from power readings, as the meter has no energy counter”, or “Partly estimated: …” when only some of its meters were. null when counted. |
The built-in energy widgets put a quiet ≈ before such an amount, explained in an hd-tip:
<span class="used"> {%- if m.estimated %}<hd-tip text="{{ m.estimatedText }}">≈</hd-tip>{% endif -%} <hd-value value="{{ m.amount.value }}" decimals="{{ m.decimals }}"></hd-value> {{ m.unit }}</span>A widget can step through the periods with its own state.
Its manifest names the state key (hostData: { energyPeriodStep: 'back' }), and a value such as setState('back', 'week:3') makes the host build energy.periods with three weeks back in the week’s place, no further back than your Homey has reports.
Nothing else in the state reaches the host.
weather
The weather of the Weather widget, and of widgets started from it.
It is null for the others, and weatherNote holds a few calm words on why there is none yet (loading, no place) or null.
| Field | What it holds |
|---|---|
place | The place’s name. |
now | The weather now: a look (condition, intensity, night, showers, words), temp, feels, high, low, wind, windFrom, windTo, humidity, rainChance, rain and uv. |
hours | The coming hours, up to 24, each with a look, label, temp, at (0 to 1 for a curve), rain and rainChance. |
days | The week, each with a look, label, low, high, lo and hi (0 to 1 for a bar), rainChance and rain. |
sun | rise, set, up and progress through the day. |
credit | Who supplied the forecast. |
updated, stale | When it was made as an ISO time, and “Updated 25 min ago” while it couldn’t be renewed. |
A look’s fields are the attributes of hd-weather-icon and hd-weather-sky.
appliance and alert
For a washer, a dryer or a dishwasher, the tile’s device is worked out as an appliance; for a motion, smoke, CO or water sensor, a siren or a doorbell, as an alert.
Both are null for any other device.
| Name | Fields |
|---|---|
appliance | kind (washer, dryer or dishwasher), state (running, done or off), since, power, from and problem |
alert | kind (motion, smoke, co, water, siren or doorbell), tone (accent, lit or danger) and active, whether it is going off now |
tileChart
The chart the tile’s owner added in the Chart tab of its settings, for a device widget that has one. The tile’s frame draws it, so a template doesn’t need to.
| Field | What it holds |
|---|---|
readings | The readings charted, as ids of the device. Up to 4, and up to 3 for a chart below the content. |
type | area, line, bar, stacked or step. |
placement | background or inline. |
range | 6h, 12h, 24h, 7d or 30d. |
detail | auto, 15m, 1h or 1d. |
smooth | Whether the lines are curved. |
event
Only in a change handler, the new value of the control that changed: event.value.