blob: 206bdfe3c592ec1b2b2bbc8321fd24b982fb2a76 [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.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800107 &quot;agentUserId&quot;: &quot;A String&quot;, # Required. Third-party user ID.
108 &quot;inputs&quot;: [ # Required. Inputs containing third-party device IDs for which to get the device states.
109 { # Device ID inputs to QueryRequest.
110 &quot;payload&quot;: { # Payload containing device IDs. # Payload containing third-party device IDs.
111 &quot;devices&quot;: [ # Third-party device IDs for which to get the device states.
112 { # Third-party device ID for one device.
113 &quot;id&quot;: &quot;A String&quot;, # Third-party device ID.
114 },
115 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700116 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800117 },
118 ],
119 &quot;requestId&quot;: &quot;A String&quot;, # Request ID used for debugging.
120}
Bu Sun Kim65020912020-05-20 12:08:20 -0700121
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 Botcc94ec82021-01-15 07:10:04 -0800131 &quot;payload&quot;: { # Payload containing device states information. # Device states for the devices given in the request.
132 &quot;devices&quot;: { # States of the devices. Map of third-party device ID to struct of device states.
133 &quot;a_key&quot;: {
134 &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
Bu Sun Kim65020912020-05-20 12:08:20 -0700135 },
136 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800137 },
138 &quot;requestId&quot;: &quot;A String&quot;, # Request ID used for debugging. Copied from the request.
139}</pre>
Bu Sun Kim65020912020-05-20 12:08:20 -0700140</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 Botcc94ec82021-01-15 07:10:04 -0800151 &quot;agentUserId&quot;: &quot;A String&quot;, # Required. Third-party user ID.
152 &quot;eventId&quot;: &quot;A String&quot;, # Unique identifier per event (for example, a doorbell press).
yoshi-code-bota8b35b92021-03-31 13:33:30 -0700153 &quot;followUpToken&quot;: &quot;A String&quot;, # Deprecated.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800154 &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.
156 &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).
157 &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
158 },
159 &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).
160 &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
Bu Sun Kim65020912020-05-20 12:08:20 -0700161 },
162 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800163 },
164 &quot;requestId&quot;: &quot;A String&quot;, # Request ID used for debugging.
165}
Bu Sun Kim65020912020-05-20 12:08:20 -0700166
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.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800176 &quot;requestId&quot;: &quot;A String&quot;, # Request ID copied from ReportStateAndNotificationRequest.
177}</pre>
Bu Sun Kim65020912020-05-20 12:08:20 -0700178</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.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800189 &quot;agentUserId&quot;: &quot;A String&quot;, # Required. Third-party user ID.
190 &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.
191}
Bu Sun Kim65020912020-05-20 12:08:20 -0700192
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.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800202}</pre>
Bu Sun Kim65020912020-05-20 12:08:20 -0700203</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.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800214 &quot;agentUserId&quot;: &quot;A String&quot;, # Required. Third-party user ID.
215 &quot;requestId&quot;: &quot;A String&quot;, # Request ID used for debugging.
216}
Bu Sun Kim65020912020-05-20 12:08:20 -0700217
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 Botcc94ec82021-01-15 07:10:04 -0800227 &quot;payload&quot;: { # Payload containing device information. # Devices associated with the third-party user.
228 &quot;agentUserId&quot;: &quot;A String&quot;, # Third-party user ID
229 &quot;devices&quot;: [ # Devices associated with the third-party user.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800230 { # Third-party device definition. Next ID = 14
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800231 &quot;attributes&quot;: { # Attributes for the traits supported by the device.
232 &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
233 },
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800234 &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. Data in this object has a few constraints: No sensitive information, including but not limited to Personally Identifiable Information.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800235 &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
236 },
237 &quot;deviceInfo&quot;: { # Device information. # Device manufacturer, model, hardware version, and software version.
238 &quot;hwVersion&quot;: &quot;A String&quot;, # Device hardware version.
239 &quot;manufacturer&quot;: &quot;A String&quot;, # Device manufacturer.
240 &quot;model&quot;: &quot;A String&quot;, # Device model.
241 &quot;swVersion&quot;: &quot;A String&quot;, # Device software version.
242 },
243 &quot;id&quot;: &quot;A String&quot;, # Third-party device ID.
244 &quot;name&quot;: { # Identifiers used to describe the device. # Names given to this device by your smart home Action.
245 &quot;defaultNames&quot;: [ # List of names provided by the manufacturer rather than the user, such as serial numbers, SKUs, etc.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800246 &quot;A String&quot;,
247 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800248 &quot;name&quot;: &quot;A String&quot;, # Primary name of the device, generally provided by the user.
249 &quot;nicknames&quot;: [ # Additional names provided by the user for the device.
250 &quot;A String&quot;,
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800251 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700252 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800253 &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.
254 &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).
255 { # Alternate third-party device ID.
256 &quot;agentId&quot;: &quot;A String&quot;, # Project ID for your smart home Action.
257 &quot;deviceId&quot;: &quot;A String&quot;, # Unique third-party device ID.
258 },
259 ],
260 &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.
261 &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.
262 &quot;traits&quot;: [ # Traits supported by the device. See [device traits](https://developers.google.com/assistant/smarthome/traits).
263 &quot;A String&quot;,
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;willReportState&quot;: True or False, # Indicates whether your smart home Action will report state of this device to Google via ReportStateAndNotification.
267 },
268 ],
269 },
270 &quot;requestId&quot;: &quot;A String&quot;, # Request ID used for debugging. Copied from the request.
271}</pre>
Bu Sun Kim65020912020-05-20 12:08:20 -0700272</div>
273
274</body></html>