Skip to content

Actions

What a widget can do when it's tapped: switch devices, start flows, open dashboards and more.

Devices

toggle(capability, deviceId?)

Switches a yes/no capability to the other value: on becomes off, off becomes on. A yes/no capability that can be changed, of the tile’s device or of the device given.

TakesWhat it is
capabilityrequiredA capability id of that device, quoted: 'onoff', 'evcharger_charging'.
deviceIdA device: a setting’s settings.<name>.id. Left out, the tile’s own device.
toggle('onoff')toggle('onoff')

set(capability, value, deviceId?)

Sets a capability: true or false, a number within its min and max (snapped to its step), or one of an enum’s ids. A capability that can be changed, of the tile’s device or of the device given.

TakesWhat it is
capabilityrequiredA capability id of that device, quoted: 'onoff', 'evcharger_charging'.
valuerequiredWhat to set it to.
deviceIdA device: a setting’s settings.<name>.id. Left out, the tile’s own device.
set('evcharger_charging', false)confirm('Stop charging?') && set('evcharger_charging', false)set('dim', 0.5)

increment(capability, step, deviceId?)

Adds the step to a number capability (a negative step lowers it), stopping at its min or max. A number capability that can be changed and has a value.

TakesWhat it is
capabilityrequiredA capability id of that device, quoted: 'onoff', 'evcharger_charging'.
steprequiredHow much to add, e.g. 0.5 or -1.
deviceIdA device: a setting’s settings.<name>.id. Left out, the tile’s own device.
increment('target_temperature', 0.5)increment('volume_set', 0.05)

Flows and moods

startFlow(flowId)

Starts a flow and says so in a toast. A flow of this Homey that can be started by hand: a flow setting’s settings.<name>.id.

TakesWhat it is
flowIdrequiredThe flow’s id.
startFlow(settings.boost.id)

setMood(moodId)

Sets a mood and says so in a toast. A mood of this Homey: a mood setting’s settings.<name>.id.

TakesWhat it is
moodIdrequiredThe mood’s id.
setMood(settings.evening.id)

pressHomeyTile(homeyTileId, gesture?)

Presses a Homey tile (phase 52): the Tiledash app on Homey runs the flows that start with _[tile] is pressed_, with how it was pressed as a tag. Says so in a toast when the app isn’t in touch. A Homey tile one of this tile’s taps tells: taps.<setting>.homeyTileId when its user chose Tell Homey.

TakesWhat it is
homeyTileIdrequiredThe Homey tile’s id, from taps.
gestureHow it was pressed: 'tap' (the default), 'hold' or 'double'.
taps.sceneTap.type == 'homey' && pressHomeyTile(taps.sceneTap.homeyTileId, 'hold')

Variables

setVariable(variableId, value)

Sets a Homey Logic variable to a value of its type and says so in a toast. Needs the permission to change variables; without it a toast says to log in again. A variable of this Homey, by its id: a value setting’s source (settings.<name>.variableId) or one you name.

TakesWhat it is
variableIdrequiredThe variable’s id.
valuerequiredYes/no, a number or text, as the variable holds.
setVariable(settings.mode.variableId, 'Night')confirm('Guests are leaving?') && setVariable(settings.guests.variableId, false)

toggleVariable(variableId)

Flips a yes/no Logic variable and says so in a toast. A yes/no variable of this Homey, by its id.

TakesWhat it is
variableIdrequiredThe variable’s id.
toggleVariable(settings.guests.variableId)

addToVariable(variableId, amount)

Adds to a number Logic variable (a negative amount takes away) and says so in a toast. A number variable of this Homey, by its id.

TakesWhat it is
variableIdrequiredThe variable’s id.
amountrequiredHow much to add; negative to take away.
addToVariable(settings.setpoint.variableId, 0.5)

Web requests

sendRequest(key)

Sends a web request set in one of this tile’s taps, from the browser, without reading the reply, and says so in a toast. A widget never sees the address: only requests the tile’s user set on this dashboard are sent. The key of a request a tap of this tile sends: taps.<setting>.key (or .hold.key, .double.key) when its user chose Send a web request.

TakesWhat it is
keyrequiredThe request’s key, from taps.
taps.doorTap.type == 'request' && sendRequest(taps.doorTap.key)

Open

openHistory(capability, range?, deviceId?)

Opens a capability’s history in a dialog; the range is picked there and starts at 24 hours. A capability the device has (it doesn’t have to be changeable).

TakesWhat it is
capabilityrequiredA capability id of that device, quoted: 'onoff', 'evcharger_charging'.
rangeIgnored for now: the dialog starts at 24 hours.
deviceIdA device: a setting’s settings.<name>.id. Left out, the tile’s own device.
openHistory('measure_power', '24h')

openDevice(deviceId?, mode?)

Opens the device’s controls and readings over this page as a popup or a side panel, or on the Devices page. A device of this Homey. On a wall panel or a share link it always opens over the page, with the controls and readings only.

TakesWhat it is
deviceIdA device: a setting’s settings.<name>.id. Left out, the tile’s own device.
mode'popup' (the default), 'side' (a side panel) or 'page' (the Devices page).
openDevice()openDevice(, 'side')

openCamera(deviceId?)

Shows a camera big and live. A camera of this Homey.

TakesWhat it is
deviceIdA device: a setting’s settings.<name>.id. Left out, the tile’s own device.
openCamera()

navigate(dashboardSlug)

Goes to another dashboard; a toast says so when it no longer exists. A dashboard of yours, by its slug.

TakesWhat it is
dashboardSlugrequiredThe dashboard’s slug, quoted.
navigate('energy')

openDashboard(dashboardId, mode?, tab?)

Opens a dashboard as a page, or over this one as a popup, a side panel or full screen. A dashboard of yours, by its id.

TakesWhat it is
dashboardIdrequiredThe dashboard’s id.
mode'page' (the default), 'popup', 'side' (a side panel) or 'full' (full screen).
tabOptional: 'tileId:tabName' opens that tile of the dashboard on that tab (a Stack's page id), as a link to a tab does.
openDashboard(settings.dashboard.id, 'popup')openDashboard(settings.dashboard.id, 'side')openDashboard(settings.dashboard.id, 'full')openDashboard(settings.dashboard.id, 'page', 'stackTileId:pageId')

This widget

setState(key, value, forMs?)

Keeps a value in state.<key> for this tile on this screen and draws the widget again; it is remembered there after a reload. With forMs it goes back to null after that long, and isn’t remembered. Nothing outside the widget. At most 32 keys; forMs from 100 to 60000.

TakesWhat it is
keyrequiredA name: letters, digits and _, starting with a letter.
valuerequiredText, a number, true, false or null.
forMsOptional: milliseconds until it goes back to null.
setState('details', true)setState('flash', true, 2000)

toggleState(key)

Flips state.<key> between true and false. Nothing outside the widget.

TakesWhat it is
keyrequiredA state name.
toggleState('open')

openPopup(id?, look?)

Opens one of the widget’s own popups over the page: the template’s <hd-popup id="…">…</hd-popup> block with that id ('main' without one). The tile never shows its popup blocks; a popup is drawn from the same template, so it has the same device, settings and state, and its controls work as the tile’s. A side panel is a sheet from the bottom on a phone. Nothing outside the widget. Its controls in the popup go through the same checks as on the tile.

TakesWhat it is
idOptional: the id of a <hd-popup> block in the template, letters, digits, - and _ (at most 40).
lookOptional: 'popup' (the default, a card in the middle) or 'side' (a panel from the right).
openPopup()openPopup('scenes')openPopup('details', 'side')

closePopup()

Closes the popup this widget opened, as its ✕ does; on the tile it does nothing. Nothing outside the widget.

closePopup()

runTap(setting)

Runs what the tile’s user chose for a tap setting (or its default), as tapping a part marked with it does: for a handler of your own that taps through to it, like the map’s plain tap. A tap setting of this widget; its choice goes through the same checks as any action.

TakesWhat it is
settingrequiredThe tap setting’s name, quoted.
runTap('tileTap')confirm('Open it?') && runTap('tileTap')

Ask and tell

confirm(message)

Asks yes or no; with && the rest only runs after yes. The person at the screen.

TakesWhat it is
messagerequiredThe question, at most 200 characters.
confirm('Stop charging?') && set('evcharger_charging', false)

toast(message)

Shows a short message at the bottom of the screen. The person at the screen.

TakesWhat it is
messagerequiredAt most 200 characters.
toast('Charging stopped')