Open trankillity opened 1 year ago
Same here
I'll look into this. I am not sure the integration gets any notification when the entities changes, but I might be able to run a periodic job to make sure the surce for the DLI is correct.
Same here
me too
Me-toos does not help. You may subscribe to the issue, or even better - create a PR.
I was curious so I looked up how to do this. I think rather than storing the entity ID as provided by the user, you could look up the entity by entity_id and then get and store unique information about it to look up later. Here's a quick example that goes full circle:
er = entity_registry.async_get(hass)
entity = er.async_get('sensor.foobar')
entity_id = ent_reg.async_get_entity_id(entity.domain, entity.platform, entity.unique_id)
So you'd want to look up the entity object via the entity_id supplied by the user and then store domain, platform, and unique_id of the entity. Then when updating the sensor you'd use those 3 values to get the entity_id and then look up the state using that.
If you rename a plant device and accept the rename of the entities associated with it, the
source
attribute of the DLI/mol sensors does not update - resulting in broken sensors.Running the service to reassign the sensors also doesn't appear to work for these entity types as I believe that's updating the
external_sensor
attribute for other sensors.