Chris Wang
Chris Wang

Reputation: 155

Actions on Google - smart home - how to make Google Home response properly when smart home device is offline?

My smart home app can control my smart home devices already. However, I can't make Google Home to say like "your device is offline" when the smart home device is offline.

Google Home always says "ok, turning device_name on.". According to the document and Node.js example provided by Google, I tried 2 kinds of error response:

{
  "requestId": "xxxxxxx",
  "payload": {  
    "commands": [{  
      "ids": ["456"],  
      "status": "ERROR",  
      "errorCode": "deviceoffline"  
    }]  
  }  
}

{
  "requestId": "xxxxxxx",
  "payload": {  
    "commands": [{  
      "ids": ["456"],  
      "status": "OFFLINE",  
      "errorCode": "deviceoffline"  
    }]  
  }  
}

But both are not working. Please enlighten me. Thanks.

2017/08/02 update: offline status is working on QUERY, like "Is device_name on?". Not working on EXEC, like "Turn on device_name".

Upvotes: 1

Views: 392

Answers (1)

Aarth Tandel
Aarth Tandel

Reputation: 1009

You missed out online parameter in the JSON. Here is an example of offline

   {
      "ids": ["456"],
      "status": "ERROR",
      "errorCode": "deviceTurnedOff",
      "online": false
    }

Upvotes: 0

Related Questions