action.devices.traits.TransportControl question

94 views Asked by At

Trying to implement the action.devices.commands.mediaClosedCaptioningOn command for the TransportControl trait.. I have included 'CAPTION_CONTROL' in the transportControlSupportedCommands array I send on the SYNC intent for the device, but when I actually ask Assistant to turn on subtitles on the device it replies "That device cannot play video" and my code never actually gets an EXECUTE Intent from Assistant.

I've also successfully implemented the mediaShuffle command but noticed that when I issue it, Assistant responds with "Music will shuffle after the current item" when my device actually plays videos.

Anyone have any clue how I tell Assistant that my device plays video? I can't seem to find it in the documentation for TransportControl -- is it under a different trait maybe?

Edit 10/13/2020:

As requested, the complete SYNC response I'm currently sending for this device:

{
    "requestId": "11724082196092058876",
    "payload": {
        "agentUserId": "xxxxxx",
        "devices": [
            {
                "id": "10.0.6.252",
                "type": "action.devices.types.STREAMING_STICK",
                "traits": [
                    "action.devices.traits.TransportControl",
                    "action.devices.traits.Volume",
                    "action.devices.traits.MediaState"
                ],
                "name": {
                    "name": "Bedroom Stick"
                },
                "willReportState": true,
                "roomHint": "bedroom",
                "attributes": {
                    "transportControlSupportedCommands": [
                        "NEXT",
                        "PREVIOUS",
                        "PAUSE",
                        "STOP",
                        "RESUME",
                        "CAPTION_CONTROL",
                        "SEEK_TO_POSITION",
                        "SEEK_RELATIVE",
                        "SET_REPEAT",
                        "SHUFFLE"
                    ],
                    "volumeMaxLevel": 100,
                    "volumeCanMuteAndUnmute": true,
                    "levelStepSize": 10,
                    "commandOnlyVolume": false,
                    "volumeDefaultPercentage": 100,
                    "supportActivityState": false,
                    "supportPlaybackState": true
                }
            }
        ]
    }
}

Exact assistant queries that produce this issue include "OK Google, turn on subtitles on Bedroom Stick" (Response: "That device can't play videos.") and "OK Google, shuffle on Bedroom Stick." (Response: "Alright, music will start shuffling after this track.")

1

There are 1 answers

0
Siddhant Priyadarshi On

There are certain changes you need to make to your sync response that you have posted which might make your device function properly .

  • In the sync response I do see that you are making use of a STREAMING_STICK as your device type. If you go through the documentation you will see that this device has the following required traits :

    • action.devices.traits.AppSelector

    • action.devices.traits.MediaState

    • action.devices.traits.TransportControl

    • action.devices.traits.Volume

    Your sync response is missing the AppSelector trait.

  • It would be good to add the deviceInfo attribute at the end of the sync response.

More information about how to work around with Streaming stick can be found here :

https://developers.google.com/assistant/smarthome/guides/streamingstick#response