Capabilities
Timer
Domain timer: states, services, device classes and features.
Entity ids in this domain look like timer.<object_id>.
Use in preferences
{ key: 'device', label: 'Device', type: 'entity', domainFilter: 'timer', required: true }States
getState() returns the raw token. subscribe filters, entity.is() and matchesState() also accept the friendly label the app shows (any case; spaces, hyphens and underscores interchangeable).
| Device class | idle | active | paused |
|---|---|---|---|
| any | Idle | Running | Paused |
subscribe($g.device, { to: 'idle' }, onChange);
subscribe($g.device, { to: 'Idle' }, onChange); // same thing, by label
if ($g.device.is('Idle')) { /* … */ }Services
Curated for smart apps (also offered by the wizard action catalog):
| Service | Parameters | Description |
|---|---|---|
cancel | — | Cancel |
change | duration (number, required) | Add / remove time |
finish | — | Finish now |
pause | — | Pause |
start | duration (number, 1–) — Leave blank to use the timer's configured duration (or resume a paused timer). | Start |
await $g.device.cancel();