-
Notifications
You must be signed in to change notification settings - Fork 142
Home Assistant MQTT Sensor discovery enhancements, areas support. #102
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, what is this used for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is necessary info for HA Device registry so Miflora Device is created upon HA MQTT discovery with its device connection (BTLE MAC address) and then all sensors like temperature, lux, moisture etc. are linked with this new device and identified with by theirs unique_id (btle_mac-temperature, btle_mac-light, ....). Details: https://www.home-assistant.io/integrations/sensor.mqtt/. There is also ha-core github discussion with mqtt json example: home-assistant/core#16943 (comment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry. Of course I'm aware of the device discovery feature :) I was asking about the
identifiersspecifically. Documentation saysBut would you by any chance know what it is actually used for? I wonder whether or not more than one element per sensor would make sense... just curious :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are talking about unique_id: it is necessary to be unique for each entity(=sensor) - probably some unique index in device registry db/table. Each entity with unique_id must be then linked by 'device' section with its physical device (control unit with multiple sensors). If you look into new miflora the MQTT topic, then each sensor (temperature, lux, moisture, conductivity, battery) has different unique_id, but same parent device. That is how relationship is defined and HA know the connections.
Details:
https://developers.home-assistant.io/docs/device_registry_index/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
regarding multiple Identifiers - don't know why there should be more than one unique identifiers... can't think of some use case when you would need more identifiers. But I'm not a HA guru... :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope me neither. Maybe something for a later point. Feels like this whole concept of devices becomes more and more important in HA