# Device discovery - how to get pairing info when no info is provided in docs?

**URL:** <https://community.homey.app/t/device-discovery-how-to-get-pairing-info-when-no-info-is-provided-in-docs/84296>\
**Category:** Developers\
**Tags:** app\
**Created:** [July 10, 2023, 8:09am UTC](https://community.homey.app/t/device-discovery-how-to-get-pairing-info-when-no-info-is-provided-in-docs/84296 "2023-07-10T08:09:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim\_R](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tim_r/32/82292_2.png) [@Tim\_R](https://community.homey.app/u/Tim_R)\
**Post date:** [July 10, 2023, 8:09am UTC](https://community.homey.app/t/device-discovery-how-to-get-pairing-info-when-no-info-is-provided-in-docs/84296/1 "2023-07-10T08:09:20Z")

</div>

Hey all,

Soon I’ll receive a Hitachi ATW-MBS-02 to communicate though Modbus with my heatpump.

For the discovery I’ll have to set the `mdns-sd` info as per the [SDK docs.](https://apps.developer.homey.app/wireless/wi-fi/discovery/)

> A device broadcasts its presence under a `name` ( **as specified by the manufacturer** )

The thing is that the device tech docs do not reference this. Is there a network scan command I can preform in the CLI to get my required info?

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [July 10, 2023, 8:27am UTC](https://community.homey.app/t/device-discovery-how-to-get-pairing-info-when-no-info-is-provided-in-docs/84296/2 "2023-07-10T08:27:36Z")

</div>

> [@Tim\_R](#):
>
> Is there a network scan command I can preform in the CLI to get my required info?

Depends on your OS, on macOS and Linux you can use `tcpdump`:

```auto
$ sudo tcpdump -n multicast

```

Taking, for example, the [Shelly mDNS discovery configuration](https://github.com/jghaanstra/cloud.shelly/blob/dc52dc5259ba19e03a4b7280aae4c234687ec5b8/.homeycompose/discovery/shelly.json), it looks for a service name `http` and protocol `tcp`.

Using the command above, this is what’s being logged for one of my Shelly devices:

```auto
10:22:13.571628 IP 192.168.23.60.5353 > 224.0.0.251.5353: 0* [0q] 6/0/0 PTR _http._tcp.local., PTR shelly1-XXX._http._tcp.local., (Cache flush) SRV shelly1-XXX.local.:80 0 0, (Cache flush) TXT "id=shelly1-XXX" "arch=esp8266" "app=switch1" "fw_version=1.0" "fw_id=20221027-091427/v1.12.1-ga9117d3" "discoverable=false", (Cache flush) A 192.168.23.60, (Cache flush) NSEC (454)

```

The first `PTR` value shows the name and the protocol, prefixed by an underscore.

Other example: the Plugwise app. This is its discovery configuration:

```auto
"mdns-sd": {
    "name": "plugwise",
    "protocol": "tcp"
  }

```

And this is what `tcpdump` logs:

```auto
10:26:17.990690 IP 192.168.23.68.5353 > 224.0.0.251.5353: 0*- [0q] 2/0/0 PTR _plugwise._tcp.local., PTR _http._tcp.local. (89)

```

Again, you can see that the first `PTR` value contains the name and the protocol from the configuration.

---

<div class="post-metadata">

**Author:** ![Tim\_R](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tim_r/32/82292_2.png) [@Tim\_R](https://community.homey.app/u/Tim_R)\
**Post date:** [July 10, 2023, 8:45am UTC](https://community.homey.app/t/device-discovery-how-to-get-pairing-info-when-no-info-is-provided-in-docs/84296/3 "2023-07-10T08:45:58Z")

</div>

> [@robertklep](#):
>
> `sudo tcpdump -n multicast`

Thanks Robert for the detailed explanation.

Running the dump I get this (a part of it)

```auto
10:33:31.223125 IP6 fe80::221f:3bff:fe9d:5639.5552 > ff02::fb.5353: 0 PTR (QM)? _googlezone._tcp.local. (40)
10:33:31.223729 IP 192.168.0.22.5353 > 224.0.0.251.5353: 0*- [0q] 1/0/3 PTR 455433b78-332s6-2c43-afee-a85f7ef0a13f._googlezone._tcp.local. (268)
10:33:31.224151 IP 192.168.0.229.5353 > 224.0.0.251.5353: 0*- [0q] 1/0/3 PTR 7e656134-a436-d281-43c0-ed8d656eb215._googlezone._tcp.local. (214)

```

I presume this is the Googlenest. Now as a check. I see `_googlezone`. So I would create:

```auto
"mdns-sd": {
    "name": "googlezone",
    "protocol": "tcp"
  }

```

The fact that I see two of them would be that these are two unique devices. Just use the `_googlezone` part, right?

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [July 10, 2023, 8:50am UTC](https://community.homey.app/t/device-discovery-how-to-get-pairing-info-when-no-info-is-provided-in-docs/84296/4 "2023-07-10T08:50:51Z")

</div>

> [@Tim\_R](#):
>
> Just use the `_googlezone` part, right?

Correct.
