Join us online for the "Hey Google" Smart Home Summit on July 8th! Register here to learn what's new, and what's coming up for Google Smart Home.

Smart Home Dryer Guide

Device TYPE

action.devices.types.DRYER This type indicates that the device gets the dryer icon and some dryer-type synonyms/aliases.

Dryers have start and stop functionality independent from being on or off. Some can be paused and resumed while drying.

Dryers also have various modes and each mode has its own related settings. These are specific to the dryer and are interpreted in a generalized form.

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: body.requestId,
    payload: {
      agentUserId: '1836.15267389',
      devices: [{
        id: '123',
        type: 'action.devices.types.DRYER',
        traits: [
          'action.devices.traits.OnOff',
          'action.devices.traits.StartStop',
          'action.devices.traits.Modes',
          'action.devices.traits.Toggles',
          'action.devices.traits.RunCycle'
        ],
        name: {
          defaultNames: ['AAA Super Dryer'],
          name: 'Dryer',
          nicknames: ['clothes dryer']
        },
        willReportState: true,
        attributes: {
          pausable: true,
          availableModes: [{
            name: 'load',
            name_values: [{
              name_synonym: ['load', 'size', 'load size'],
              lang: 'en'
            }],
            settings: [{
                setting_name: 'small',
                setting_values: [{
                  setting_synonym: ['small', 'half'],
                  lang: 'en'
                }]
              },
              {
                setting_name: 'large',
                setting_values: [{
                  setting_synonym: ['large', 'full'],
                  lang: 'en'
                }]
              }
            ],
            ordered: true
          }],
          availableToggles: [{
              name: 'Sterilization',
              name_values: [{
                name_synonym: ['Bio-clean', 'UltraSound'],
                lang: 'en'
              }]
            },
            {
              name: 'Energy Saving',
              name_values: [{
                name_synonym: ['normal', 'medium', 'high'],
                lang: 'en'
              }]
            }
          ]
        },
        deviceInfo: {
          manufacturer: 'AAA 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
public SyncResponse onSync(@NotNull SyncRequest syncRequest, @Nullable Map<?, ?> headers) {
  SyncResponse.Payload payload = new SyncResponse.Payload();
  payload.setAgentUserId("1836.15267389");
  payload.setDevices(
      new SyncResponse.Payload.Device[] {
        new SyncResponse.Payload.Device.Builder()
            .setId("123")
            .setType("action.devices.types.DRYER")
            .addTrait("action.devices.traits.OnOff")
            .addTrait("action.devices.traits.StartStop")
            .addTrait("action.devices.traits.Modes")
            .addTrait("action.devices.traits.Toggles")
            .addTrait("action.devices.traits.RunCycle")
            .setName(
                Collections.singletonList("AAA Super Dryer"),
                "Dryer",
                Collections.singletonList("clothes dryer"))
            .setWillReportState(true)
            .setAttributes(
                new JSONObject()
                    .put("pausable", true)
                    .put(
                        "availableModes",
                        new JSONObject[] {
                          new JSONObject()
                              .put("name", "load")
                              .put(
                                  "name_values",
                                  new JSONObject[] {
                                    new JSONObject()
                                        .put(
                                            "name_synonym",
                                            new String[] {"load", "size", "load size"})
                                        .put("lang", "en")
                                  })
                              .put(
                                  "settings",
                                  new JSONObject[] {
                                    new JSONObject()
                                        .put("setting_name", "small")
                                        .put(
                                            "setting_values",
                                            new JSONObject[] {
                                              new JSONObject()
                                                  .put("setting_name", "small")
                                                  .put(
                                                      "setting_values",
                                                      new JSONObject[] {
                                                        new JSONObject()
                                                            .put(
                                                                "setting_synonym",
                                                                new String[] {"small", "half"})
                                                            .put("lang", "en")
                                                      }),
                                              new JSONObject()
                                                  .put("setting_name", "large")
                                                  .put(
                                                      "setting_values",
                                                      new JSONObject[] {
                                                        new JSONObject()
                                                            .put(
                                                                "setting_synonym",
                                                                new String[] {"full"})
                                                            .put("lang", "en")
                                                      })
                                            })
                                  })
                              .put("ordered", true)
                        })
                    .put(
                        "availableToggles",
                        new JSONObject[] {
                          new JSONObject()
                              .put("name", "Sterilization")
                              .put(
                                  "name_values",
                                  new JSONObject[] {
                                    new JSONObject()
                                        .put(
                                            "name_synonym",
                                            new String[] {"Bio-clean", "Ultrasound"})
                                        .put("lang", "en")
                                  }),
                          new JSONObject()
                              .put("name", "Energy Saving")
                              .put(
                                  "name_values",
                                  new JSONObject[] {
                                    new JSONObject()
                                        .put(
                                            "name_synonym",
                                            new String[] {"normal", "medium", "high"})
                                        .put("lang", "en")
                                  })
                        }))
            .setDeviceInfo("AAA Corporation", "492134", "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.DRYER",
        "traits": [
          "action.devices.traits.OnOff",
          "action.devices.traits.StartStop",
          "action.devices.traits.Modes",
          "action.devices.traits.Toggles",
          "action.devices.traits.RunCycle"
        ],
        "name": {
          "defaultNames": [
            "AAA Super Dryer"
          ],
          "name": "Dryer",
          "nicknames": [
            "clothes dryer"
          ]
        },
        "willReportState": true,
        "attributes": {
          "pausable": true,
          "availableModes": [
            {
              "name": "load",
              "name_values": [
                {
                  "name_synonym": [
                    "load",
                    "size",
                    "load size"
                  ],
                  "lang": "en"
                }
              ],
              "settings": [
                {
                  "setting_name": "small",
                  "setting_values": [
                    {
                      "setting_synonym": [
                        "small",
                        "half"
                      ],
                      "lang": "en"
                    }
                  ]
                },
                {
                  "setting_name": "large",
                  "setting_values": [
                    {
                      "setting_synonym": [
                        "large",
                        "full"
                      ],
                      "lang": "en"
                    }
                  ]
                }
              ],
              "ordered": true
            }
          ],
          "availableToggles": [
            {
              "name": "Sterilization",
              "name_values": [
                {
                  "name_synonym": [
                    "Bio-clean",
                    "UltraSound"
                  ],
                  "lang": "en"
                }
              ]
            },
            {
              "name": "Energy Saving",
              "name_values": [
                {
                  "name_synonym": [
                    "normal",
                    "medium",
                    "high"
                  ],
                  "lang": "en"
                }
              ]
            }
          ]
        },
        "deviceInfo": {
          "manufacturer": "AAA 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.