Skip to content

Discovery: also probe HA Zigbee2MQTT add-on default port (8099) #39

@tashda

Description

@tashda

Summary

Z2MDiscoveryService currently sweeps the local /24 probing only TCP port 8080 (the standalone Docker install default). Users running Zigbee2MQTT as a Home Assistant Community Add-on don't get discovered because that add-on serves its frontend / WebSocket on 8099.

Confirmed in the add-on's config: https://github.com/zigbee2mqtt/hassio-zigbee2mqtt/blob/master/zigbee2mqtt/config.yaml

ports:
  8099/tcp: 8099

Proposed change

Probe both ports during the LAN sweep. When a host responds on either, record host:port (or surface it as a typed result, e.g. DiscoveredHost { host, port }) so the user lands on the right port when they tap to add the server, instead of being defaulted to 8080.

Scope

  • Z2MDiscoveryService.z2mPort becomes a list: [8080, 8099]. Probe loop iterates both per host.
  • discoveredHosts becomes Set<DiscoveredEndpoint> (or similar) with host + port; ConnectionDiscoverySection shows the port when it's non-default.
  • presentNewServer(prefilledHost:)presentNewServer(prefilledHost:port:) so the editor opens with the right port pre-filled.
  • HTTP probe still validates the response contains zigbee2mqtt (already done).

Acceptance criteria

  • A HA OS host running the Z2M add-on on 8099 appears in the "Nearby Servers" list.
  • Tapping a discovered HA add-on entry pre-fills port 8099 in the editor.
  • Standalone Docker installs on 8080 still work as today.
  • No measurable slowdown of the scan (it's already concurrent with a 48-wide semaphore — doubling probes per host is fine).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions