Homey Community Forum

OnPair(session) 404 for the documentation page

Hi,

On:
https://apps-sdk-v3.developer.athom.com/Driver.html#onPair
A parameter is described PairSession that links to:
https://apps-sdk-v3.developer.athom.com/PairSession.html

But that page is a 404.
Where can I find the documentation of what such a pair session does?

I’d like to do some checks, before returning a custom array of devices that can be chosen. I got as far as the list_devices view, but there I get a name of undefined error, while I did overwrite the onPairListDevices method as described here, but that method is not executed as it does not return log entries.

You need to report this to Athom https://support.athom.com/hc/en-us/requests/new
or maybe try @weejewel on slack.

1 Like

What log entries are you referring to?
Can you post the list_devices method so we can see what you are trying to do?

The list_devices is here.

async onPairListDevices() {
    this.log('listed devices');
    return [{
      name: 'KNMI weather',
      data: {
        id: 'HomeyLocation',
      },
    }];
  }

For now I have solved it differently by just adding the device in the on pair and calling Homey.done() from the view. In a future version I would like to be able to allow users to add a second device though.

Anyways, this is literally the same as what is in the documentation apart from using a different name and id. And to check if it gets executed I added a log statement. I think it is strange that it’s async but still directly returns instead of a Promise.resolve([{…}]). But I would expect the docs to know best.

So does that mean you see the list devices page?
If you are also overriding onPair then maybe that is prevent the alternative method from working. I have only used one or the other, not both.
You can catch the list_devices in the onPair function as well. The SDK2 documentation may help but remember it is all async now so ignore the callback stuff: https://apps-sdk-v2.developer.athom.com/tutorial-Drivers-Pairing-System%20Views-Devices%20List.html

There is no socket.on function in SDK v3, there you need to overwrite the onPairListDevices method, as I did like described in the docs. Doing that from within the onPair method, I would not know how.

The documentation is now updated for SDK v3, where the correct way is now shown.
https://apps-sdk-v3.developer.athom.com/tutorial-Drivers-Pairing-System%20Views-Devices%20List.html

1 Like