-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[REQUEST] Zeroconf support to ZigStar LAN Gateway for Home Assistant ZHA network discovery #2
Comments
Work is done on this, but having small trouble submitting this to HA Repo. |
@mercenaruss Sorry for the delay, I have now posted a reply to https://community.home-assistant.io/t/zha-automatic-network-discovery-of-zigbee-coordinator-bridges-gateways-ethernet-wifi-network-adapters-that-support-zeroconf/293300 As I understand, if your Zeroconf and DNS TXT Records if correct then think you should only need to extend code in these two files: 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 The DNS server in your network router of course needs to support/enable mDNS (multicast DNS) so .local names can be used. |
FYI, Zero-configuration networking (zeroconf) looks to have been changed and improved in the Home Assistant 2022.02 release: https://www.home-assistant.io/integrations/zeroconf/ This change is only a concern for custom integration developers. Currently zeroconf matching only allows matching the 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 For example:
|
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. |
FYI, PR home-assistant/core#58224 for Home Assistant core has been closed since cannot test it myself to confirm working or not. It would be more than welcomed if anyone (who owns a ZigStar LAN Gateway) could take over to get zeroconf discovery in ZHA. https://www.home-assistant.io/integrations/zha#discovery-via-usb-or-zeroconf Again, other than Tube's Zigbee Gateways you can also checkout syssi's and thegroove's implementations as proof-of-concept: https://github.com/syssi/esphome-zb-gw03 |
FYI, for reference, noticed that fairecasoimeme from ZiGate is working on PR for Home Assistant to add ZiGate discovery support: See -> home-assistant/core#68577 ("Add ZiGate device on automatic integration USB and ZEROCONF") It will add automatic ZeroConf (MDNS) discovery of ZiGate Ethernet Gateway (not WiFi Gateway), as well as ZiGate USB adapters. https://www.home-assistant.io/integrations/zha#discovery-via-usb-or-zeroconf As you can see in PR, ZHA and Home Assistant developers are assisting fairecasoimeme from ZiGate once PR was submitted. Hopefully, it should be a greater chance of getting more help from other Home Assistant developers with this if you submit a PR. |
FYI, PR for ZiGate's Zeroconf has been merged in Home Assistant core making it an example for adding additional more readable: https://github.com/home-assistant/core/blob/dev/homeassistant/components/zha/manifest.json#L85-L88 https://github.com/home-assistant/core/blob/dev/tests/components/zha/test_config_flow.py#L80-L107 https://github.com/home-assistant/core/blob/dev/homeassistant/generated/zeroconf.py#L384-L389 |
@Hedda Zeroconf tested & PR submitted. |
Please consider adding Zeroconf DNS TXT Records parameters in firmware for automatic ZHA network discovery but only enable it when running in "Zigbee Home Automation Mode".
Home Assistant OS (formerly HASSIO) support automatic network scanning and “Service Discovery” via Zeroconf and when a whitelisted Zigbee serial gateway is discovered it can pass along that to a domain like the ZHA integration component in Home Assistant.
For more context about this Zigbee gateway “Service Discovery” via Zeroconf for the ZHA integration in Home Assistant, pease see:
https://community.home-assistant.io/t/zha-automatic-discovery-of-zigbee-coordinator-bridges-gateways-ethernet-wifi-network-devices-that-support-zeroconf-or-ssdp/293300
and
https://developers.home-assistant.io/docs/creating_integration_manifest/#zeroconf
FYI, there is already a working proof-of-concept this is now supported by Tube's Zigbee gateways (based on ESPHome firmware):
https://www.home-assistant.io/integrations/zha#discovery-via-usb-or-zeroconf
https://github.com/tube0013/tube_gateways
Once support for Zeroconf has been added to the firmware you also need the firmware to provide DNS TXT records for passing along setting parameters to integration config flows.
You first need to add Zeroconf service and give it name and as well as adding information about protocol (tcp) and port (????), etc.
Then DNS TXT records is used to pass along recommended settings parameters config flow to Home Assistant's ZHA integration:
I believe that is advertised for Zeroconf config in this format or similar:
(use e.g. avahi-browse -r -a to see this)
As can see, you will need one DNS TXT Record for each attribute and value that is to be passed along to HA's ZHA integration.
Zeroconf DNS TXT records could also be used to pass along info about hostname, versions, location, MAC address, and more, etc..
http://www.zeroconf.org/Rendezvous/txtrecords.html
https://en.wikipedia.org/wiki/Zero-configuration_networking#DNS-based_service_discovery
https://en.wikipedia.org/wiki/TXT_record
More information about idea of using DNS TXT records for passing along setting parameters in https://github.com/thegroove/esphome-zbbridge#1 and https://github.com/thegroove/esphome-zha-ezsp-zeroconf
In the end it is probably best to see actual example config for ESPHome as in Tube's Zigbee Gateway as that is the reference:
https://github.com/tube0013/tube_gateways/blob/main/V2_tube_zb_gw_cc2752p2/ESPHome/tube_zb_gw_cc2652p2v2.yml
Again, support for Tube's Zigbee Gateway was initially added to Home Aassistant core for ZHA support in home-assistant/core#48420
As I believe to then whitelist Zeroconf for more gateways and/or radio types in HA's zeroconf as well as for ZHA need to do PR for:
https://github.com/home-assistant/core/blob/dev/homeassistant/generated/zeroconf.py
and
https://github.com/home-assistant/core/blob/dev/homeassistant/components/zha/manifest.json
and
https://github.com/home-assistant/core/blob/dev/homeassistant/components/zha/config_flow.py
The text was updated successfully, but these errors were encountered: