Smart-Home-Soundbar-Leitfaden
action.devices.types.SOUNDBAR
– Ein All-in-One-Audiogerät, das oft in Verbindung mit einem Fernseher verwendet wird und einen Bar-Formfaktor hat.
Dieser Typ gibt an, dass das Gerät das Soundbar-Symbol und einige zugehörige Synonyme und Aliasse erhält.
Gerätefunktionen
In der entsprechenden Dokumentation zu Merkmalen finden Sie Implementierungsdetails wie Attribute und Status, die Ihr Dienst unterstützen sollte, sowie Informationen zum Erstellen von EXECUTE- und QUERY-Antworten.
Erforderliche Merkmale
Diese Merkmale und Befehle sind erforderlich, sofern sie für Ihr Gerät gelten. Wenn Ihr Gerät diese Eigenschaften nicht unterstützt, geben Sie den Fehlercode functionNotSupported
in einer QUERY- oder EXECUTE-Antwort ein. Weitere Informationen finden Sie unter Fehler und Ausnahmen.
-
action.devices.traits.MediaState
-
action.devices.traits.OnOff
-
action.devices.traits.TransportControl
-
action.devices.traits.Volume
Empfohlene Merkmale
Diese Eigenschaften werden empfohlen, sofern sie für Ihr Gerät gelten. Sie können jedoch alle verfügbaren Merkmale kombinieren, um sie bestmöglich an Ihre vorhandenen Produktfunktionen anzupassen.
Qualitätsanforderungen
- Latenz:darf maximal 3.000 ms betragen.
- Zuverlässigkeit:muss mindestens 97% betragen.
Beispielgerät: Einfache Soundbar
Dieser Abschnitt enthält Beispielnutzlasten für Intents, die eine gängige „Soundbar“ basierend auf den oben genannten Gerätetypen und -merkmalen darstellen. Wenn Sie in Ihrer Implementierung Merkmale hinzufügen oder entfernen, ändern Sie Ihre Antworten entsprechend, um diese Änderungen widerzuspiegeln.
Beispiel für eine SYNC-Antwort
{ "requestId": "6894439706274654512", "inputs": [ { "intent": "action.devices.SYNC" } ] }
{ "requestId": "6894439706274654512", "payload": { "agentUserId": "user123", "devices": [ { "id": "123", "type": "action.devices.types.SOUNDBAR", "traits": [ "action.devices.traits.OnOff", "action.devices.traits.MediaState", "action.devices.traits.Volume", "action.devices.traits.TransportControl" ], "name": { "name": "Simple soundbar" }, "willReportState": true, "attributes": { "transportControlSupportedCommands": [ "NEXT", "PREVIOUS", "PAUSE", "STOP", "RESUME" ], "volumeMaxLevel": 11, "volumeCanMuteAndUnmute": true, "supportActivityState": true, "supportPlaybackState": true }, "deviceInfo": { "manufacturer": "smart-home-inc", "model": "hs1234", "hwVersion": "3.2", "swVersion": "11.4" } } ] } }
Beispiel für eine QUERY-Antwort
{ "requestId": "6894439706274654514", "inputs": [ { "intent": "action.devices.QUERY", "payload": { "devices": [ { "id": "123" } ] } } ] }
{ "requestId": "6894439706274654514", "payload": { "devices": { "123": { "status": "SUCCESS", "online": true, "on": true, "currentVolume": 10, "isMuted": false, "activityState": "ACTIVE", "playbackState": "PAUSED" } } } }
Beispielbefehle für EXECUTE
OnOff
Weitere Informationen zu den Befehlsparametern finden Sie in der
action.devices.traits.OnOff
-Referenz.
{ "requestId": "6894439706274654516", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.OnOff", "params": { "on": true } } ] } ] } } ] }
{ "requestId": "6894439706274654516", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "on": true } } ] } }
Stummschalten
Weitere Informationen zu den Befehlsparametern finden Sie in der
action.devices.traits.Volume
-Referenz.
{ "requestId": "6894439706274654534", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.mute", "params": { "mute": true } } ] } ] } } ] }
{ "requestId": "6894439706274654534", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "currentVolume": 10, "isMuted": true } } ] } }
setVolume
Weitere Informationen zu den Befehlsparametern finden Sie in der
action.devices.traits.Volume
-Referenz.
{ "requestId": "6894439706274654532", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.setVolume", "params": { "volumeLevel": 11 } } ] } ] } } ] }
{ "requestId": "6894439706274654532", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "currentVolume": 11, "isMuted": false } } ] } }
mediaClosedCaptioningOff
Weitere Informationen zu den Befehlsparametern finden Sie in der
action.devices.traits.TransportControl
-Referenz.
{ "requestId": "6894439706274654518", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.mediaClosedCaptioningOff" } ] } ] } } ] }
{ "requestId": "6894439706274654518", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "playbackState": "PLAYING" } } ] } }
mediaClosedCaptioningOn
Weitere Informationen zu den Befehlsparametern finden Sie in der
action.devices.traits.TransportControl
-Referenz.
{ "requestId": "6894439706274654520", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.mediaClosedCaptioningOn", "params": { "closedCaptioningLanguage": "en" } } ] } ] } } ] }
{ "requestId": "6894439706274654520", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "playbackState": "PLAYING" } } ] } }
mediaNext
Weitere Informationen zu den Befehlsparametern finden Sie in der
action.devices.traits.TransportControl
-Referenz.
{ "requestId": "6894439706274654522", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.mediaNext" } ] } ] } } ] }
{ "requestId": "6894439706274654522", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "playbackState": "FAST_FORWARDING" } } ] } }
mediaPause
Weitere Informationen zu den Befehlsparametern finden Sie in der
action.devices.traits.TransportControl
-Referenz.
{ "requestId": "6894439706274654524", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.mediaPause" } ] } ] } } ] }
{ "requestId": "6894439706274654524", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "playbackState": "PAUSED" } } ] } }
mediaPrevious
Weitere Informationen zu den Befehlsparametern finden Sie in der
action.devices.traits.TransportControl
-Referenz.
{ "requestId": "6894439706274654526", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.mediaPrevious" } ] } ] } } ] }
{ "requestId": "6894439706274654526", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "playbackState": "REWINDING" } } ] } }
mediaResume
Weitere Informationen zu den Befehlsparametern finden Sie in der
action.devices.traits.TransportControl
-Referenz.
{ "requestId": "6894439706274654528", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.mediaResume" } ] } ] } } ] }
{ "requestId": "6894439706274654528", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "playbackState": "PLAYING" } } ] } }
mediaStop
Weitere Informationen zu den Befehlsparametern finden Sie in der
action.devices.traits.TransportControl
-Referenz.
{ "requestId": "6894439706274654530", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.mediaStop" } ] } ] } } ] }
{ "requestId": "6894439706274654530", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "playbackState": "STOPPED" } } ] } }