Removing Ghost MQTT devices

How do you remove a ghost MQTT device?

I have devices that re auto discovered even if all the devices are switched off.

Please could someone give me some guidance?

Possibly due to the retain flag being used when they were originally setup. You can send an empty message to the mqtt topic to get rid of any old retain messages.

mosquitto_pub -h hostname -t the/topic -u username -P password -n -r -d

You can send that from another computer to the HA instance.

1 Like

Hi jchasey

I tried publishing the command but dont think my syntax is correct. Please could you check my syntax?

-h 192.168.42.1 -t switch.braai -u User -P 1234 -n -r -d

That looks ok, but slashes ‘/’ tend to be used in topics, so it may be switch/braai ?

You can go to the Developer Tools tab, and then select MQTT and use the ‘Listen to a topic’ function. Insert a # and it should list all topics.

I went to Developers tools tab but dont see any option to select mqtt. I have sates, services, logs, template, event and info as options

MQTT Explorer.

I used MQTT FX and found the following.

Lets say i wanted to remove the braai device from the inergrations what would I publish?

/c
/g
/status
/v
Bedroom1/tele/LWT
bedroom/tele/LWT
braai/stat/SWITCH1
braai/tele/HASS_STATE
braai/tele/LWT
braai/tele/SENSOR
braai/tele/STATE
garden/tele/LWT
homeassistant/binary_sensor/7AA177_SW_1/config
homeassistant/binary_sensor/81DE0C_SW_1/config
homeassistant/binary_sensor/B7310B_SW_1/config
homeassistant/light/2B2CD9_LI_1/config
homeassistant/sensor/2B2CD9_status/config
homeassistant/sensor/2B4866_status/config
homeassistant/sensor/7AA177_status/config
homeassistant/sensor/81DE0C_status/config
homeassistant/sensor/B7310B_status/config
homeassistant/sensor/D33F64_status/config
homeassistant/sensor/FAF3CB_status/config
homeassistant/switch/2B4866_RL_1/config
homeassistant/switch/2B4866_RL_2/config
homeassistant/switch/2B4866_RL_3/config
homeassistant/switch/2B4866_RL_4/config
homeassistant/switch/2B4866_RL_5/config
homeassistant/switch/2B4866_RL_6/config
homeassistant/switch/2B4866_RL_7/config
homeassistant/switch/7AA177_RL_1/config
homeassistant/switch/81DE0C_RL_1/config
homeassistant/switch/B7310B_RL_1/config
homeassistant/switch/D33F64_RL_1/config
homeassistant/switch/D33F64_RL_2/config
homeassistant/switch/D33F64_RL_3/config
homeassistant/switch/D33F64_RL_4/config
homeassistant/switch/D33F64_RL_5/config
homeassistant/switch/D33F64_RL_6/config
homeassistant/switch/D33F64_RL_7/config
homeassistant/switch/FAF3CB_RL_1/config
homeassistant/switch/FAF3CB_RL_2/config
homeassistant/switch/FAF3CB_RL_3/config
homeassistant/switch/FAF3CB_RL_4/config
homeassistant/switch/FAF3CB_RL_5/config
homeassistant/switch/FAF3CB_RL_6/config
homeassistant/switch/FAF3CB_RL_7/config
livingroom/cmnd/POWER
livingroom/stat/POWER
livingroom/stat/RESULT
livingroom/stat/SWITCH1
livingroom/tele/HASS_STATE
livingroom/tele/LWT
livingroom/tele/SENSOR
livingroom/tele/STATE
passage/stat/RESULT
passage/stat/SWITCH1
passage/tele/HASS_STATE
passage/tele/LWT
passage/tele/SENSOR
passage/tele/STATE
smartlight1/tele/LWT
smartlight3/tele/LWT
stat/braai/PIR1
stat/braai/PIRBraai
stat/livingroom/PIR1
stat/livingroom/PIRLivingroom
stat/passage/PIR1
tasmota/tele/LWT
wled/sml1/c
wled/sml1/g
wled/sml1/status
wled/sml1/v

Try MQTT Explorer and you get the option to delete from a GUI.

1 Like

WOOOOO…give them “flamingm0e” a BELLS!!! You rock. That make life soooo much easier. Was just about to reload HA. Tried MQTT Explorer as a last option.

Youre a legend. Thanks Flamingm0e

1 Like

I have the same problem. Which entry in the MQTT Explorer do I have to delete?

Hi mimk97

I deleted all the entries in MQTT Explorer. All the intergrations lin home assistant repopulated automatically after restarting Home Assistant. Only problem I had was with the automations that I had to enter the device in the action field.

Yeah, but if i want to delete only one Unit which Entry must deleted?

Just delete all the entries that point to that device

Just to be sure.
I have a Tasmota Switch, called std1 in Entity´s.
Now in MQTT Explorer i have an Entry std1. see picture
Do I only have to delete the entry std1 or other entries under the point “homeassistant”?

Delete the whole entry for std1

If your Tasmota device is set to automatically detect then HA will rediscover the device correctly after deleteting any entries for std1.

I promise you, you cant break home assistant using MQTT explorer. MQTT will rediscover any deleted intergrations

1 Like

Thanks, I´ll try this :slight_smile:

Now i´ve deleted std1 Entry.
But the Device is still in HA. And std1 is not Wall plugged

Delete the std1 device from integration. Then remove the entries in MQTT explorer. Restart HA and if the std1 device has automatic detection enabled (if not set as a switch) then it will be rediscover not as a switch

i can´t delete a Device in Integrations–>MQTT broker?