|
| 1 | +--- |
| 2 | +sidebar_position: 5 |
| 3 | +--- |
| 4 | + |
| 5 | +# Discovery |
| 6 | +The energy devices can be automatically discovered on your network, the method used for this is [Multicast DNS](https://www.ionos.com/digitalguide/server/know-how/multicast-dns/) (`mDNS`, or sometimes called `Zeroconf` or `Bonjour`). Your application can use this technology to discover the device(s) without the user having to enter the IP address. |
| 7 | + |
| 8 | +## Example scan |
| 9 | +The device can be found on the `_hwenergy._tcp` domain. |
| 10 | +``` |
| 11 | + $ dns-sd -B _hwenergy._tcp . |
| 12 | + Browsing for _hwenergy._tcp |
| 13 | + DATE: ---Wed 13 Oct 2021--- |
| 14 | + 14:51:03.565 ...STARTING... |
| 15 | + Timestamp A/R Flags if Domain Service Type Instance Name |
| 16 | + 14:51:03.566 Add 3 7 local. _hwenergy._tcp. energysocket-AABBCC |
| 17 | + 14:51:03.566 Add 3 7 local. _hwenergy._tcp. energysocket-DDEEFF |
| 18 | + 14:51:03.566 Add 3 7 local. _hwenergy._tcp. energysocket-001122 |
| 19 | + 14:51:03.566 Add 3 7 local. _hwenergy._tcp. p1meter-334455 |
| 20 | + 14:51:03.566 Add 3 7 local. _hwenergy._tcp. energymeter-667788 |
| 21 | + 14:51:03.566 Add 3 7 local. _hwenergy._tcp. watermeter-ABCDEF |
| 22 | +``` |
| 23 | + |
| 24 | +The hostname is formatted as ``<product-name>-<last 6 characters of serial>``, so devices with serial ``AABBCCDDEEFF`` the hostname is as following: |
| 25 | + |
| 26 | +| Device | Example hostname | |
| 27 | +|-------------------------|------------------| |
| 28 | +| P1 meter | p1meter-DDEEFF | |
| 29 | +| Energy Socket | energysocket-DDEEFF | |
| 30 | +| Watermeter | watermeter-DDEEFF | |
| 31 | +| kWh meter (single phase)| kwhmeter-DDEEFF | |
| 32 | +| kWh meter (three phase) | kwhmeter-DDEEFF | |
| 33 | + |
| 34 | +## TXT records |
| 35 | + |
| 36 | +A discovery response contains some extra data that can be used to improve the setup in your application. |
| 37 | + |
| 38 | +| Data | Description | |
| 39 | +|---------------|-------------| |
| 40 | +| api_enabled | '0' or '1', reflects if the API is enabled (1 means enabled) | |
| 41 | +| path | Fixed to '/api/v1'. Can be used to validate that your application supports this device and API version | |
| 42 | +| serial | Serial, also the MAC address. Consists of 12 hexadecimal values | |
| 43 | +| product_name | A fixed, user-friendly name. This name is not the same that is set by the user in the app. | |
| 44 | +| product_code | The product type, see [Supported devices](/docs/getting-started.md#supported-devices). Make sure your application can handle other values for future products | |
0 commit comments