Hi all,
I am running Home Assistant on a Raspberry Pi 3, Hassio.
I have the addon Zigbee2mqtt and use the Mosquitto broker. All works perfectly fine and I have now several devices to track and control
When starting, I flashed a cc2531 to test with a router software to play around and I no longer use them due to the limited range. It does however show up on the zigbee2mqtt networkmap:
Is there a way I can remove this device from wherever it is stored?
I tried to find the solution in several places, but have not succeeded (from uninstalling, rebooting and re-installing the mosquitto broker, using MQTT.fx, ).
also tried with mosquitto_pub -h 192.168.1.52 -p 1883 -u myuser -P mypassword -t "zigbee2mqtt/0x00124b00014d2777" -r -n but this doesnĀ“t do anything.
Really have no clue anymoreā¦ My main first doubt: am I using the right topic?
thanks for any insight!
Iām pretty sure that the info for the map comes from the zigbee2mqtt database. So to get rid of that device you need to remove it from the database. To do that you have to issue a remove command in MQTT:
from that page:
zigbee2mqtt/bridge/config/remove
Allows you to remove devices from the network. Payload should be the friendly_name , e.g. 0x00158d0001b79111 . On successful remove a device_removed message is send.
Thanks finity! you gave me the right direction!!!
I donĀ“t know how I can have missed the most basic documentationā¦
I got it removed as you suggested using SSH CLI command : mosquitto_pub -h 192.168.1.52 -u myuser -P mypassword -t zigbee2mqtt/bridge/config/remove -m 0x00124b00014d2777 and the confirmation is seen in the zigbee2mqtt log:
I had the same issue today, since the topic was retained on my broker. However thereās a very useful tool called MQTT Explorer which lets you easily remove retained messages.
Thanks for pointing out to MQTT Explorer. I will have it a spin.
It will stil be nice to have devices being āauto-deletedā like we have with mqtt āauto-discoveryā. Maybe this will come in the futureš¤·
Iām having this issue with a sonoff tasmota device which I added by following the tasmota wiki:
# Example automations.yaml entry
- alias: "Enable MQTT discovery for all devices"
trigger:
platform: homeassistant
event: start
action:
- service: mqtt.publish
data:
topic: "cmnd/sonoffs/SetOption19"
payload: "1"
I had to change the topic to sonoff/cmnd/SetOption19 for it to auto-discover.
However this is a bit misleading as it created a device in HA which is called switch.sonoff and if Iām understanding this correctly If I connected 5 sonoffs and left their topic default it wouldnāt be able to distinguish them so Iām not sure how much use this is? To differentiate I would have to enter a different topic for each one and then edit the configuration.yaml to have this for each? Defeats the object of auto discover but anyway I digressā¦
Iām trying to change the name of this sonoff away from the generic switch.sonoff to the one I have set under Client and Topic in the tasmota GUI. However it still appears as switch.sonoff in HA after deleting and removing every instance I can find. I would rename manually but it has multiple sensors and itās not the point, why doesnāt HA pick up the new client name and topic name?? Iāve tried this to stop it from remembering this name but no luck:
-Removed MQTT from integrations.
-Stopped HASS and removed from core.restore_state. core.entity_registry and core.device_registry doesnāt feature it as it was removed from integrations already.
-Restarted Mosquitto and checked the topic wasnāt kept with MQTT explorer.
So for anyone coming here when itās seems all attempts to remove device from HA has failed: tried remove and force_remove by sending command, tried to remove mqtt integration from HA and restart it, tried to restart/reinstall zigbee2mqtt addon but finally - reinstalled mqtt addon which removed all persistent autodiscovery messages and removed devices are really gone