简体   繁体   中英

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM