Device TYPE
action.devices.types.WASHER
This type indicates that the device gets the
washer icon and some washer-type synonyms/aliases.
Washers can have start and stop functionality independent from being on or off (some washers have separate power buttons, and some do not). Some can be paused and resumed while washing.
Washers also have various modes and each mode has its own related settings. These are specific to the washer and are interpreted in a generalized form.
The Assistant is currently not capable of folding laundry.
To see an example on how to control a washing machine with Google smart home, see the smart home washer codelab.
Recommended TRAITS
action.devices.traits.OnOff
- Needed only if the washer has a separate power control from start/stop semantics; otherwise, use StartStop.action.devices.traits.StartStop
action.devices.traits.Modes
action.devices.traits.Toggles
action.devices.traits.RunCycle
These are our recommendations for traits on this type of
device, however you are free to mix and match from all available traits to best match your existing
product functionality.
Please see each individual trait document for implementation details like required attributes,
EXECUTE and QUERY.
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.
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "inputs": [{ "intent": "action.devices.SYNC" }] }
Node.jsResponse
'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.WASHER', traits: [ 'action.devices.traits.StartStop', 'action.devices.traits.Modes', 'action.devices.traits.RunCycle' ], name: { defaultNames: ['AAA Cybernetics Corporation Washer 3421'], name: 'Washer', nicknames: ['clothes washer'] }, willReportState: false, 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: 'Child Lock', name_values: [{ name_synonym: ['child lock'], lang: 'en' }] }, { name: 'Turbo', name_values: [{ name_synonym: ['Turbo', 'turbo'], lang: 'en' }] }] }, deviceInfo: { manufacturer: 'AAA Cybernetics Corporation', model: '233451', hwVersion: '3.2', swVersion: '11.4' }, customData: { fooValue: 74, barValue: true, bazValue: 'lambtwirl' } }] } }; }); // ... exports.smarthome = functions.https.onRequest(app);
JSONResponse
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "payload": { "agentUserId": "1836.15267389", "devices": [ { "id": "123", "type": "action.devices.types.WASHER", "traits": [ "action.devices.traits.StartStop", "action.devices.traits.Modes", "action.devices.traits.RunCycle" ], "name": { "defaultNames": [ "AAA Cybernetics Corporation Washer 3421" ], "name": "Washer", "nicknames": [ "clothes washer" ] }, "willReportState": false, "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": "Child Lock", "name_values": [ { "name_synonym": [ "child lock" ], "lang": "en" } ] }, { "name": "Turbo", "name_values": [ { "name_synonym": [ "Turbo", "turbo" ], "lang": "en" } ] } ] }, "deviceInfo": { "manufacturer": "AAA Cybernetics Corporation", "model": "233451", "hwVersion": "3.2", "swVersion": "11.4" }, "customData": { "fooValue": 74, "barValue": true, "bazValue": "lambtwirl" } } ] } }
Device ERRORS
See the full list of errors and exceptions.