# OnPair(session) 404 for the documentation page

**URL:** <https://community.homey.app/t/onpair-session-404-for-the-documentation-page/34268>\
**Category:** Developers\
**Created:** [September 1, 2020, 9:18pm UTC](https://community.homey.app/t/onpair-session-404-for-the-documentation-page/34268 "2020-09-01T21:18:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Some1](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/some1/32/8283_2.png) [@Some1](https://community.homey.app/u/Some1)\
**Post date:** [September 1, 2020, 9:18pm UTC](https://community.homey.app/t/onpair-session-404-for-the-documentation-page/34268/1 "2020-09-01T21:18:56Z")

</div>

Hi,

On:  
[https://apps-sdk-v3.developer.athom.com/Driver.html#onPair](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](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](https://apps-sdk-v3.developer.athom.com/tutorial-Drivers.html), but that method is not executed as it does not return log entries.

---

<div class="post-metadata">

**Author:** ![Adrian\_Rockall](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_rockall/32/13209_2.png) [@Adrian\_Rockall](https://community.homey.app/u/Adrian_Rockall)\
**Post date:** [September 3, 2020, 11:06am UTC](https://community.homey.app/t/onpair-session-404-for-the-documentation-page/34268/2 "2020-09-03T11:06:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Adrian\_Rockall](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_rockall/32/13209_2.png) [@Adrian\_Rockall](https://community.homey.app/u/Adrian_Rockall)\
**Post date:** [September 3, 2020, 11:22am UTC](https://community.homey.app/t/onpair-session-404-for-the-documentation-page/34268/3 "2020-09-03T11:22:16Z")

</div>

> [@Some1](#):
>
> while I did overwrite the onPairListDevices method as described [here](https://apps-sdk-v3.developer.athom.com/tutorial-Drivers.html), but that method is not executed as it does not return log entries.

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

---

<div class="post-metadata">

**Author:** ![Some1](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/some1/32/8283_2.png) [@Some1](https://community.homey.app/u/Some1)\
**Post date:** [September 3, 2020, 11:45am UTC](https://community.homey.app/t/onpair-session-404-for-the-documentation-page/34268/4 "2020-09-03T11:45:56Z")

</div>

The list\_devices is [here](https://github.com/bochove/nl.bochove.knmi/blob/master/drivers/knmi/driver.js).

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

---

<div class="post-metadata">

**Author:** ![Adrian\_Rockall](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_rockall/32/13209_2.png) [@Adrian\_Rockall](https://community.homey.app/u/Adrian_Rockall)\
**Post date:** [September 3, 2020, 12:09pm UTC](https://community.homey.app/t/onpair-session-404-for-the-documentation-page/34268/5 "2020-09-03T12:09:32Z")

</div>

> [@Some1](#):
>
> I got as far as the list\_devices view

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: [Devices List - Homey Apps SDK v2 Documentation](https://apps-sdk-v2.developer.athom.com/tutorial-Drivers-Pairing-System%20Views-Devices%20List.html)

---

<div class="post-metadata">

**Author:** ![Some1](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/some1/32/8283_2.png) [@Some1](https://community.homey.app/u/Some1)\
**Post date:** [September 3, 2020, 12:12pm UTC](https://community.homey.app/t/onpair-session-404-for-the-documentation-page/34268/6 "2020-09-03T12:12:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Some1](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/some1/32/8283_2.png) [@Some1](https://community.homey.app/u/Some1)\
**Post date:** [September 3, 2020, 12:23pm UTC](https://community.homey.app/t/onpair-session-404-for-the-documentation-page/34268/7 "2020-09-03T12:23:44Z")

</div>

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](https://apps-sdk-v3.developer.athom.com/tutorial-Drivers-Pairing-System%20Views-Devices%20List.html)
