Closed Hedda closed 2 years ago
FYI, Zero-configuration networking (zeroconf) looks to have been changed and improved in the Home Assistant 2022.02 release:
https://github.com/home-assistant/core/pull/62133
https://www.home-assistant.io/integrations/zeroconf/
This change is only a concern for custom integration developers.
Currently zeroconf matching only allows matching the macaddress
, model
, and manufacturer
properties along with the name from the ZeroconfServiceInfo.
Since properties are arbitrarily defined by the zeroconf service, the list of named properties has grown over time.
Matching now allows for any arbitrarily defined property. All property matches must be lowercase, wildcards are supported
The top level keys model
, manufacturer
, and macaddress
are now deprecated from components manifest.json
file and should be moved into a properties
dict.
For example:
- {"type":"_airplay._tcp.local.","model":"appletv*"}
+ {"type":"_airplay._tcp.local.","properties":{"model":"appletv*"}}
By the way, Home Assistant founders/leads now explicitly said this year they will prioritize focus on features like these types:
https://www.home-assistant.io/blog/2022/01/19/streamlining-experiences/
Check out this video at around 11 min 55 sec in where talk about that focus point about making it easier to get started, etc.
https://www.youtube.com/watch?v=t_2D_KoFIfU&t=710s
Hopefully, it should be a greater chance of getting more help from other Home Assistant developers with this if ask them.
@fairecasoimeme as per https://github.com/fairecasoimeme/ZiGate-Ethernet/issues/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):
https://github.com/xyzroe/ZigStarGW-FW/issues/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: