# Discovery and pairing of variation of different devices

**URL:** <https://community.homey.app/t/discovery-and-pairing-of-variation-of-different-devices/98658>\
**Category:** Developers\
**Created:** [December 22, 2023, 1:36pm UTC](https://community.homey.app/t/discovery-and-pairing-of-variation-of-different-devices/98658 "2023-12-22T13:36:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tjar](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tjar/32/61177_2.png) [@Tjar](https://community.homey.app/u/Tjar)\
**Post date:** [December 22, 2023, 1:36pm UTC](https://community.homey.app/t/discovery-and-pairing-of-variation-of-different-devices/98658/1 "2023-12-22T13:36:39Z")

</div>

Hi All,

I’m encountering some challenge with adding devices.

Problem:  
I have one modbus TCP device with one modbus ID, this is the ‘network master’ .  
The Master holds info regarding it’s own ‘local network’ which has several (ventilation) devices.  
The devices can be a valve, or a room sensor, or whatever. So every device could need a different device.js.

There are some constants:

- The devices pages are always 10 modbus addresses
- The ’ device type’ address is always the FIRST address (10, 20, 30, 40…)
- The master is always on address 10.

So, I was thinking of a discovery on [IP]:[port] with DEVICE\_ID :

- First read address 10, which should retrun the master
- then read all x0 addresses (20, 30, 40, 50, 60…) and add these as ‘device’ in a device list for pairing.

My questions are:  
How to approach this, how to link the devices to the right device-files, which pairing html should I use/edit, etc.

Could someone point me in the right direction?

Best regards,

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [December 24, 2023, 8:15am UTC](https://community.homey.app/t/discovery-and-pairing-of-variation-of-different-devices/98658/2 "2023-12-24T08:15:25Z")

</div>

If your devices have different capabilities and functionality, then I would create different drivers.  
Only different device.js doesn’t work. You need different drivers.

So one driver for the master device  
Another driver for your ventilation devices.

Use the standard list\_devices pair template.  
Return the matching devices to show up in pair view (using the callback function).

In pair view, you select the driver (device type) and get a lift of devices of this type.

---

<div class="post-metadata">

**Author:** ![Tjar](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tjar/32/61177_2.png) [@Tjar](https://community.homey.app/u/Tjar)\
**Post date:** [December 24, 2023, 7:14pm UTC](https://community.homey.app/t/discovery-and-pairing-of-variation-of-different-devices/98658/3 "2023-12-24T19:14:13Z")

</div>

hi @RonnyW ,

thank you for your reply.  
I understand that every device needs its matching driver.

I was in the understanding that the pairing procedure was automatic for a specific driver.  
You say that I would be able to return a device\_list containing different types of devices? I thought I could only return a device\_id, not a device type (the required driver)?

Is there an app that uses this type of pairing?

Could another approach be using the “addCapability” method on pairing, depending on the devices found?

Best regards,

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [December 24, 2023, 9:34pm UTC](https://community.homey.app/t/discovery-and-pairing-of-variation-of-different-devices/98658/4 "2023-12-24T21:34:49Z")

</div>

You can create your generic driver for all devices.  
Dependent on your devices you can create your device array in list\_devices event. There you can set a capability list for every device.  
In device.js you can implement capabiity listener for capabilities (or a multi capability listener). Tjis way you can implement capability specific logic.

---

<div class="post-metadata">

**Author:** ![Tjar](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tjar/32/61177_2.png) [@Tjar](https://community.homey.app/u/Tjar)\
**Post date:** [December 25, 2023, 7:01am UTC](https://community.homey.app/t/discovery-and-pairing-of-variation-of-different-devices/98658/5 "2023-12-25T07:01:52Z")

</div>

Hi @RonnyW ,

thank you for your reply.

searching for an example a found this page, which looks helpful.

> [tutorial drivers pairing](https://apps-sdk-v2.developer.athom.com/tutorial-Drivers-Pairing.html)  
> It’s for Dsk2 but I presume Dsk3 works similar.

[tutorial drivers pairing SDK3] [Pairing - Homey Apps SDK](https://apps.developer.homey.app/the-basics/devices/pairing)

Best regards,
