Smart Home Streaming Soundbar Guide

action.devices.types.STREAMING_SOUNDBAR - This device is a combination of speaker and streaming stick or box. This device provides a streaming experience in addition to soundbar capabilities.

This type indicates that the device gets the Streaming Soundbar icon and some related synonyms and aliases.

Device capabilities

Refer to the corresponding trait documentation for implementation details, such as attributes and states that your service should support, and how to build EXECUTE and QUERY responses.

Required TRAITS

These traits and commands are required, if applicable to your device. These traits are recommended, if applicable to your device. However, you are free to mix and match from all available traits to best match your existing product functionality.

Sample SYNC Request and Response

This is an example using the device type and traits above. It is intended to give an idea of how to build a SYNC response. If you add or remove traits, this will need to be modified to reflect those changes.
Request
{
    "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf",
    "inputs": [{
      "intent": "action.devices.SYNC"
    }]
}
Node.js
'use strict';

const { smarthome } = require('actions-on-google');
const functions = require('firebase-functions');

const app = smarthome();

app.onSync((body, headers) => {
  return {
    requestId: "ff36a3cc-ec34-11e6-b1a0-64510650abcf",
    payload: {
      agentUserId: "1836.15267389",
      devices: [{
        id: "123",
        type: "action.devices.types.STREAMING_SOUNDBAR",
        traits: [
          "action.devices.traits.Volume",
          "action.devices.traits.AppSelector",
          "action.devices.traits.TransportControl",
          "action.devices.traits.MediaState"
        ],
        name: {
          defaultNames: ["Soundbar"],
          name: "Smart soundbar",
          nicknames: ["Living room 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: "Sirius Cybernetics Corporation",
          model: "492134",
          hwVersion: "3.2",
          swVersion: "11.4"
        },
        customData: {
          fooValue: 74,
          barValue: true,
          bazValue: "lambtwirl"
        }
      }]
    }
  };
});

// ...

exports.smarthome = functions.https.onRequest(app);
Java
@NotNull
@Override
@SmartHomeSnippetJson("smart-home-types-streamingsoundbar_sync.json")
public SyncResponse onSync(@NotNull SyncRequest syncRequest, @Nullable Map<?, ?> headers) {
  Payload payload = new Payload();
  payload.setAgentUserId("1836.15267389");

  payload.setDevices(
      new Device[] {
        new Device.Builder()
            .setId("123")
            .setType("action.devices.types.STREAMING_SOUNDBAR")
            .addTrait("action.devices.traits.Volume")
            .addTrait("action.devices.traits.AppSelector")
            .addTrait("action.devices.traits.TransportControl")
            .addTrait("action.devices.traits.MediaState")
            .setName(
                Collections.singletonList("Soundbar"),
                "Smart soundbar",
                Collections.singletonList("Living room soundbar"))
            .setWillReportState(true)
            .setAttributes(
                new JSONObject()
                    .put(
                      "availableApplications",
                      new JSONObject[] {
                        new JSONObject()
                            .put("key", "youtube")
                            .put(
                                "names",
                                new JSONObject[] {
                                  new JSONObject()
                                      .put("name_synonym", new String[] {"YouTube"})
                                      .put("lang", "en")
                                })
                      })
                    .put(
                        "transportControlSupportedCommands",
                        new String[] {"NEXT", "PREVIOUS", "PAUSE", "STOP", "RESUME"})
                    .put("volumeMaxLevel", 11)
                    .put("volumeCanMuteAndUnmute", true)
                    .put("supportActivityState", true)
                    .put("supportPlaybackState", true))
            .setDeviceInfo("Sirius Cybernetics Corporation", "492134", "3.2", "11.4")
            .setCustomData(
                new JSONObject()
                    .put("fooValue", 74)
                    .put("barValue", true)
                    .put("bazValue", "lambtwirl"))
            .build()
      });

  return new SyncResponse(syncRequest.getRequestId(), payload);
}
JSON
{
  "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf",
  "payload": {
    "agentUserId": "1836.15267389",
    "devices": [
      {
        "id": "123",
        "type": "action.devices.types.STREAMING_SOUNDBAR",
        "traits": [
          "action.devices.traits.Volume",
          "action.devices.traits.AppSelector",
          "action.devices.traits.TransportControl",
          "action.devices.traits.MediaState"
        ],
        "name": {
          "defaultNames": [
            "Soundbar"
          ],
          "name": "Smart soundbar",
          "nicknames": [
            "Living room 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": "Sirius Cybernetics Corporation",
          "model": "492134",
          "hwVersion": "3.2",
          "swVersion": "11.4"
        },
        "customData": {
          "fooValue": 74,
          "barValue": true,
          "bazValue": "lambtwirl"
        }
      }
    ]
  }
}

Validator

Device ERRORS

See the full list of errors and exceptions.