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

Use resource ID as unique id. #8

Merged

Conversation

danielrheinbay
Copy link
Contributor

Fixes the unique_id to meet Home Assistant requirements:
https://developers.home-assistant.io/docs/entity_registry_index/#unique-id

An entity is looked up in the registry based on a combination of the platform type (e.g., light), and the integration name (domain) (e.g. hue) and the unique ID of the entity. Entities should not include the domain (e.g., your_integration) and platform type (e.g., light) in their Unique ID as the system already accounts for these identifiers.

Unfortunately, this change is not backwards-compatible: after updating, your pixometer sensors will show up as new sensors since they will have a new unique_id.

However, the current implementation would generate new IDs when changing a pixometer sensor's location, which does not meet Home Assistant requirements for unique_ids.

@myTselection myTselection merged commit cd9c1e4 into myTselection:master Jun 15, 2023
@danielrheinbay danielrheinbay deleted the use-resource-id-as-unique-id branch June 15, 2023 10:10
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants