blob: 6d1e0da76d22817d4ba3211327bebb6a24e63733 [file] [log] [blame]
Bu Sun Kim65020912020-05-20 12:08:20 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="homegraph_v1.html">HomeGraph API</a> . <a href="homegraph_v1.devices.html">devices</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#query">query(body=None, x__xgafv=None)</a></code></p>
79<p class="firstline">Gets the current states in Home Graph for the given set of the third-party</p>
80<p class="toc_element">
81 <code><a href="#reportStateAndNotification">reportStateAndNotification(body=None, x__xgafv=None)</a></code></p>
82<p class="firstline">Reports device state and optionally sends device notifications.</p>
83<p class="toc_element">
84 <code><a href="#requestSync">requestSync(body=None, x__xgafv=None)</a></code></p>
85<p class="firstline">Requests Google to send an `action.devices.SYNC`</p>
86<p class="toc_element">
87 <code><a href="#sync">sync(body=None, x__xgafv=None)</a></code></p>
88<p class="firstline">Gets all the devices associated with the given third-party user.</p>
89<h3>Method Details</h3>
90<div class="method">
91 <code class="details" id="query">query(body=None, x__xgafv=None)</code>
92 <pre>Gets the current states in Home Graph for the given set of the third-party
93user&#x27;s devices.
94
95The third-party user&#x27;s identity is passed in via the `agent_user_id`
96(see QueryRequest).
97This request must be authorized using service account credentials from your
98Actions console project.
99
100Args:
101 body: object, The request body.
102 The object takes the form of:
103
104{ # Request type for the
105 # [`Query`](#google.home.graph.v1.HomeGraphApiService.Query) call.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700106 &quot;requestId&quot;: &quot;A String&quot;, # Request ID used for debugging.
107 &quot;agentUserId&quot;: &quot;A String&quot;, # Required. Third-party user ID.
Bu Sun Kim65020912020-05-20 12:08:20 -0700108 &quot;inputs&quot;: [ # Required. Inputs containing third-party device IDs for which to
109 # get the device states.
110 { # Device ID inputs to QueryRequest.
111 &quot;payload&quot;: { # Payload containing device IDs. # Payload containing third-party device IDs.
112 &quot;devices&quot;: [ # Third-party device IDs for which to get the device states.
113 { # Third-party device ID for one device.
114 &quot;id&quot;: &quot;A String&quot;, # Third-party device ID.
115 },
116 ],
117 },
118 },
119 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700120 }
121
122 x__xgafv: string, V1 error format.
123 Allowed values
124 1 - v1 error format
125 2 - v2 error format
126
127Returns:
128 An object of the form:
129
130 { # Response type for the
131 # [`Query`](#google.home.graph.v1.HomeGraphApiService.Query) call.
132 # This should follow the same format as the Google smart home
133 # `action.devices.QUERY`
134 # [response](https://developers.google.com/assistant/smarthome/reference/intent/query).
135 # # Example
136 #
137 # ```json
138 # {
139 # &quot;requestId&quot;: &quot;ff36a3cc-ec34-11e6-b1a0-64510650abcf&quot;,
140 # &quot;payload&quot;: {
141 # &quot;devices&quot;: {
142 # &quot;123&quot;: {
143 # &quot;on&quot;: true,
144 # &quot;online&quot;: true
145 # },
146 # &quot;456&quot;: {
147 # &quot;on&quot;: true,
148 # &quot;online&quot;: true,
149 # &quot;brightness&quot;: 80,
150 # &quot;color&quot;: {
151 # &quot;name&quot;: &quot;cerulean&quot;,
152 # &quot;spectrumRGB&quot;: 31655
153 # }
154 # }
155 # }
156 # }
157 # }
158 # ```
159 &quot;payload&quot;: { # Payload containing device states information. # Device states for the devices given in the request.
160 &quot;devices&quot;: { # States of the devices. Map of third-party device ID to struct of device
161 # states.
162 &quot;a_key&quot;: {
163 &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
164 },
165 },
166 },
167 &quot;requestId&quot;: &quot;A String&quot;, # Request ID used for debugging. Copied from the request.
168 }</pre>
169</div>
170
171<div class="method">
172 <code class="details" id="reportStateAndNotification">reportStateAndNotification(body=None, x__xgafv=None)</code>
173 <pre>Reports device state and optionally sends device notifications.
174Called by your smart home Action when the state of a third-party device
175changes or you need to send a notification about the device.
176See [Implement Report
177State](https://developers.google.com/assistant/smarthome/develop/report-state)
178for more information.
179
180This method updates the device state according to its declared
181[traits](https://developers.google.com/assistant/smarthome/concepts/devices-traits).
182Publishing a new state value outside of these traits will result in an
183`INVALID_ARGUMENT` error response.
184
185The third-party user&#x27;s identity is passed in via the `agent_user_id`
186(see ReportStateAndNotificationRequest).
187This request must be authorized using service account credentials from your
188Actions console project.
189
190Args:
191 body: object, The request body.
192 The object takes the form of:
193
194{ # Request type for the
195 # [`ReportStateAndNotification`](#google.home.graph.v1.HomeGraphApiService.ReportStateAndNotification)
196 # call. It may include states, notifications, or both. States and notifications
197 # are defined per `device_id` (for example, &quot;123&quot; and &quot;456&quot; in the following
198 # example).
199 # # Example
200 #
201 # ```json
202 # {
203 # &quot;requestId&quot;: &quot;ff36a3cc-ec34-11e6-b1a0-64510650abcf&quot;,
204 # &quot;agentUserId&quot;: &quot;1234&quot;,
205 # &quot;payload&quot;: {
206 # &quot;devices&quot;: {
207 # &quot;states&quot;: {
208 # &quot;123&quot;: {
209 # &quot;on&quot;: true
210 # },
211 # &quot;456&quot;: {
212 # &quot;on&quot;: true,
213 # &quot;brightness&quot;: 10
214 # }
215 # },
216 # }
217 # }
218 # }
219 # ```
Bu Sun Kim65020912020-05-20 12:08:20 -0700220 &quot;eventId&quot;: &quot;A String&quot;, # Unique identifier per event (for example, a doorbell press).
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700221 &quot;requestId&quot;: &quot;A String&quot;, # Request ID used for debugging.
Bu Sun Kim65020912020-05-20 12:08:20 -0700222 &quot;payload&quot;: { # Payload containing the state and notification information for devices. # Required. State of devices to update and notification metadata for devices.
223 &quot;devices&quot;: { # The states and notifications specific to a device. # The devices for updating state and sending notifications.
Bu Sun Kim65020912020-05-20 12:08:20 -0700224 &quot;states&quot;: { # States of devices to update. See the **Device STATES** section
225 # of the individual trait [reference
226 # guides](https://developers.google.com/assistant/smarthome/traits).
227 &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
228 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700229 &quot;notifications&quot;: { # Notifications metadata for devices. See the **Device NOTIFICATIONS**
230 # section of the individual trait [reference
231 # guides](https://developers.google.com/assistant/smarthome/traits).
232 &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
233 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700234 },
235 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700236 &quot;followUpToken&quot;: &quot;A String&quot;, # Token to maintain state in the follow up notification response.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700237 # Deprecated. See the [notifications
238 # guide](https://developers.google.com/assistant/smarthome/develop/notifications)
239 # for details on implementing follow up notifications.
240 &quot;agentUserId&quot;: &quot;A String&quot;, # Required. Third-party user ID.
Bu Sun Kim65020912020-05-20 12:08:20 -0700241 }
242
243 x__xgafv: string, V1 error format.
244 Allowed values
245 1 - v1 error format
246 2 - v2 error format
247
248Returns:
249 An object of the form:
250
251 { # Response type for the
252 # [`ReportStateAndNotification`](#google.home.graph.v1.HomeGraphApiService.ReportStateAndNotification)
253 # call.
254 &quot;requestId&quot;: &quot;A String&quot;, # Request ID copied from ReportStateAndNotificationRequest.
255 }</pre>
256</div>
257
258<div class="method">
259 <code class="details" id="requestSync">requestSync(body=None, x__xgafv=None)</code>
260 <pre>Requests Google to send an `action.devices.SYNC`
261[intent](https://developers.google.com/assistant/smarthome/reference/intent/sync)
262to your smart home Action to update device metadata for the given user.
263
264
265The third-party user&#x27;s identity is passed via the `agent_user_id`
266(see RequestSyncDevicesRequest).
267This request must be authorized using service account credentials from your
268Actions console project.
269
270Args:
271 body: object, The request body.
272 The object takes the form of:
273
274{ # Request type for the
275 # [`RequestSyncDevices`](#google.home.graph.v1.HomeGraphApiService.RequestSyncDevices)
276 # call.
277 &quot;agentUserId&quot;: &quot;A String&quot;, # Required. Third-party user ID.
278 &quot;async&quot;: True or False, # Optional. If set, the request will be added to a queue and a response will
279 # be returned immediately. This enables concurrent requests for the given
280 # `agent_user_id`, but the caller will not receive any error responses.
281 }
282
283 x__xgafv: string, V1 error format.
284 Allowed values
285 1 - v1 error format
286 2 - v2 error format
287
288Returns:
289 An object of the form:
290
291 { # Response type for the
292 # [`RequestSyncDevices`](#google.home.graph.v1.HomeGraphApiService.RequestSyncDevices)
293 # call.
294 #
295 # Intentionally empty upon success. An HTTP response code is returned
296 # with more details upon failure.
297 }</pre>
298</div>
299
300<div class="method">
301 <code class="details" id="sync">sync(body=None, x__xgafv=None)</code>
302 <pre>Gets all the devices associated with the given third-party user.
303
304The third-party user&#x27;s identity is passed in via the `agent_user_id`
305(see SyncRequest).
306This request must be authorized using service account credentials from your
307Actions console project.
308
309Args:
310 body: object, The request body.
311 The object takes the form of:
312
313{ # Request type for the [`Sync`](#google.home.graph.v1.HomeGraphApiService.Sync)
314 # call.
315 &quot;requestId&quot;: &quot;A String&quot;, # Request ID used for debugging.
316 &quot;agentUserId&quot;: &quot;A String&quot;, # Required. Third-party user ID.
317 }
318
319 x__xgafv: string, V1 error format.
320 Allowed values
321 1 - v1 error format
322 2 - v2 error format
323
324Returns:
325 An object of the form:
326
327 { # Response type for the
328 # [`Sync`](#google.home.graph.v1.HomeGraphApiService.Sync) call.
329 # This should follow the same format as the Google smart home
330 # `action.devices.SYNC`
331 # [response](https://developers.google.com/assistant/smarthome/reference/intent/sync).
332 # # Example
333 #
334 # ```json
335 # {
336 # &quot;requestId&quot;: &quot;ff36a3cc-ec34-11e6-b1a0-64510650abcf&quot;,
337 # &quot;payload&quot;: {
338 # &quot;agentUserId&quot;: &quot;1836.15267389&quot;,
339 # &quot;devices&quot;: [{
340 # &quot;id&quot;: &quot;123&quot;,
341 # &quot;type&quot;: &quot;action.devices.types.OUTLET&quot;,
342 # &quot;traits&quot;: [
343 # &quot;action.devices.traits.OnOff&quot;
344 # ],
345 # &quot;name&quot;: {
346 # &quot;defaultNames&quot;: [&quot;My Outlet 1234&quot;],
347 # &quot;name&quot;: &quot;Night light&quot;,
348 # &quot;nicknames&quot;: [&quot;wall plug&quot;]
349 # },
350 # &quot;willReportState&quot;: false,
351 # &quot;deviceInfo&quot;: {
352 # &quot;manufacturer&quot;: &quot;lights-out-inc&quot;,
353 # &quot;model&quot;: &quot;hs1234&quot;,
354 # &quot;hwVersion&quot;: &quot;3.2&quot;,
355 # &quot;swVersion&quot;: &quot;11.4&quot;
356 # },
357 # &quot;customData&quot;: {
358 # &quot;fooValue&quot;: 74,
359 # &quot;barValue&quot;: true,
360 # &quot;bazValue&quot;: &quot;foo&quot;
361 # }
362 # }]
363 # }
364 # }
365 # ```
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700366 &quot;requestId&quot;: &quot;A String&quot;, # Request ID used for debugging. Copied from the request.
Bu Sun Kim65020912020-05-20 12:08:20 -0700367 &quot;payload&quot;: { # Payload containing device information. # Devices associated with the third-party user.
368 &quot;devices&quot;: [ # Devices associated with the third-party user.
369 { # Third-party device definition.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700370 &quot;roomHint&quot;: &quot;A String&quot;, # Suggested name for the room where this device is installed.
371 # Google attempts to use this value during user setup.
Bu Sun Kim65020912020-05-20 12:08:20 -0700372 &quot;deviceInfo&quot;: { # Device information. # Device manufacturer, model, hardware version, and software version.
Bu Sun Kim65020912020-05-20 12:08:20 -0700373 &quot;swVersion&quot;: &quot;A String&quot;, # Device software version.
374 &quot;model&quot;: &quot;A String&quot;, # Device model.
375 &quot;manufacturer&quot;: &quot;A String&quot;, # Device manufacturer.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700376 &quot;hwVersion&quot;: &quot;A String&quot;, # Device hardware version.
Bu Sun Kim65020912020-05-20 12:08:20 -0700377 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700378 &quot;id&quot;: &quot;A String&quot;, # Third-party device ID.
379 &quot;otherDeviceIds&quot;: [ # Alternate IDs associated with this device.
380 # This is used to identify cloud synced devices enabled for [local
381 # fulfillment](https://developers.google.com/assistant/smarthome/concepts/local).
382 { # Alternate third-party device ID.
383 &quot;agentId&quot;: &quot;A String&quot;, # Project ID for your smart home Action.
384 &quot;deviceId&quot;: &quot;A String&quot;, # Unique third-party device ID.
385 },
386 ],
387 &quot;willReportState&quot;: True or False, # Indicates whether your smart home Action will report state of this device
388 # to Google via
389 # ReportStateAndNotification.
390 &quot;name&quot;: { # Identifiers used to describe the device. # Names given to this device by your smart home Action.
391 &quot;defaultNames&quot;: [ # List of names provided by the manufacturer rather than the user, such as
392 # serial numbers, SKUs, etc.
393 &quot;A String&quot;,
394 ],
395 &quot;name&quot;: &quot;A String&quot;, # Primary name of the device, generally provided by the user.
396 &quot;nicknames&quot;: [ # Additional names provided by the user for the device.
397 &quot;A String&quot;,
398 ],
399 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700400 &quot;customData&quot;: { # Custom device attributes stored in Home Graph and provided to your
401 # smart home Action in each
402 # [QUERY](https://developers.google.com/assistant/smarthome/reference/intent/query)
403 # and
404 # [EXECUTE](https://developers.google.com/assistant/smarthome/reference/intent/execute)
405 # intent.
406 &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
407 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700408 &quot;notificationSupportedByAgent&quot;: True or False, # Indicates whether your smart home Action will report notifications
409 # to Google for this device via
410 # ReportStateAndNotification.
411 #
412 # If your smart home Action enables users to control device notifications,
413 # you should update this field and call
414 # RequestSyncDevices.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700415 &quot;traits&quot;: [ # Traits supported by the device.
416 # See [device
417 # traits](https://developers.google.com/assistant/smarthome/traits).
418 &quot;A String&quot;,
419 ],
420 &quot;structureHint&quot;: &quot;A String&quot;, # Suggested name for the structure where this device is installed.
421 # Google attempts to use this value during user setup.
422 &quot;type&quot;: &quot;A String&quot;, # Hardware type of the device.
423 # See [device
424 # types](https://developers.google.com/assistant/smarthome/guides).
425 &quot;attributes&quot;: { # Attributes for the traits supported by the device.
426 &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
427 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700428 },
429 ],
430 &quot;agentUserId&quot;: &quot;A String&quot;, # Third-party user ID
431 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700432 }</pre>
433</div>
434
435</body></html>