Guía del receptor AV de casa inteligente
action.devices.types.AUDIO_VIDEO_RECEIVER
: Dispositivo que recibe entradas de audio (por ejemplo, HDMI, óptica y RCA) y emite el sonido a una o más bocinas.
Este tipo indica que el dispositivo obtiene el ícono del receptor AV y algunos íconos sinónimos y alias.
Funciones del dispositivo
Consulta la documentación de la característica correspondiente para detalles de implementación, como los atributos y los estados que tu servicio debe admitir, y cómo compilar respuestas EXECUTE y QUERY.
Características requeridas
Estas características y comandos son obligatorios, si corresponde a tu
dispositivo. Si tu dispositivo no admite estos rasgos, ingresa el código de error de
functionNotSupported
en una respuesta QUERY o EXECUTE. Consulta
Consulta Errores y excepciones para obtener más información.
-
action.devices.traits.InputSelector
-
action.devices.traits.MediaState
-
action.devices.traits.OnOff
-
action.devices.traits.TransportControl
-
action.devices.traits.Volume
Traits recomendados
Se recomiendan estas características, si corresponde a tu dispositivo. Sin embargo, puedes mezclar y combinar todas las características disponibles para que se adapten mejor a tu la funcionalidad del producto.
Requisitos de calidad
- Latencia: Debe ser menor o igual que 3,000 ms.
- Confiabilidad: Debe ser mayor o igual que 97%.
Dispositivo de ejemplo: Receptor de audio y video simple
Esta sección contiene cargas útiles de intents de ejemplo que representan un "receptor de AV" común según el tipo de dispositivo y las características antes mencionadas. Si agregas o quitas características en tu implementación, modificar tus respuestas en consecuencia para reflejar esos cambios.
Ejemplo de respuesta de SYNC
{ "requestId": "6894439706274654512", "inputs": [ { "intent": "action.devices.SYNC" } ] }
{ "requestId": "6894439706274654512", "payload": { "agentUserId": "user123", "devices": [ { "id": "123", "type": "action.devices.types.AUDIO_VIDEO_RECEIVER", "traits": [ "action.devices.traits.AppSelector", "action.devices.traits.InputSelector", "action.devices.traits.MediaState", "action.devices.traits.OnOff", "action.devices.traits.TransportControl", "action.devices.traits.Volume" ], "name": { "name": "Simple audio video receiver" }, "willReportState": true, "attributes": { "transportControlSupportedCommands": [ "NEXT", "PREVIOUS", "PAUSE", "STOP", "RESUME", "CAPTION_CONTROL" ], "volumeMaxLevel": 11, "volumeCanMuteAndUnmute": true, "availableApplications": [ { "key": "youtube", "names": [ { "name_synonym": [ "Youtube", "Youtube_en" ], "lang": "en" } ] } ], "availableInputs": [ { "key": "hdmi_1", "names": [ { "name_synonym": [ "HDMI 1", "DVD Player" ], "lang": "en" } ] }, { "key": "hdmi_2", "names": [ { "name_synonym": [ "HDMI 2", "TV" ], "lang": "en" } ] } ] }, "deviceInfo": { "manufacturer": "smart-home-inc", "model": "hs1234", "hwVersion": "3.2", "swVersion": "11.4" } } ] } }
Ejemplo de respuesta de QUERY
{ "requestId": "6894439706274654514", "inputs": [ { "intent": "action.devices.QUERY", "payload": { "devices": [ { "id": "123" } ] } } ] }
{ "requestId": "6894439706274654514", "payload": { "devices": { "123": { "status": "SUCCESS", "online": true, "on": true, "currentApplication": "youtube", "currentInput": "hdmi_1", "currentVolume": 10, "isMuted": false, "activityState": "ACTIVE", "playbackState": "PAUSED" } } } }
Ejemplos de comandos EXECUTE
appInstall
Para obtener detalles adicionales sobre los parámetros del comando,
consulta la
action.devices.traits.AppSelector
referencia.
{ "requestId": "6894439706274654516", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.appInstall", "params": { "newApplication": "youtube" } } ] } ] } } ] }
{ "requestId": "6894439706274654516", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "currentApplication": "youtube" } } ] } }
appSearch
Para obtener detalles adicionales sobre los parámetros del comando,
consulta la
action.devices.traits.AppSelector
referencia.
{ "requestId": "6894439706274654518", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.appSearch", "params": { "newApplication": "youtube" } } ] } ] } } ] }
{ "requestId": "6894439706274654518", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "currentApplication": "youtube" } } ] } }
appSelect
Para obtener detalles adicionales sobre los parámetros del comando,
consulta la
action.devices.traits.AppSelector
referencia.
{ "requestId": "6894439706274654520", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.appSelect", "params": { "newApplication": "youtube" } } ] } ] } } ] }
{ "requestId": "6894439706274654520", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "currentApplication": "youtube" } } ] } }
SetInput
Para obtener detalles adicionales sobre los parámetros del comando,
consulta la
action.devices.traits.InputSelector
referencia.
{ "requestId": "6894439706274654522", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.SetInput", "params": { "newInput": "hdmi_2" } } ] } ] } } ] }
{ "requestId": "6894439706274654522", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "currentInput": "hdmi_2" } } ] } }
PreviousInput
Para obtener detalles adicionales sobre los parámetros del comando,
consulta la
action.devices.traits.InputSelector
referencia.
{ "requestId": "6894439706274654526", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.PreviousInput" } ] } ] } } ] }
{ "requestId": "6894439706274654526", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "currentInput": "hdmi_2" } } ] } }
NextInput
Para obtener detalles adicionales sobre los parámetros del comando,
consulta la
action.devices.traits.InputSelector
referencia.
{ "requestId": "6894439706274654524", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.NextInput" } ] } ] } } ] }
{ "requestId": "6894439706274654524", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "currentInput": "hdmi_2" } } ] } }
OnOff
Para obtener detalles adicionales sobre los parámetros del comando,
consulta la
action.devices.traits.OnOff
referencia.
{ "requestId": "6894439706274654528", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.OnOff", "params": { "on": true } } ] } ] } } ] }
{ "requestId": "6894439706274654528", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "on": true } } ] } }
mediaClosedCaptioningOff
Para obtener detalles adicionales sobre los parámetros del comando,
consulta la
action.devices.traits.TransportControl
referencia.
{ "requestId": "6894439706274654534", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.mediaClosedCaptioningOff" } ] } ] } } ] }
{ "requestId": "6894439706274654534", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "playbackState": "PLAYING" } } ] } }
mediaClosedCaptioningOn
Para obtener detalles adicionales sobre los parámetros del comando,
consulta la
action.devices.traits.TransportControl
referencia.
{ "requestId": "6894439706274654536", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.mediaClosedCaptioningOn", "params": { "closedCaptioningLanguage": "en" } } ] } ] } } ] }
{ "requestId": "6894439706274654536", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "playbackState": "PLAYING" } } ] } }
mediaNext
Para obtener detalles adicionales sobre los parámetros del comando,
consulta la
action.devices.traits.TransportControl
referencia.
{ "requestId": "6894439706274654538", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.mediaNext" } ] } ] } } ] }
{ "requestId": "6894439706274654538", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "playbackState": "FAST_FORWARDING" } } ] } }
mediaPause
Para obtener detalles adicionales sobre los parámetros del comando,
consulta la
action.devices.traits.TransportControl
referencia.
{ "requestId": "6894439706274654540", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.mediaPause" } ] } ] } } ] }
{ "requestId": "6894439706274654540", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "playbackState": "PAUSED" } } ] } }
mediaPrevious
Para obtener detalles adicionales sobre los parámetros del comando,
consulta la
action.devices.traits.TransportControl
referencia.
{ "requestId": "6894439706274654542", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.mediaPrevious" } ] } ] } } ] }
{ "requestId": "6894439706274654542", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "playbackState": "REWINDING" } } ] } }
mediaResume
Para obtener detalles adicionales sobre los parámetros del comando,
consulta la
action.devices.traits.TransportControl
referencia.
{ "requestId": "6894439706274654544", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.mediaResume" } ] } ] } } ] }
{ "requestId": "6894439706274654544", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "playbackState": "PLAYING" } } ] } }
mediaStop
Para obtener detalles adicionales sobre los parámetros del comando,
consulta la
action.devices.traits.TransportControl
referencia.
{ "requestId": "6894439706274654546", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.mediaStop" } ] } ] } } ] }
{ "requestId": "6894439706274654546", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "playbackState": "STOPPED" } } ] } }
silenciar
Para obtener detalles adicionales sobre los parámetros del comando,
consulta la
action.devices.traits.Volume
referencia.
{ "requestId": "6894439706274654532", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.mute", "params": { "mute": true } } ] } ] } } ] }
{ "requestId": "6894439706274654532", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "currentVolume": 10, "isMuted": true } } ] } }
setVolume
Para obtener detalles adicionales sobre los parámetros del comando,
consulta la
action.devices.traits.Volume
referencia.
{ "requestId": "6894439706274654530", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.setVolume", "params": { "volumeLevel": 11 } } ] } ] } } ] }
{ "requestId": "6894439706274654530", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "currentVolume": 11, "isMuted": false } } ] } }