Panduan Soundbar Streaming Smart Home

action.devices.types.STREAMING_SOUNDBAR - Perangkat ini adalah kombinasi speaker dan stik atau kotak streaming. Perangkat ini memberikan pengalaman streaming selain kemampuan soundbar.

Jenis ini menunjukkan bahwa perangkat mendapatkan ikon Streaming Soundbar serta beberapa sinonim dan alias yang terkait.

Kemampuan perangkat

Lihat dokumentasi fitur yang sesuai untuk detail penerapan, seperti atribut dan status yang harus didukung layanan Anda, serta cara membuat respons EXECUTE dan QUERY.

Trait yang diperlukan

Sifat dan perintah ini diperlukan, jika berlaku untuk perangkat Anda. Jika perangkat tidak mendukung fitur ini, masukkan kode error functionNotSupported dalam respons QUERY atau EXECUTE. Lihat Error dan pengecualian untuk info selengkapnya.

Trait ini direkomendasikan, jika sesuai untuk perangkat Anda. Namun, Anda bebas memadupadankan semua karakteristik yang tersedia agar cocok dengan fungsi produk yang ada.

Persyaratan kualitas

  • Latensi: harus kurang dari atau sama dengan 3000 md.
  • Keandalan: harus lebih dari atau sama dengan 97%.

Contoh perangkat: Soundbar streaming sederhana

Bagian ini berisi contoh payload intent yang mewakili "Streaming Soundbar" umum berdasarkan jenis dan karakteristik perangkat di atas. Jika Anda menambahkan atau menghapus trait dalam implementasi Anda, ubah respons tersebut agar mencerminkan perubahan tersebut.

Contoh respons SYNC

Permintaan
{
  "requestId": "6894439706274654512",
  "inputs": [
    {
      "intent": "action.devices.SYNC"
    }
  ]
}
Respons
{
  "requestId": "6894439706274654512",
  "payload": {
    "agentUserId": "user123",
    "devices": [
      {
        "id": "123",
        "type": "action.devices.types.STREAMING_SOUNDBAR",
        "traits": [
          "action.devices.traits.AppSelector",
          "action.devices.traits.MediaState",
          "action.devices.traits.OnOff",
          "action.devices.traits.TransportControl",
          "action.devices.traits.Volume"
        ],
        "name": {
          "name": "Simple streaming soundbar"
        },
        "willReportState": true,
        "attributes": {
          "availableApplications": [
            {
              "key": "youtube",
              "names": [
                {
                  "name_synonym": [
                    "YouTube"
                  ],
                  "lang": "en"
                }
              ]
            }
          ],
          "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"
        }
      }
    ]
  }
}

Contoh respons QUERY

Permintaan
{
  "requestId": "6894439706274654514",
  "inputs": [
    {
      "intent": "action.devices.QUERY",
      "payload": {
        "devices": [
          {
            "id": "123"
          }
        ]
      }
    }
  ]
}
Respons
{
  "requestId": "6894439706274654514",
  "payload": {
    "devices": {
      "123": {
        "status": "SUCCESS",
        "online": true,
        "on": true,
        "currentApplication": "youtube",
        "currentVolume": 10,
        "isMuted": false,
        "activityState": "ACTIVE",
        "playbackState": "PAUSED"
      }
    }
  }
}

Contoh perintah EXECUTE

appInstall

Untuk detail tambahan tentang parameter perintah, lihat referensi action.devices.traits.AppSelector.

Permintaan
{
  "requestId": "6894439706274654518",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.appInstall",
                "params": {
                  "newApplication": "youtube"
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Respons
{
  "requestId": "6894439706274654518",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "currentApplication": "youtube"
        }
      }
    ]
  }
}

appSearch

Untuk detail tambahan tentang parameter perintah, lihat referensi action.devices.traits.AppSelector.

Permintaan
{
  "requestId": "6894439706274654520",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.appSearch",
                "params": {
                  "newApplication": "youtube"
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Respons
{
  "requestId": "6894439706274654520",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "currentApplication": "youtube"
        }
      }
    ]
  }
}

appSelect

Untuk detail tambahan tentang parameter perintah, lihat referensi action.devices.traits.AppSelector.

