google-home / smart-home-local

Local Home SDK sample
https://developers.google.com/actions/smarthome/concepts/local
Apache License 2.0
282 stars 69 forks source link

REACHABLE_DEVICES only sent for one proxy device if multiple are present #147

Open dominik-polic opened 3 months ago

dominik-polic commented 3 months ago

I have a situation where I have multiple proxy devices, each of which has 1-7 endpoint devices connected to it. I'm trying to implement the local fulfilment and I've encountered a problem where after IDENTIFY-ing multiple devices as proxies, only one is actually working correctly, meaning that I only get REACHABLE_DEVICES request for one of them.

I receive and handle IDENTIFY request for all of them, and set the payload.device property of the response to:

{
 id: "[DEVICE_ID_HERE]"
 isLocalOnly: true|false
 isProxy: true
}

Some proxy devices also have OnOff functions of their own, so isLocalOnly is set accordingly if the specific proxy device is also available via cloud fulfilment and present in the SYNC response. I tried with all local only and all cloud-supported proxies and it made no difference.

It seems like the local fulfilment API only supports/recognizes one proxy/hub device and ignores the rest. The proxy device that gets the REACHABLE_DEVICES request is random and changes after each restart of the Google Nest device. EXECUTE intents work correctly for all actions that impact proxy devices directly and for the one proxy that has handled the REACHABLE_DEVICES, devices connected to that proxy handle the EXECUTE request correctly. Correct state is also reported to the Google Nest device and the Google Home app using local fulfilment. Devices connected via other hubs are never discovered locally and are actuated using cloud fulfilment.

dominik-polic commented 3 months ago

This issue might be related: #94