Capabilities
Valve
Domain valve: states, services, device classes and features.
Entity ids in this domain look like valve.<object_id>.
Use in preferences
{ key: 'device', label: 'Device', type: 'entity', domainFilter: 'valve', 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 | open | closed | opening | closing |
|---|---|---|---|---|
| any | Open | Closed | Opening | Closing |
water | Open | Closed | Opening | Closing |
subscribe($g.device, { to: 'open' }, onChange);
subscribe($g.device, { to: 'Open' }, onChange); // same thing, by label
if ($g.device.is('Open')) { /* … */ }Services
Curated for smart apps (also offered by the wizard action catalog):
| Service | Parameters | Description |
|---|---|---|
closeValve | — | Close |
openValve | — | Open |
setValvePosition | position (number, 0–100, required) | Set position |
stopValve | — | Stop |
toggle | — | Toggle |
await $g.device.closeValve();Device classes
none, water, gas
Filter with deviceClassFilter in an entity input.
Features
Bitmask on the supportedFeatures attribute; read the values with getEntityFeatures().Valve.
| Feature | Bit |
|---|---|
OPEN | 1 |
CLOSE | 2 |
SET_POSITION | 4 |
STOP | 8 |