1
votes

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".

1

1 Answers

0
votes

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

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