Permintaan
{
  "requestId": "6894439706274654522",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.appSelect",
                "params": {
                  "newApplication": "youtube"
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Respons
{
  "requestId": "6894439706274654522",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "currentApplication": "youtube"
        }
      }
    ]
  }
}

OnOff

Untuk detail tambahan tentang parameter perintah, lihat referensi action.devices.traits.OnOff.

Permintaan
{
  "requestId": "6894439706274654516",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.OnOff",
                "params": {
                  "on": true
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Respons
{
  "requestId": "6894439706274654516",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "on": true
        }
      }
    ]
  }
}

mediaClosedCaptioningOff

Untuk detail tambahan tentang parameter perintah, lihat referensi action.devices.traits.TransportControl.

Permintaan
{
  "requestId": "6894439706274654524",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mediaClosedCaptioningOff"
              }
            ]
          }
        ]
      }
    }
  ]
}
Respons
{
  "requestId": "6894439706274654524",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "playbackState": "PLAYING"
        }
      }
    ]
  }
}

mediaClosedCaptioningOn

Untuk detail tambahan tentang parameter perintah, lihat referensi action.devices.traits.TransportControl.

Permintaan
{
  "requestId": "6894439706274654526",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mediaClosedCaptioningOn",
                "params": {
                  "closedCaptioningLanguage": "en"
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Respons
{
  "requestId": "6894439706274654526",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "playbackState": "PLAYING"
        }
      }
    ]
  }
}

mediaNext

Untuk detail tambahan tentang parameter perintah, lihat referensi action.devices.traits.TransportControl.

Permintaan
{
  "requestId": "6894439706274654528",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mediaNext"
              }
            ]
          }
        ]
      }
    }
  ]
}
Respons
{
  "requestId": "6894439706274654528",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "playbackState": "FAST_FORWARDING"
        }
      }
    ]
  }
}

mediaPause

Untuk detail tambahan tentang parameter perintah, lihat referensi action.devices.traits.TransportControl.

Permintaan
{
  "requestId": "6894439706274654530",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mediaPause"
              }
            ]
          }
        ]
      }
    }
  ]
}
Respons
{
  "requestId": "6894439706274654530",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "playbackState": "PAUSED"
        }
      }
    ]
  }
}

mediaPrevious

Untuk detail tambahan tentang parameter perintah, lihat referensi action.devices.traits.TransportControl.

Permintaan
{
  "requestId": "6894439706274654532",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mediaPrevious"
              }
            ]
          }
        ]
      }
    }
  ]
}
Respons
{
  "requestId": "6894439706274654532",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "playbackState": "REWINDING"
        }
      }
    ]
  }
}

mediaResume

Untuk detail tambahan tentang parameter perintah, lihat referensi action.devices.traits.TransportControl.

Permintaan
{
  "requestId": "6894439706274654534",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mediaResume"
              }
            ]
          }
        ]
      }
    }
  ]
}
Respons
{
  "requestId": "6894439706274654534",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "playbackState": "PLAYING"
        }
      }
    ]
  }
}

mediaStop

Untuk detail tambahan tentang parameter perintah, lihat referensi action.devices.traits.TransportControl.

Permintaan
{
  "requestId": "6894439706274654536",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mediaStop"
              }
            ]
          }
        ]
      }
    }
  ]
}
Respons
{
  "requestId": "6894439706274654536",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "playbackState": "STOPPED"
        }
      }
    ]
  }
}

bisukan

Untuk detail tambahan tentang parameter perintah, lihat referensi action.devices.traits.Volume.

Permintaan
{
  "requestId": "6894439706274654540",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mute",
                "params": {
                  "mute": true
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Respons
{
  "requestId": "6894439706274654540",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "currentVolume": 10,
          "isMuted": true
        }
      }
    ]
  }
}

setVolume

Untuk detail tambahan tentang parameter perintah, lihat referensi action.devices.traits.Volume.

Permintaan
{
  "requestId": "6894439706274654538",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.setVolume",
                "params": {
                  "volumeLevel": 11
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Respons
{
  "requestId": "6894439706274654538",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "currentVolume": 11,
          "isMuted": false
        }
      }
    ]
  }
}

KESALAHAN Perangkat

Lihat daftar lengkap error dan pengecualian.