0

When I send this JSON with reportState() to the Google Homegraph API

{
  "requestId":"15cdee88-e804-4352-a2f9-4eace7eb119d",
  "agentUserId":"18807",
  "payload":{
    "devices":{
       "states":{"9196":{"status":"ERROR","errorCode":"deviceStuck"}}
    }
  }
}

I get this error

reporting device state to homegraph: {"error":{"code":400,"message":"Request contains an invalid argument.","status":"INVALID_ARGUMENT"}}

The target device is a mower with these traits

traits: [
      "action.devices.traits.StartStop",
      "action.devices.traits.Dock",
    ],

Is it possible to set an error for a device in the homegraph API? And if yes how should the JSON look?

edit: using those package version if that's relevant

  "@googleapis/homegraph": "^2.0.0",
    "actions-on-google": "^2.13.0",
numa
  • 1
  • 1
  • If you look at the [ReportStateAndNotificationDevice](https://developers.google.com/assistant/smarthome/reference/rest/v1/devices/reportStateAndNotification#reportstateandnotificationdevice) reference material, it suggests that errors cannot be reported. – Nick Felker Jul 22 '21 at 21:52

1 Answers1

0

You can return errors or exceptions for a device within EXECUTE and QUERY responses. Examples of this are available on the errors reference guide. You can also see a more detailed example of this in the Smart Home traits codelab.

ToniCorinne
  • 503
  • 3
  • 12