We want to hear your thoughts on the Google Smart Home platform. Join a user study and receive a gift for your input. Click here to sign up.

Smart Home StatusReport Trait Schema

action.devices.traits.StatusReport - This trait reports the current status or state of a specific device or a connected group of devices. A group of devices could be a security system.

A specific device can report its current status as well as the status of any individual sensors connected to that device. Individual sensors may use this trait, along with SensorState and the query-only versions of other traits (such as OpenClose, HumiditySetting, TemperatureControl, and TemperatureSetting). StatusReport serves as an aggregation for reporting collective status, but does not replace individual addressing, as any device that can be reported to the Google Assistant should be queryable by the Assistant.

Device ATTRIBUTES

None.

Sample SYNC Request and Response

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: body.requestId,
    payload: {
      agentUserId: '1836.15267389',
      devices: [{
        id: '123',
        type: 'action.devices.types.SECURITYSYSTEM',
        traits: [
          'action.devices.traits.StatusReport'
        ],
        name: {
          defaultNames: ['Sirius Cybernetics Corp Security System'],
          name: 'Security system',
          nicknames: ['Security system']
        },
        willReportState: true,
        attributes: {},
        deviceInfo: {
          manufacturer: 'Sirius Cybernetics Corporation',
          model: '442',
          hwVersion: '3.2',
          swVersion: '11.4'
        },
        customData: {
          fooValue: 74,
          barValue: true,
          bazValue: 'lambtwirl'
        }
      }]
    }
  };
});

// ...

exports.smarthome = functions.https.onRequest(app);
Java
@NotNull
@Override
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.SECURITYSYSTEM")
            .addTrait("action.devices.traits.ArmDisarm")
            .setName(
                Collections.singletonList("Sirius Cybernetics Corp Security System"),
                "Security system",
                Collections.singletonList("Security System"))
            .setWillReportState(true)
            .setAttributes(
                new JSONObject()
                    .put(
                        "availableArmLevels",
                        new JSONObject()
                            .put(
                                "levels",
                                new JSONObject[] {
                                  new JSONObject()
                                      .put("level_name", "L1")
                                      .put(
                                          "level_values",
                                          new JSONObject[] {
                                            new JSONObject()
                                                .put(
                                                    "level_synonym",
                                                    new String[] {"home and guarding", "SL1"})
                                                .put("lang", "en"),
                                            new JSONObject()
                                                .put(
                                                    "level_synonym",
                                                    new String[] {"zuhause und bewachen", "SL1"})
                                                .put("lang", "de")
                                          }),
                                  new JSONObject()
                                      .put("level_name", "L2")
                                      .put(
                                          "level_values",
                                          new JSONObject[] {
                                            new JSONObject()
                                                .put(
                                                    "level_synonym",
                                                    new String[] {"away and guarding", "SL2"})
                                                .put("lang", "en"),
                                            new JSONObject()
                                                .put(
                                                    "level_synonym",
                                                    new String[] {"weg und bewachen", "SL2"})
                                                .put("lang", "de")
                                          })
                                })
                            .put("ordered", true)))
            .setDeviceInfo("sirius", "442", "3.2", "11.4")
            .setCustomData(
                new JSONObject()
                    .put("fooValue", 74)
                    .put("barValue", true)
                    .put("bazValue", "lambtwirl")
                    .toString())
            .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.SECURITYSYSTEM",
        "traits": [
          "action.devices.traits.StatusReport"
        ],
        "name": {
          "defaultNames": [
            "Sirius Cybernetics Corp Security System"
          ],
          "name": "Security system",
          "nicknames": [
            "Security system"
          ]
        },
        "willReportState": true,
        "attributes": {},
        "deviceInfo": {
          "manufacturer": "Sirius Cybernetics Corporation",
          "model": "442",
          "hwVersion": "3.2",
          "swVersion": "11.4"
        },
        "customData": {
          "fooValue": 74,
          "barValue": true,
          "bazValue": "lambtwirl"
        }
      }
    ]
  }
}
Validator

Device STATES

State Definition
currentStatusReport

Object. Contains the current status of the device and status of any individual sensors of that device.

  • blocking Boolean. True if the issue/current status is blocking an action (for example, can’t arm the security system or the vacuum can’t run).
  • deviceTarget String. The ID of the target device.
  • priority Non-negative integer. Specifies the importance of this status. The lower the value, the higher the priority, with the highest priority being 0. The statuses are read to the user from highest to lowest priority. Depending on the surface, only high priority exceptions may be read out.
  • statusCode String. The current status of the sensor. See the full list of errors and exceptions.

Sample QUERY Request and Response

User Is my security system ok?
Google Assistant The security system has low battery. The front window and back window are open.
Request
{
  "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf",
  "inputs": [{
    "intent": 'action.devices.QUERY',
    "payload": {
      "devices": [{
        "id": "123",
        "customData": {
          "fooValue": 74,
          "barValue": true,
          "bazValue": "foo"
        }
      }]
    }
  }]
}
Node.js
'use strict';

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

const app = smarthome();

app.onQuery((body, headers) => {
  return {
    requestId: body.requestId,
    payload: {
      devices: {
        123: {
          online: true,
          currentStatusReport: [{
            blocking: false,
            deviceTarget: '123',
            priority: 0,
            statusCode: 'lowBattery'
          }, {
            blocking: false,
            deviceTarget: 'front_window_id',
            priority: 1,
            statusCode: 'deviceOpen'
          }, {
            blocking: false,
            deviceTarget: 'back_window_id',
            priority: 1,
            statusCode: 'deviceOpen'
          }],
          status: 'SUCCESS'
        }
      }
    }
  };
});

// ...

exports.smarthome = functions.https.onRequest(app);
Java
@NotNull
@Override
public QueryResponse onQuery(@NotNull QueryRequest queryRequest, @Nullable Map<?, ?> map) {
  QueryResponse.Payload payload = new QueryResponse.Payload();
  payload.setDevices(
      new HashMap<String, Map<String, Object>>() {
        {
          put(
              "123",
              new HashMap<String, Object>() {
                {
                  put("online", true);
                  put(
                      "currentStatusReport",
                      new Map[] {
                        new HashMap<String, Object>() {
                          {
                            put("blocking", false);
                            put("deviceTarget", "123");
                            put("priority", 0);
                            put("statusCode", "lowBattery");
                          }
                        },
                        new HashMap<String, Object>() {
                          {
                            put("blocking", false);
                            put("deviceTarget", "front_window_id");
                            put("priority", 1);
                            put("statusCode", "deviceOpen");
                          }
                        },
                        new HashMap<String, Object>() {
                          {
                            put("blocking", false);
                            put("deviceTarget", "back_window_id");
                            put("priority", 1);
                            put("statusCode", "deviceOpen");
                          }
                        }
                      });
                }
              });
        }
      });

  return new QueryResponse(queryRequest.getRequestId(), payload);
}
JSON
{
  "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf",
  "payload": {
    "devices": {
      "123": {
        "online": true,
        "currentStatusReport": [
          {
            "blocking": false,
            "deviceTarget": "123",
            "priority": 0,
            "statusCode": "lowBattery"
          },
          {
            "blocking": false,
            "deviceTarget": "front_window_id",
            "priority": 1,
            "statusCode": "deviceOpen"
          },
          {
            "blocking": false,
            "deviceTarget": "back_window_id",
            "priority": 1,
            "statusCode": "deviceOpen"
          }
        ],
        "status": "SUCCESS"
      }
    }
  }
}

Device COMMANDS

None.

Device ERRORS

See the full list of errors and exceptions.