Smart Home AV Receiver Guide

action.devices.types.AUDIO_VIDEO_RECEIVER - Device that takes audio input (for example, HDMI, optical, and RCA) and outputs sound to one or more speakers.

This type indicates that the device gets the AV Receiver 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.AUDIO_VIDEO_RECEIVER",
                traits: [
                  "action.devices.traits.OnOff",
                  "action.devices.traits.Volume",
                  "action.devices.traits.InputSelector"
                ],
                name: {
                    defaultNames: ["Receiver"],
                    name: "Smart receiver",
                    nicknames: ["Living room receiver"]
                },
                willReportState: true,
                attributes: {
                    volumeMaxLevel: 11,
                    volumeCanMuteAndUnmute: true,
                    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: "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-audiovideoreceiver_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.AUDIO_VIDEO_RECEIVER")
            .addTrait("action.devices.traits.OnOff")
            .addTrait("action.devices.traits.Volume")
            .addTrait("action.devices.traits.InputSelector")
            .setName(
                Collections.singletonList("Receiver"),
                "Smart receiver",
                Collections.singletonList("Living room receiver"))
            .setWillReportState(true)
            .setAttributes(
                new JSONObject()
                    .put("volumeMaxLevel", 11)
                    .put("volumeCanMuteAndUnmute", true)
                    .put(
                        "availableInputs",
                        new JSONObject[] {
                          new JSONObject()
                              .put("key", "hdmi_1")
                              .put(
                                  "names",
                                  new JSONObject[] {
                                    new JSONObject()
                                        .put(
                                            "name_synonym", new String[] {"HDMI 1", "DVD player"})
                                        .put("lang", "en")
                                  }),
                          new JSONObject()
                              .put("key", "hdmi_2")
                              .put(
                                  "names",
                                  new JSONObject[] {
                                    new JSONObject()
                                        .put("name_synonym", new String[] {"HDMI 2", "TV"})
                                        .put("lang", "en")
                                  })
                        }))
            .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.AUDIO_VIDEO_RECEIVER",
        "traits": [
          "action.devices.traits.OnOff",
          "action.devices.traits.Volume",
          "action.devices.traits.InputSelector"
        ],
        "name": {
          "defaultNames": [
            "Receiver"
          ],
          "name": "Smart receiver",
          "nicknames": [
            "Living room receiver"
          ]
        },
        "willReportState": true,
        "attributes": {
          "volumeMaxLevel": 11,
          "volumeCanMuteAndUnmute": true,
          "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": "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.