Hello,
I’m restructuring my Openhab-Network including Nous-Zigbee-switches.
Configuration is : Openhab 5.0.3 with zigbee2MQTT and mosquitto
The first experimental configuration worked fine and without problems.
Then I decided to implement a new configuration with new Device-names/UIDs.
Zigbee2MQTT still works fine with the rediscovered devices and I’m able to switch power with the zigbee2MQTT-GUI.
I’m also able to add the switches as new things from the Inbox in Openhab, but I’m not able to switch power from Openhab. Instead I can see the error messages
debug: z2m:mqtt: Received MQTT message on ‘zigbee2mqtt/Tuya-Switch-3_0xa4c1380993d3d455/set’ with data ‘OFF’
error: z2m: Entity ‘Tuya-Switch-3_0xa4c1380993d3d455’ is unknown
debug: z2m:mqtt: Received MQTT message on ‘zigbee2mqtt/Tuya-Switch-3_0xa4c1380993d3d455/set’ with data ‘ON’
error: z2m: Entity ‘Tuya-Switch-3_0xa4c1380993d3d455’ is unknown
“Tuya-Switch-3” is the old identifier which I had added previously to the UID. Openhab is using the old names as MQTT-topics has obviously not replaced them by the new ones!
Does anybody know how to proceed correctly:
can I delete this kind of old informations in Openhab?? Deleting the things doesn’t help.
can I advise Openhab to take the new modified names from Zigbee2MQTT-discovery?
then I created the the same thing with another name from Inbox
then I created an equipment from this thing with all its channels selected
in the model I navigate to the new equipment, toggle it and then always receive this error
So maybe this procedure was not ok due to my poor knowledge. I thought that with the removal of the thing all sub-objects like (orphaned?) links to it were also gone and that they are recreated with the creation of the equipment.
In the Inbox the Nous-switches appeared with their old name ( not with the new name visible in zigbee2MQTT !!) but to be consistenI with zigbee2MQTT I replaced the the name with same name as in zigbee2MQTT.
I can’t see any parameter in the channels and links which shows the old name of the thing and I don’t know where to look for it.
Do you have a link to a description of how to procede in this case with removing things and links and recreate them?
Thanks for your help
With development utilities I’ve dumped the thing definitions and extracted the relevant part:
the label of my switch has the same new user friendly name as the zigbee2MQTT-object,
but there is also a config section (which is otherwise hidden in the GUI?) which show the old previous name “Tuya-Switch-3” (e.g. object_id, command_topic,…).
Since toggle with zigbee2MQTT works fine, I suppose that these old data are stored in Openhab???
———————————————————————————————-
mqtt:homeassistant:f58b8fb22f:zigbee2mqtt_5F0xa4c1380993d3d455:
bridge: mqtt:broker:f58b8fb22f
label: NEW USER_FRIENDLY_NAME_0xa4c1380993d3d455
config:
topics:
When you removed the old Thing did you remove the links to the Items? Did you remove the Items?
Those options are on the Channels tab. If you are not going to recreate the Thing with the same UID it’s best to remove at least the Links. Sometimes it makes sense to remove the Items too.
If you didn’t remove the old links and Items, they are still around, possibly being used by your rules, sitemaps, MainUI, etc.
There are lots of reasons one might remove a Thing and not all of them would it be desired to remove the Links and Items too. That’s why it’s a separate step.
A Thing doesn’t really have a “name”. Do you mean the UID or the label?
At this point you need to find the old Equipment and the Items under that and delete those Items. The Health system should pick up the orphaned links and when you go to the settings page eventually it will pop up with a warning about some health problems and let you remove the orphaned links.
Everything OH gets with the new Thing comes from the messages posted to the MQTT topics . So if it’s there that means zigbee2mqtt published that information.
I think I’ve solved my problem with the help of the MQTT-Explorer and by tracing mqtt-messages
by
deleting everything I could find in Openhab (links, items,…) related to my switches
cleaning the openhab cache
deleting the mosquitto-database
restarting all openhab/zigbee2mqtt/mosquitto-services
I’m not sure but I think that all these steps are necessary because otherwise the old thing-names are still around somewhere in a database or cache.
To beginners like me it’s a little bit annoying that you are allowed to rename objects and thereby destroy the communication because the old name are kept in some places under the surface and are still essential for communication. It’s also confusing that you have lots of names, labels, ids and . object_ids. Maybe they are only relevant to the developer and should not be visible in the GUI?