Context

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

NameIn the template and expressionsIn handlers
device, cap, settings, devices, variables, state, pending, item, flow, moodYesYes
eventNoIn a change handler
now, dashboards, taps, prices, energy, weather, weatherNote, appliance, alert, tileChartYesNo

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.

FieldTypeWhat it holds
idtextTiledash’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.
nametextIts name in Homey.
classtextThe class its driver gives it: light, socket, evcharger.
virtualClasstext or nullThe class set in Homey (“What is plugged in?”), or null.
icontextThe registry icon of its class, for hd-icon.
zonetext or nullIts zone in Homey. null when the name already says it, as in “Living room thermostat”.
availableyes/nofalse while Homey can’t reach it. Show a calm “Unavailable”.
imageslistNames of its pictures, such as albumart and snapshot, for hd-image.
videoslistNames 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:

FieldTypeWhat it holds
valueanyAs Homey reports it, in its own unit, not scaled. null before the first reading.
texttextFormatted for showing, without its unit: scaled with it, and with the tile’s decimals. 1.82.
unittext or nullThe unit to show after text, scaled with it: kW for 7400 W. null without one.
titletextIts name, such as “Power”.
unitstext or nullIts unit as Homey declares it: W. Not scaled.
minnumber or nullThe lowest value it takes.
maxnumber or nullThe highest value it takes.
stepnumber or nullThe step it changes in.
setableyes/noWhether it can be changed. Actions are refused on a read-only reading.
valueslistThe choices of an enum reading, each with an id and a title. Empty for the others.
lastUpdatedtime or nullWhen 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.

Kindsettings.<name> is
DeviceA device with its own readings: .id, .name, .zone, .cap.<id>…
CapabilityA reading as in cap, with .id as well
Flow, moodThe flow or mood, with .id and .name
Dashboard{ id, name }
A device, flow, mood or dashboard with multipleA list of those, empty (never null) when none
Number, percentage, yes/no, text, choice, size, spotThe value itself
Colour, iconThe value, or null without one
The bigger kindsA list or object as the reference describes

state and pending

NameWhat it holds
stateWhat 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.
pendingCommands 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

NameWhat it holds
itemThe tile: item.id is its id on the dashboard.
devicesDevices 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.
variablesHomey 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.

NameFields
flowid, name, kind (basic or advanced), folder, enabled, triggerable
moodid, 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.

FieldTypeWhat it holds
sourcetextWhere they come from: homey, energyzero, entsoe or fixed.
sourceNametextIts name: “EnergyZero”.
currency, symboltextThe ISO code, EUR, and the symbol, €.
unittextkWh.
timeZonetextThe Homey’s time zone, which days and times are in.
fallbackobject or nullWhile the chosen source is down: sourceName, since, sinceText and a calm sentence in note.
updated, updatedTexttextWhen it was updated, as an ISO time and as “Updated 13:04”.
now, nextslot or nullThe price slot running now, and the one after it.
today, tomorrowday or nullThe day’s prices. Tomorrow’s are null until they are out, about 13:00.
pendingtext or null“Tomorrow’s prices after ~13:00” while tomorrow isn’t out.
upcominglistEvery known slot from now on.
barsobjectToday and tomorrow together for hd-price-bars: start, step, values, levels, slots and pending.
cheapestobjectThe cheapest run of 1 to 8 whole hours from now: prices.cheapest[3]. A window, or null.
nightobjectThe same for the coming night, up to 07:00.
readyByobjectThe same until a whole hour it has to be ready by: prices.readyBy[7][3].
gas, waterobject or nullA 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.

FieldWhat it holds
updatedWhen it was worked out, as an ISO time.
currencyThe currency of the costs.
dayToday on the Homey’s clock, start and end, for hd-chart’s from and to.
costWhat electricity, gas and water cost today so far: value and text. null without prices.
electricityA meter whose today is what was taken from the grid (Homey’s day usage), plus imported and exported. null without one.
gas, waterA meter each, in m³ and litres.
solarproduced, selfUsed and exported amounts, selfUse (0 to 100), earned, peak and hours, and what a meter row needs (below). null without solar.
batterylevel, charged and discharged amounts, saved, cycles and hours.
evcharging, the running session, the last sessions and the month.
topThe 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.
partsThe live readings behind it, such as solarPower and batteryPower, each a reading you can bind to.
periodsToday, 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:

FieldWhat it holds
typicalA typical day: byNow, day, a change, and share and byNowShare. null without history.
hoursBars for hd-bars: values, previous, labels and the running bar, current.
compareday, week and month, each a period against the one before: current, previous, previousWhole, a change and bars.
flowA 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].

FieldWhat it holds
key, periodThe 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.
rangeIts dates: “Mon 5 – Sun 11 Oct”, “Week 39 · 21–27 Sep”, “October 2026”.
against, previousLabelThe period before, as “vs last week” says it.
sameMomentThe same moment in the period before (“Sat 19:40”); empty for a finished period.
progress, finishedHow far into the period (0 to 1), and whether it is over.
cost, previousCost, costChangeWhat 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, waterA row each (below), or null without that meter.
missingWhy the comparison is left out, such as “Homey has only part of last year”; null when it isn’t.
back, earlier, laterHow many periods before the running one it is, and whether there is one before or after it to step to.
earlierLabel, laterLabelWhat stepping back or forward shows: “Last week”, “Week 39”.
loadingtrue 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:

FieldWhat it holds
estimatedtrue when all or part of the amount was worked out from power readings rather than counted.
estimatedTextWhy, 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.

FieldWhat it holds
placeThe place’s name.
nowThe weather now: a look (condition, intensity, night, showers, words), temp, feels, high, low, wind, windFrom, windTo, humidity, rainChance, rain and uv.
hoursThe coming hours, up to 24, each with a look, label, temp, at (0 to 1 for a curve), rain and rainChance.
daysThe week, each with a look, label, low, high, lo and hi (0 to 1 for a bar), rainChance and rain.
sunrise, set, up and progress through the day.
creditWho supplied the forecast.
updated, staleWhen 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.

NameFields
appliancekind (washer, dryer or dishwasher), state (running, done or off), since, power, from and problem
alertkind (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.

FieldWhat it holds
readingsThe readings charted, as ids of the device. Up to 4, and up to 3 for a chart below the content.
typearea, line, bar, stacked or step.
placementbackground or inline.
range6h, 12h, 24h, 7d or 30d.
detailauto, 15m, 1h or 1d.
smoothWhether the lines are curved.

event

Only in a change handler, the new value of the control that changed: event.value.