Skip to content
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

Device does not work if entity id is changed #298

Open
trehan86 opened this issue Nov 25, 2024 · 5 comments
Open

Device does not work if entity id is changed #298

trehan86 opened this issue Nov 25, 2024 · 5 comments

Comments

@trehan86
Copy link

Hi,

I am not sure if someone else is experiencing this but when I bring any device to HA from Hubitat, if I change the Entity Id, the device stops working in HA. I then have to delete the device in HA and add to HA again to make it work. However, the Entity ID cannot be change else the device will stop working again.

@jason0x43
Copy link
Owner

What do you mean by the device stops working? Does the device stop responding to commands from HA, or does the device in HA stop updating to show the real device state?

@trehan86
Copy link
Author

What do you mean by the device stops working? Does the device stop responding to commands from HA, or does the device in HA stop updating to show the real device state?

Once I change the entity id, I cannot operate the device from HA. Also when I operate the device in hubitat, the status does not update in HA.

@jason0x43
Copy link
Owner

Hmm... How are you changing the entity ID, and how are you trying to operate the device? I just tried this locally, by renaming the control entity for a virtual fan from fan.virtual_fan to fan.virtual_fantastic. After renaming the entity, the fan speed control still works, and the entity maintains its new ID and continues to function after restarting HA.

2024-11-26 22 02 50

Is the problem only occurring after you update the entity name, or do Hubitat devices simply stop updating in HA shortly after HA starts up?

Try enabling debug logging and see if any errors are reported when you update the entity's ID, or when you try to control the entity after updating its ID.

@trehan86
Copy link
Author

I tried again and seems like the switch works fine even when I change the entity id. The issue seems to be with sensors only. I tried with contact sensor as well as motion sensor and device stops to update status in HA when I change the entity ID.

ezgif-7-d42451d6d3

I found below issue in the log. I created a new sensor to make sure that the entity is unique and new for the first time. However, it gives me below error saying that new entity is already in use. I tried

  1. removed device from HA and API maker
  2. changed name in hubitat
  3. added again to HA
  4. change the entity ID and below error shows for the new device when I change the entity ID.

2024-11-27 23:35:47.626 WARNING (Recorder) [homeassistant.components.recorder.entity_registry] Cannot migrate history for entity_id binary_sensor.aa_contact_sensor_contact to binary_sensor.aa_contact because the new entity_id is already in use

The above cannot be correct because I have tried changing entity ID to something I know for sure has never been used before. Also, the changing the entity ID back to the original entity ID does not fix the device. The only way to fix the device again is to completely remove from HA and Maker API and then add again.

@trehan86
Copy link
Author

An update. I changed the entity id and it stop working for a motion sensor but I left it as is over night. Seems like the sensor is working fine now next day with the new entity id.

My HA must be doing something that I don’t know how to manage and fix but there is nothing wrong with the integration. Sorry for inconvenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants