Skip to main content

Discovery

Energy devices can be automatically discovered on your network using Multicast DNS (also known as mDNS, Zeroconf, or Bonjour). This technology enables your application to discover devices without requiring the user to know the IP address.

Services

Devices can broadcast one or two services on the network, depending on the available API version(s) of this device:

  • _hwenergy._tcp - to discover devices that are using API v1 over HTTP
  • _homewizard._tcp - to discover devices that are using API v2 and later over HTTPS

_hwenergy._tcp

P1 Meter
Supported
Energy Socket
Supported
Energy Display
Not supported
kWh Meter
Supported
Watermeter
Supported
Plug-In Battery
Not supported

This service is used to discover devices that are using API v1, which uses HTTP (port 80). Devices with API v1 are available on the _hwenergy._tcp service.

TXT Records

A discovery response contains additional data to enhance the setup in your application.

DataDescription
api_enabledIndicates if the API is enabled. The API is disabled when set to 0 and enabled when set to 1. See how to enable the API.
pathSet to /api/v1. Can be used to verify that your application supports this device and API version.
serialDevice serial number, also used as the MAC address. This unique value per device consists of 12 hexadecimal characters.
product_nameA user-friendly name that may change at any time.
product_typeThe product type; refer to supported devices. Your application should support additional values for future products.

_homewizard._tcp

P1 Meter
Supported
Energy Socket
In development
Energy Display
In development
kWh Meter
In development
Watermeter
In development
Plug-In Battery
In development

This service is used to discover devices that are using API v2 and later, which uses HTTPS (port 443). Devices with this API version are available on the _homewizard._tcp service.

TXT Records

A discovery response includes additional data to enhance the setup in your application.

DataDescription
api_versionThe latest API version.
idDevice identifier used during validation of the SSL certificate, formatted as appliance/<product_type>/<serial>.
serialDevice serial number, also used as the MAC address. This value is unique per device and consist of 12 hexadecimal characters.
product_nameA user-friendly name that may change at any time.
product_typeThe product type; refer to supported devices. Your application should support additional values for future products.

Example

Run the following command to discover devices on your network: dns-sd -B _hwenergy._tcp .

   $ dns-sd -B _hwenergy._tcp .
Browsing for _hwenergy._tcp
DATE: ---Tue 29 Oct 2024---
14:51:03.565 ...STARTING...
Timestamp A/R Flags if Domain Service Type Instance Name
14:51:03.566 Add 3 7 local. _hwenergy._tcp. energysocket-AABBCC
14:51:03.566 Add 3 7 local. _hwenergy._tcp. energysocket-DDEEFF
14:51:03.566 Add 3 7 local. _hwenergy._tcp. energysocket-001122
14:51:03.566 Add 3 7 local. _hwenergy._tcp. p1meter-334455
14:51:03.566 Add 3 7 local. _hwenergy._tcp. kwhmeter-667788
14:51:03.566 Add 3 7 local. _hwenergy._tcp. watermeter-ABCDEF