media-player
Media-player cap.
Media-player cap. Models HA media_player.* (Sonos, Chromecast, Apple TV, Spotify, Roku, generic OTT receivers, …) on DeviceType.MediaPlayer. Disjoint from the camera streaming surface — those use DeviceType.Camera + the broker pipeline.
The cap declares a wide method surface; not every backend supports every method. Drivers signal sub-capability via the DeviceFeature.MediaPlayerXxx flags (paired one-to-one with the corresponding method) so the UI gates buttons without a slice fetch — same pattern as PanTiltZoom for cameras.
At a glance
| Capability | media-player |
| Provided by | The device's own driver provides it: each device registers its own provider. |
| Active providers per device | one |
| Device types | media-player |
| Source | packages/types/src/capabilities/media-player.cap.ts |
Methods
Every method takes the device id (deviceId) to address the device; the input tables below list the other fields.
| Method | Kind | Required of a provider | Access |
|---|---|---|---|
turnOn | mutation | no | protected |
turnOff | mutation | no | protected |
volumeUp | mutation | no | protected |
volumeDown | mutation | no | protected |
channelUp | mutation | no | protected |
channelDown | mutation | no | protected |
play | mutation | yes | protected |
pause | mutation | yes | protected |
stop | mutation | no | protected |
next | mutation | no | protected |
previous | mutation | no | protected |
setVolume | mutation | no | protected |
setMute | mutation | no | protected |
setShuffle | mutation | no | protected |
setRepeat | mutation | no | protected |
selectSource | mutation | no | protected |
seek | mutation | no | protected |
playMedia | mutation | no | protected |
turnOn
mutation · optional for a provider
Input
No fields besides deviceId.
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
media.turnOn | Turn on |
turnOff
mutation · optional for a provider
Input
No fields besides deviceId.
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
media.turnOff | Turn off |
volumeUp
mutation · optional for a provider
Input
| Field | Type | Required | Description |
|---|---|---|---|
steps | number | no (default 1) |
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
media.volumeUp | Volume up |
volumeDown
mutation · optional for a provider
Input
| Field | Type | Required | Description |
|---|---|---|---|
steps | number | no (default 1) |
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
media.volumeDown | Volume down |
channelUp
mutation · optional for a provider
Input
| Field | Type | Required | Description |
|---|---|---|---|
steps | number | no (default 1) |
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
media.channelUp | Channel up |
channelDown
mutation · optional for a provider
Input
| Field | Type | Required | Description |
|---|---|---|---|
steps | number | no (default 1) |
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
media.channelDown | Channel down |
play
mutation
Input
No fields besides deviceId.
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
media.play | Play | state = "playing" |
pause
mutation
Input
No fields besides deviceId.
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
media.pause | Pause media | state = "paused" |
stop
mutation · optional for a provider
Input
No fields besides deviceId.
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
media.stop | Stop media |
next
mutation · optional for a provider
Input
No fields besides deviceId.
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
media.next | Next track |
previous
mutation · optional for a provider
Input
No fields besides deviceId.
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
media.previous | Previous track |
setVolume
mutation · optional for a provider
Input
| Field | Type | Required | Description |
|---|---|---|---|
volumeLevel | number | yes |
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
media.volume | Set volume | volumeLevel = undefined |
setMute
mutation · optional for a provider
Input
| Field | Type | Required | Description |
|---|---|---|---|
muted | boolean | yes |
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
media.mute | Mute | isMuted = true |
media.unmute | Unmute | isMuted = false |
setShuffle
mutation · optional for a provider
Input
| Field | Type | Required | Description |
|---|---|---|---|
shuffle | boolean | yes |
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
media.shuffleOn | Shuffle on | shuffle = true |
media.shuffleOff | Shuffle off | shuffle = false |
setRepeat
mutation · optional for a provider
Input
| Field | Type | Required | Description |
|---|---|---|---|
repeat | "off" | "all" | "one" | yes |
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
media.repeat | Set repeat | repeat = undefined |
selectSource
mutation · optional for a provider
Input
| Field | Type | Required | Description |
|---|---|---|---|
source | string | yes |
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
media.source | Select source | source = undefined |
seek
mutation · optional for a provider
Input
| Field | Type | Required | Description |
|---|---|---|---|
position | number | yes |
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
media.seek | Seek |
playMedia
mutation · optional for a provider
Input
| Field | Type | Required | Description |
|---|---|---|---|
mediaId | string | yes | Media identifier / URL. |
mediaType | string | yes | Media kind (music, tvshow, movie, app, …) — provider passes it through to the upstream service. |
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
media.playMedia | Play media |
Runtime state
The state Dominevo keeps for each device with this capability, readable without calling the provider.
Runtime-state slice — mirrored by the kernel. UI players read the full slice for live now-playing, volume, and progress updates without polling.
| Field | Type | Required | Description |
|---|---|---|---|
state | "off" | "on" | "idle" | "playing" | "paused" | "buffering" | "standby" | yes | Playback lifecycle state. |
stateSource | "reported" | "assumed" | no (default "reported") | Whether the state fields are readings or the driver's own bookkeeping. A slice written before this field existed parses as reported. |
assumedFields | ("state" | "volumeLevel" | "isMuted" | "source")[] | no (default []) | Which fields are the driver's own guess. stateSource is assumed when this is not empty; a field not listed here is a reading even then (power from a running-state source, mute guessed from the last send). |
volumeLevel | number | null | yes | Volume as 0..100 inclusive. Null when the device has no volume surface. Pair with DeviceFeature.MediaPlayerVolume. |
isMuted | boolean | null | yes | Mute toggle distinct from volume=0. Null when no mute surface. Pair with DeviceFeature.MediaPlayerMute. |
muteReadback | boolean | no | True only when the provider READS the mute state back from the device. Absent or false: mute is a momentary key. A non-null isMuted is not a reading on its own — an infrared send can leave a value without this flag. |
source | string | yes | Active source / input. Empty when no source surface. |
availableSources | string[] | yes | Selectable sources. Empty when no source surface. Pair with DeviceFeature.MediaPlayerSelectSource. |
declaredSources | ({ name: string; kind: "digits" | "sequence" | "ir"; number?: string })[] | no | What each declared source IS, when the sources are the operator's own (a remote, planning#460): an exporter offers a channel by number only for a digits source and an input only for a sequence one. Absent when the player's sources are its own. |
currentMedia | { type: string; title: string; artist?: string; album?: string; imageUrl?: string } | null | yes | Currently-playing media info. Null when nothing is playing. |
position | number | null | yes | Current playback position in ms. Null when not seekable or nothing is playing. Pair with DeviceFeature.MediaPlayerSeek. |
duration | number | null | yes | Total duration of the current media in ms. Null when unknown (live stream) or nothing is playing. |
shuffle | boolean | null | yes | Shuffle toggle. Null when no shuffle surface. Pair with DeviceFeature.MediaPlayerShuffle. |
repeat | "off" | "all" | "one" | null | yes | Repeat mode. Null when no repeat surface. Pair with DeviceFeature.MediaPlayerRepeat. |
positionUpdatedAt | number | null | no (default null) | Ms epoch when position was read from the device. Null when the driver does not say; a UI that advances the position while playing counts from it. |
lastChangedAt | number | yes | Ms epoch when the slice was last updated. |