Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[REQUEST] Send unique device identifier + project info via Zeroconf for mDNS discovery #2

Open
Hedda opened this issue May 19, 2021 · 2 comments

Comments

@Hedda
Copy link

Hedda commented May 19, 2021

Request ESPHome to send out unique device ID on its Zeroconf broadcast like example project name + the MAC address of device.

Copy of old request esphome/feature-requests#575

@thegroove
Copy link
Owner

As Frenck mentioned in the linked feature request, ESPHome now adds the mac address in its zeroconf announcement:

= enp7s0 IPv4 tube_zb_gw_cc2652p2                           _esphomelib._tcp     local
   hostname = [tube_zb_gw_cc2652p2.local]
   address = [172.16.0.98]
   port = [6053]
   txt = ["version=1.17.0" "address=tube_zb_gw_cc2652p2.local" "mac=aaaa1234nnnn999"]

This is new functionality, starting from 1.17.0, I think. However, this applies to the esphomelib service announcement (which is separate and not configurable by my component). It is just a txt attribute, though, so adding some sort of ID field is already possible through configuration.
What is not possible right now, however, is templating the value of a txt attribute. The mac address can be obtained programmatically in esphome, with a lambda snippet, but I need to figure out how to add templatability to those in my component, so it can be used to dynamically fill a txt attribute value -- work in progress. In the meantime one can manually enter the mac, but of course that's boring.

@Hedda
Copy link
Author

Hedda commented Jun 18, 2021

FYI, HA devs announced latest ESPHome added the new standard for project identifier, version + more via the mDNS discovery info:

https://www.home-assistant.io/blog/2021/06/16/power-up-your-esp-projects/#esphome-embracing-projects

ESPHome: embracing projects

We want to make it easy for creators to sell ESPHome powered products that offer a great user experience. ESPHome projects embrace local control and integrate nicely with Home Assistant, and so each extra ESPHome product that our users can buy is a win.

To make it easier to keep creators and users connected once a product is installed, projects can now add a project identifier and version to their firmware (docs). With today’s release this information will be available in the device information, logging output and the mDNS discovery info.

The goal is to integrate the projects tighter into the ESPHome dashboard by showing the project’s logo, link to the documentation and issue pages and allow installing updates.

https://www.esphome.io/components/esphome.html#project-information

Project information

"This allows creators to add the project name and version to the compiled code. It is currently only exposed via the logger, mDNS and the device_info response via the native API. The format of the name should be author_name.project_name."

# Example configuration
esphome:
  ...
  project:
    name: "tube0013.tube_zb_gw_cc2652p2"
    version: "1.0.0"

PS: This was part of a larger article about making ESP firmware and project more user-friendly and easier to get started with:

https://www.home-assistant.io/blog/2021/06/16/power-up-your-esp-projects/

@Hedda Hedda changed the title [REQUEST] Send unique device ID via zeroconf [REQUEST] Send unique device identifier + project info via Zeroconf for mDNS discovery Jun 18, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants