Zigbee2MqttAssistant
                                
                                
                                
                                    Zigbee2MqttAssistant copied to clipboard
                            
                            
                            
                        [BUG] renaming devices causes out of sync
I have renamed two of my devices using the assistant, then restarted the computer hosting the docker container. After the host reboot renamed devices are duplicated. Those that have been renamed are showing "NO COMPONENTS Maybe this device is not (yet) supported by Zigbee2Mqtt?" Some new devices entries are shown with the original friendly name (like before renaming)
To Reproduce
Steps to reproduce the behavior:
- rename some devices
 - reboot the docker host
 - see duplicated devices
 
Screenshots
Installation
- Version of Zigbee2Mqtt: 1.7.1
 - Version of Zigbee2MqttAssistant: 0.3.105 (0.3.105+Branch.master.Sha.b1c45d4ca947b2701c12bdf7d0e8be4083a0a2fe)
 - Installation type (HASS.IO, Docker...): Docker
 

Same issue here.
Since Zigbee2Mqtt won't publish new Home Assistant Discovery topics for the renamed device. You need to reboot Z2M for that (I think this problem was never reports to Z2M).
Since Z2MA is using HA discovery topics for components, it's creating a fantom device with the old name.
The best way to fix this is to reboot Z2M.
I'm also having this issue. I'm pretty sure that i did restart the Zigbee2Mqtt container after renaming the devices. I did this last night. Today during the day the fantom devices got added. I do see a pattern in that i renamed these devices and restarted the Zigbee2Mqtt & Zigbee2MqttAssistant containers after initiating the rename. I did it this way as i kept having trouble adding these devices to Z2M. I now remember what i did: i renamed the friendly_name of a newly discovered devices by manually editing the configuration.yaml file and then triggering a restart of the containers. If i look into the configuration.yaml file, i only see th devices with a correct friendly-name. I don't see additional incorrect fantom-devices in this yaml file. In the state.yaml file i see the fantom-devices added as the last few entries with only linkquality and last_seen attributes. I'm pretty sure it has got something to do with the configuration.yaml, state.json and database.db being out-of-sync.
I think it's more a Z2M bug :-)
Yes, you're right.. These are indeed Z2M configuration files. Thus it probably is more a Z2M bug.
I have the same problem and I doubt that it's a Z2M bug. :see_no_evil: I've restarted Z2M and Z2MA and the phantom devices stay in my list: :thinking:

Even if it's a Z2M bug, an issue should be opened for it there...
@GrumpyMeow would you mind sharing your config files (configuration.yaml, state.json, database.db, possibly devices.yaml) here or at least the relevant parts of them indicating the out-of-sync state? I checked mine and they seem to be fine/sync.
Can someone having this issue try to reboot the host to see if it gets rid of phantom devices?
I have rebooted Mosquitto Server and Z2MA but having the same phantom devices...
Yeah, I also rebooted virtually everything but it happens again. They appear and go away for no reason but most of the time, there are phantom devices listed. 😕
same issue
Same issue!
I delete old devices topics on mqtt and restart z2massistant, Blank devices disappear.