blob: 0b77d04986e2e2f745e59234da3ed491d629d809 [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">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070078 <code><a href="#close">close()</a></code></p>
79<p class="firstline">Close httplib2 connections.</p>
80<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070081 <code><a href="#query">query(body=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070082<p class="firstline">Gets the current states in Home Graph for the given set of the third-party user's devices. The third-party user's identity is passed in via the `agent_user_id` (see QueryRequest). This request must be authorized using service account credentials from your Actions console project.</p>
Bu Sun Kim65020912020-05-20 12:08:20 -070083<p class="toc_element">
84 <code><a href="#reportStateAndNotification">reportStateAndNotification(body=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070085<p class="firstline">Reports device state and optionally sends device notifications. Called by your smart home Action when the state of a third-party device changes or you need to send a notification about the device. See [Implement Report State](https://developers.google.com/assistant/smarthome/develop/report-state) for more information. This method updates the device state according to its declared [traits](https://developers.google.com/assistant/smarthome/concepts/devices-traits). Publishing a new state value outside of these traits will result in an `INVALID_ARGUMENT` error response. The third-party user's identity is passed in via the `agent_user_id` (see ReportStateAndNotificationRequest). This request must be authorized using service account credentials from your Actions console project.</p>
Bu Sun Kim65020912020-05-20 12:08:20 -070086<p class="toc_element">
87 <code><a href="#requestSync">requestSync(body=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070088<p class="firstline">Requests Google to send an `action.devices.SYNC` [intent](https://developers.google.com/assistant/smarthome/reference/intent/sync) to your smart home Action to update device metadata for the given user. The third-party user's identity is passed via the `agent_user_id` (see RequestSyncDevicesRequest). This request must be authorized using service account credentials from your Actions console project.</p>
Bu Sun Kim65020912020-05-20 12:08:20 -070089<p class="toc_element">
90 <code><a href="#sync">sync(body=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070091<p class="firstline">Gets all the devices associated with the given third-party user. The third-party user's identity is passed in via the `agent_user_id` (see SyncRequest). This request must be authorized using service account credentials from your Actions console project.</p>
Bu Sun Kim65020912020-05-20 12:08:20 -070092<h3>Method Details</h3>
93<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070094 <code class="details" id="close">close()</code>
95 <pre>Close httplib2 connections.</pre>
96</div>
Bu Sun Kim65020912020-05-20 12:08:20 -070097
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070098<div class="method">
99 <code class="details" id="query">query(body=None, x__xgafv=None)</code>
100 <pre>Gets the current states in Home Graph for the given set of the third-party user&#x27;s devices. The third-party user&#x27;s identity is passed in via the `agent_user_id` (see QueryRequest). This request must be authorized using service account credentials from your Actions console project.
Bu Sun Kim65020912020-05-20 12:08:20 -0700101
102Args:
103 body: object, The request body.
104 The object takes the form of:
105
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700106{ # Request type for the [`Query`](#google.home.graph.v1.HomeGraphApiService.Query) call.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700107 &quot;inputs&quot;: [ # Required. Inputs containing third-party device IDs for which to get the device states.
Bu Sun Kim65020912020-05-20 12:08:20 -0700108 { # Device ID inputs to QueryRequest.
109 &quot;payload&quot;: { # Payload containing device IDs. # Payload containing third-party device IDs.
110 &quot;devices&quot;: [ # Third-party device IDs for which to get the device states.
111 { # Third-party device ID for one device.
112 &quot;id&quot;: &quot;A String&quot;, # Third-party device ID.
113 },
114 ],
115 },
116 },
117 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800118 &quot;agentUserId&quot;: &quot;A String&quot;, # Required. Third-party user ID.
119 &quot;requestId&quot;: &quot;A String&quot;, # Request ID used for debugging.
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
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700130 { # Response type for the [`Query`](#google.home.graph.v1.HomeGraphApiService.Query) call. This should follow the same format as the Google smart home `action.devices.QUERY` [response](https://developers.google.com/assistant/smarthome/reference/intent/query). # Example ```json { &quot;requestId&quot;: &quot;ff36a3cc-ec34-11e6-b1a0-64510650abcf&quot;, &quot;payload&quot;: { &quot;devices&quot;: { &quot;123&quot;: { &quot;on&quot;: true, &quot;online&quot;: true }, &quot;456&quot;: { &quot;on&quot;: true, &quot;online&quot;: true, &quot;brightness&quot;: 80, &quot;color&quot;: { &quot;name&quot;: &quot;cerulean&quot;, &quot;spectrumRGB&quot;: 31655 } } } } } ```
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800131 &quot;requestId&quot;: &quot;A String&quot;, # Request ID used for debugging. Copied from the request.
Bu Sun Kim65020912020-05-20 12:08:20 -0700132 &quot;payload&quot;: { # Payload containing device states information. # Device states for the devices given in the request.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700133 &quot;devices&quot;: { # States of the devices. Map of third-party device ID to struct of device states.
Bu Sun Kim65020912020-05-20 12:08:20 -0700134 &quot;a_key&quot;: {
135 &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
136 },
137 },
138 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700139 }</pre>
140</div>
141
142<div class="method">
143 <code class="details" id="reportStateAndNotification">reportStateAndNotification(body=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700144 <pre>Reports device state and optionally sends device notifications. Called by your smart home Action when the state of a third-party device changes or you need to send a notification about the device. See [Implement Report State](https://developers.google.com/assistant/smarthome/develop/report-state) for more information. This method updates the device state according to its declared [traits](https://developers.google.com/assistant/smarthome/concepts/devices-traits). Publishing a new state value outside of these traits will result in an `INVALID_ARGUMENT` error response. The third-party user&#x27;s identity is passed in via the `agent_user_id` (see ReportStateAndNotificationRequest). This request must be authorized using service account credentials from your Actions console project.
Bu Sun Kim65020912020-05-20 12:08:20 -0700145
146Args:
147 body: object, The request body.
148 The object takes the form of:
149
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700150{ # Request type for the [`ReportStateAndNotification`](#google.home.graph.v1.HomeGraphApiService.ReportStateAndNotification) call. It may include states, notifications, or both. States and notifications are defined per `device_id` (for example, &quot;123&quot; and &quot;456&quot; in the following example). # Example ```json { &quot;requestId&quot;: &quot;ff36a3cc-ec34-11e6-b1a0-64510650abcf&quot;, &quot;agentUserId&quot;: &quot;1234&quot;, &quot;payload&quot;: { &quot;devices&quot;: { &quot;states&quot;: { &quot;123&quot;: { &quot;on&quot;: true }, &quot;456&quot;: { &quot;on&quot;: true, &quot;brightness&quot;: 10 } }, } } } ```
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800151 &quot;eventId&quot;: &quot;A String&quot;, # Unique identifier per event (for example, a doorbell press).
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700152 &quot;requestId&quot;: &quot;A String&quot;, # Request ID used for debugging.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800153 &quot;followUpToken&quot;: &quot;A String&quot;, # Token to maintain state in the follow up notification response. Deprecated. See the [notifications guide](https://developers.google.com/assistant/smarthome/develop/notifications) for details on implementing follow up notifications.
Bu Sun Kim65020912020-05-20 12:08:20 -0700154 &quot;payload&quot;: { # Payload containing the state and notification information for devices. # Required. State of devices to update and notification metadata for devices.
155 &quot;devices&quot;: { # The states and notifications specific to a device. # The devices for updating state and sending notifications.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700156 &quot;states&quot;: { # States of devices to update. See the **Device STATES** section of the individual trait [reference guides](https://developers.google.com/assistant/smarthome/traits).
Bu Sun Kim65020912020-05-20 12:08:20 -0700157 &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
158 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700159 &quot;notifications&quot;: { # Notifications metadata for devices. See the **Device NOTIFICATIONS** section of the individual trait [reference guides](https://developers.google.com/assistant/smarthome/traits).
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700160 &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
161 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700162 },
163 },
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800164 &quot;agentUserId&quot;: &quot;A String&quot;, # Required. Third-party user ID.
Bu Sun Kim65020912020-05-20 12:08:20 -0700165 }
166
167 x__xgafv: string, V1 error format.
168 Allowed values
169 1 - v1 error format
170 2 - v2 error format
171
172Returns:
173 An object of the form:
174
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700175 { # Response type for the [`ReportStateAndNotification`](#google.home.graph.v1.HomeGraphApiService.ReportStateAndNotification) call.
Bu Sun Kim65020912020-05-20 12:08:20 -0700176 &quot;requestId&quot;: &quot;A String&quot;, # Request ID copied from ReportStateAndNotificationRequest.
177 }</pre>
178</div>
179
180<div class="method">
181 <code class="details" id="requestSync">requestSync(body=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700182 <pre>Requests Google to send an `action.devices.SYNC` [intent](https://developers.google.com/assistant/smarthome/reference/intent/sync) to your smart home Action to update device metadata for the given user. The third-party user&#x27;s identity is passed via the `agent_user_id` (see RequestSyncDevicesRequest). This request must be authorized using service account credentials from your Actions console project.
Bu Sun Kim65020912020-05-20 12:08:20 -0700183
184Args:
185 body: object, The request body.
186 The object takes the form of:
187
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700188{ # Request type for the [`RequestSyncDevices`](#google.home.graph.v1.HomeGraphApiService.RequestSyncDevices) call.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700189 &quot;agentUserId&quot;: &quot;A String&quot;, # Required. Third-party user ID.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700190 &quot;async&quot;: True or False, # Optional. If set, the request will be added to a queue and a response will be returned immediately. This enables concurrent requests for the given `agent_user_id`, but the caller will not receive any error responses.
Bu Sun Kim65020912020-05-20 12:08:20 -0700191 }
192
193 x__xgafv: string, V1 error format.
194 Allowed values
195 1 - v1 error format
196 2 - v2 error format
197
198Returns:
199 An object of the form:
200
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700201 { # Response type for the [`RequestSyncDevices`](#google.home.graph.v1.HomeGraphApiService.RequestSyncDevices) call. Intentionally empty upon success. An HTTP response code is returned with more details upon failure.
Bu Sun Kim65020912020-05-20 12:08:20 -0700202 }</pre>
203</div>
204
205<div class="method">
206 <code class="details" id="sync">sync(body=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700207 <pre>Gets all the devices associated with the given third-party user. The third-party user&#x27;s identity is passed in via the `agent_user_id` (see SyncRequest). This request must be authorized using service account credentials from your Actions console project.
Bu Sun Kim65020912020-05-20 12:08:20 -0700208
209Args:
210 body: object, The request body.
211 The object takes the form of:
212
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700213{ # Request type for the [`Sync`](#google.home.graph.v1.HomeGraphApiService.Sync) call.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700214 &quot;requestId&quot;: &quot;A String&quot;, # Request ID used for debugging.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800215 &quot;agentUserId&quot;: &quot;A String&quot;, # Required. Third-party user ID.
Bu Sun Kim65020912020-05-20 12:08:20 -0700216 }
217
218 x__xgafv: string, V1 error format.
219 Allowed values
220 1 - v1 error format
221 2 - v2 error format
222
223Returns:
224 An object of the form:
225
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700226 { # Response type for the [`Sync`](#google.home.graph.v1.HomeGraphApiService.Sync) call. This should follow the same format as the Google smart home `action.devices.SYNC` [response](https://developers.google.com/assistant/smarthome/reference/intent/sync). # Example ```json { &quot;requestId&quot;: &quot;ff36a3cc-ec34-11e6-b1a0-64510650abcf&quot;, &quot;payload&quot;: { &quot;agentUserId&quot;: &quot;1836.15267389&quot;, &quot;devices&quot;: [{ &quot;id&quot;: &quot;123&quot;, &quot;type&quot;: &quot;action.devices.types.OUTLET&quot;, &quot;traits&quot;: [ &quot;action.devices.traits.OnOff&quot; ], &quot;name&quot;: { &quot;defaultNames&quot;: [&quot;My Outlet 1234&quot;], &quot;name&quot;: &quot;Night light&quot;, &quot;nicknames&quot;: [&quot;wall plug&quot;] }, &quot;willReportState&quot;: false, &quot;deviceInfo&quot;: { &quot;manufacturer&quot;: &quot;lights-out-inc&quot;, &quot;model&quot;: &quot;hs1234&quot;, &quot;hwVersion&quot;: &quot;3.2&quot;, &quot;swVersion&quot;: &quot;11.4&quot; }, &quot;customData&quot;: { &quot;fooValue&quot;: 74, &quot;barValue&quot;: true, &quot;bazValue&quot;: &quot;foo&quot; } }] } } ```
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800227 &quot;requestId&quot;: &quot;A String&quot;, # Request ID used for debugging. Copied from the request.
Bu Sun Kim65020912020-05-20 12:08:20 -0700228 &quot;payload&quot;: { # Payload containing device information. # Devices associated with the third-party user.
229 &quot;devices&quot;: [ # Devices associated with the third-party user.
230 { # Third-party device definition.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800231 &quot;roomHint&quot;: &quot;A String&quot;, # Suggested name for the room where this device is installed. Google attempts to use this value during user setup.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800232 &quot;otherDeviceIds&quot;: [ # Alternate IDs associated with this device. This is used to identify cloud synced devices enabled for [local fulfillment](https://developers.google.com/assistant/smarthome/concepts/local).
233 { # Alternate third-party device ID.
234 &quot;agentId&quot;: &quot;A String&quot;, # Project ID for your smart home Action.
235 &quot;deviceId&quot;: &quot;A String&quot;, # Unique third-party device ID.
236 },
237 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800238 &quot;id&quot;: &quot;A String&quot;, # Third-party device ID.
239 &quot;traits&quot;: [ # Traits supported by the device. See [device traits](https://developers.google.com/assistant/smarthome/traits).
240 &quot;A String&quot;,
241 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700242 &quot;name&quot;: { # Identifiers used to describe the device. # Names given to this device by your smart home Action.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700243 &quot;name&quot;: &quot;A String&quot;, # Primary name of the device, generally provided by the user.
244 &quot;defaultNames&quot;: [ # List of names provided by the manufacturer rather than the user, such as serial numbers, SKUs, etc.
245 &quot;A String&quot;,
246 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800247 &quot;nicknames&quot;: [ # Additional names provided by the user for the device.
248 &quot;A String&quot;,
249 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700250 },
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800251 &quot;willReportState&quot;: True or False, # Indicates whether your smart home Action will report state of this device to Google via ReportStateAndNotification.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700252 &quot;customData&quot;: { # Custom device attributes stored in Home Graph and provided to your smart home Action in each [QUERY](https://developers.google.com/assistant/smarthome/reference/intent/query) and [EXECUTE](https://developers.google.com/assistant/smarthome/reference/intent/execute) intent.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700253 &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
254 },
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800255 &quot;structureHint&quot;: &quot;A String&quot;, # Suggested name for the structure where this device is installed. Google attempts to use this value during user setup.
256 &quot;attributes&quot;: { # Attributes for the traits supported by the device.
257 &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
258 },
259 &quot;deviceInfo&quot;: { # Device information. # Device manufacturer, model, hardware version, and software version.
260 &quot;manufacturer&quot;: &quot;A String&quot;, # Device manufacturer.
261 &quot;model&quot;: &quot;A String&quot;, # Device model.
262 &quot;swVersion&quot;: &quot;A String&quot;, # Device software version.
263 &quot;hwVersion&quot;: &quot;A String&quot;, # Device hardware version.
264 },
265 &quot;type&quot;: &quot;A String&quot;, # Hardware type of the device. See [device types](https://developers.google.com/assistant/smarthome/guides).
266 &quot;notificationSupportedByAgent&quot;: True or False, # Indicates whether your smart home Action will report notifications to Google for this device via ReportStateAndNotification. If your smart home Action enables users to control device notifications, you should update this field and call RequestSyncDevices.
Bu Sun Kim65020912020-05-20 12:08:20 -0700267 },
268 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800269 &quot;agentUserId&quot;: &quot;A String&quot;, # Third-party user ID
Bu Sun Kim65020912020-05-20 12:08:20 -0700270 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700271 }</pre>
272</div>
273
274</body></html>