When working with multiple devices which support Commands it is possible to use a single listener using a single device as a Hub instead of listening to each endpoint:
- Create a device hub, by adding in device a property "isHub": true, via API
- Create all of the relevant devices to be under this device-hub, they need to have "isHub": false, and hubId = the device id of the original hub that you’ve created.
Now each command to those device will arrive to the hub device , therefore you can create only one listener to the command for the hub.
Both listening and sending Commands use the Hub