Update ZiGate-Ethernet.ino with values for Home Assistant ZHA discovery via mDNS Zeroconf #8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@fairecasoimeme as per #7 this blind attempt adds missing DNS TXT records values needed for Zeroconf discovery in ZHA.
https://www.home-assistant.io/integrations/zha/#discovery-via-usb-or-zeroconf
Also note that I changed the service name to contain word "zigate" which will be needed as an identifier for ZiGate gateways.
So this is my attempt at updating ZiGate-Ethernet.ino with values for Home Assistant ZHA discovery via mDNS Zeroconf.
Please understand that I own a ZiGate-Ethernet to test it myself so I can not test this (I am just a fan of ZHA's auto-discovery).
This is a back-port of the mDNS code that @xyzroe and @mercenaruss is working on for ZigStar-Gateway firmware (which in turn is a fork of ZiGate-Ethernet firmware):
xyzroe/ZigStarGW-FW#3
https://github.com/xyzroe/ZigStarGW-FW/blob/fd41317584758333786d26592d24b3d90a0e60d2/src/main.cpp#L648-L652
Other than the service name really need to start with "zigate*" as a unique identifier, these values is needed via TXT records:
@fairecasoimeme I assumed ZiGate Zigbee radio uses software flow control but maybe it use hardware or no flow control? Could be that flow control parameter for serial communication needs to be set to
hardware
ornone
instead ofsoftware
?Anyway; hostname, service, port, are the minimum TXT records needed for Home Assistant ZHA discovery via mDNS Zeroconf.
If wanted could add additional TXT records for information, like version and location, (some ESPHome based gateways do so).
You should be able to test ZiGate results obtained with
avahi-browse -a -r
so can see that txt format and info looks correct.Result from
avahi-browse -a -r
should be compatible with ZHA integration in Home Assistant if they look something like:Once those values are available to Zeroconf via DNS TXT records can submit patch for ZiGate-Ethernet to Home Assistant core:
https://github.com/home-assistant/core/blob/dev/homeassistant/generated/zeroconf.py
https://github.com/home-assistant/core/blob/dev/homeassistant/components/zha/manifest.json
See example for
"tube*"
as used for"domain": "zha"
in those two files which could be copied and replaced with zigate info:https://github.com/home-assistant/core/blob/dev/homeassistant/generated/zeroconf.py#L79
https://github.com/home-assistant/core/blob/dev/homeassistant/components/zha/manifest.json#L26
Plus think also need to add
zigate
to ZHA config flow as that currently look to only supportezsp
andznp
radio types, or?https://github.com/home-assistant/core/blob/dev/homeassistant/components/zha/config_flow.py#L190
@doudz Can you maybe help test Conditions and If statements for adding
RadioType.zigate.name
with anotherelse
? Like: