Capabilities
Input boolean
Domain input_boolean: states, services, device classes and features.
Entity ids in this domain look like input_boolean.<object_id>.
Use in preferences
{ key: 'device', label: 'Device', type: 'entity', domainFilter: 'input_boolean', 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).
onoff
subscribe($g.device, { to: 'on' }, onChange);
if ($g.device.is('on')) { /* … */ }Services
Curated for smart apps (also offered by the wizard action catalog):
| Service | Parameters | Description |
|---|---|---|
toggle | — | Toggle |
turnOff | — | Turn off |
turnOn | — | Turn on |
await $g.device.toggle();