0

I have integrated google assistant into my own app. When executing an action for a LIGHT device type, such as turning it on/off, I get an assistant response like "OK, Sorry, I can't reach the Bulb right now. Please try again" but the execution happens anyway. Following is a sample response which will send in response to an execute intent request.

{"payload":{"commands":[{"ids":[12549],"status":"SUCCESS","states":{"online":true,"on":true}}]},"requestId":"15838577278862147328"}

What am I doing wrong here? this works perfectly for other device types (OUTLET, SWITCH).

Also I can use the home app ui for bulb to control it manually and it works perfectly. The bulb I'm using is a TuyaSmart rgb light bulb.

Poorna
  • 72
  • 8
  • How long does it take to generate that response? It may be timing out. – Nick Felker Jul 06 '20 at 15:35
  • @Nick It was the case when I first implement for switches/outlets, but I resolved that issue by giving google the required response first and then later executing the action(under the assumption that if the device is online it will always perform the said action, if not I send the proper error code). This change applies to the bulb as well. The response is generating under 2 seconds. – Poorna Jul 07 '20 at 11:04
  • 1
    Another thing I'm noticing is that your ID 12549 is a number rather than a string. If you put it in quotes you should see it working. – Nick Felker Jul 07 '20 at 15:09
  • 1
    @Nick thanks a lot. it is working now! – Poorna Jul 07 '20 at 16:43

1 Answers1

1

Looking at the response, it appears that the identifier 12549 is a number and not a string. The platform expects a device ID to be a string. By putting it in quotes it will work.

Nick Felker
  • 11,536
  • 1
  • 21
  • 35