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
Add entity registry support to ecobee integration #27088
Add entity registry support to ecobee integration #27088
Conversation
Add unique id for binary sensor, climate, and sensor.
"""Return a unique identifier for this sensor.""" | ||
for sensor in self.data.ecobee.get_remote_sensors(self.index): | ||
if sensor["name"] == self.sensor_name: | ||
if "code" in sensor: |
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.
https://www.ecobee.com/home/developer/api/documentation/v1/objects/RemoteSensor.shtml
id
seems to always be unique. Any reason why you would prefer code
over id
?
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.
id
seems to be unique based to the particular thermostat installation, and seems to be assigned sequentially based on when the sensor is added to the thermostat. code
is printed on the actual sensor itself, so appears to be a better unique_id since the sensor could be paired to a different/new thermostat but would still identify itself to Home Assistant by its own unique identifier.
Sensors that do not have the 'code' property are built into the thermostat itself. Now that I think about it, in that case it actually may be better to use the thermostat's serial number suffixed with the device class ("-occupancy", "-humidity", or "-temperature") as a truly unique id that won't change based on the installation.
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.
Thinking about this further, I think it is best to use id
for those sensors that are built into the thermostat - given that they are built in I think that the id assigned remains constant so it is a good unique identifier. My stance on using code
for the remote sensors remains the same.
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.
ok!
Thanks ! |
Description:
Add the unique_id property to binary sensor, climate, sensor and weather platforms to add support for the entity registry.
Related issue (if applicable): N/A
Pull request with documentation for home-assistant.io (if applicable): N/A
Example entry for
configuration.yaml
(if applicable):N/A
Checklist:
tox
. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
python3 -m script.hassfest
.requirements_all.txt
by runningpython3 -m script.gen_requirements_all
..coveragerc
.If the code does not interact with devices: