I am using MQTT to integrate my Wallbox (openWB). There has been a major change in the Wallbox software (v1 to v2 changed all MQTT topics) and I wanted to start over with a fresh install on my system and try the alpha MQTT integration for software 2.x
Well, first I installed a new SD card with the new system on my Wallbox (new imagefile, no leftovers in any way from previous installations. At least I thought.
Then I realized that the old integration in HA was still active, so I removed it and edited my mosquitto.conf not to look for these values anymore.
After that, I used MQTT explorer to check, but there were still all topics present. So I deleted al MQTT topics from the wallbox in HA and rebooted. They did not come back and I thought I was finished - wrong…
as soon as I configured my 2.x software on the wallbox, I wanted to reimplement the MQTT readings, so I readded this to my mosquitto.conf
connection openwb
address 192.168.0.181:1883 # IP der openWB
start_type automatic
topic openWB/# both 2
local_clientid openwb.mosquitto
try_private false
cleansession true
After a restart of Mosquitto, it started publishing all the leftover 1.x values immediately again, and what is worst - it messes up my configuration of the Wallbox as it writes values to its configuration via MQTT.
I need help to get rid of these leftover values permanently…
Your broker has undelivered retained messages. Here’s how you can deal with it.
Send a null message to the topics that you want to remove the retained messages from.
Delete the persistence file. If your broker is on a Linux computer, deleting the persistence file can be easily done with just a few commands:
sudo service mosquitto stop
sudo rm /var/lib/mosquitto/mosquitto.db
sudo service mosquitto start
after that, all of the retained messages should be removed and mosquitto will begin to build a new persistence file for the current retained MQTT messages.
Your help is very appreciated. What I did was to delete all topics with the “retained” marker checked in MQTT explorer. That hasnt done the trick, obviously.
Delete the topics with retained messages in MQTT Explorer.
Restart MQTT Explorer.
If the deleted topics aren’t visible, then they’re truly gone. The topics will only come back if some client publishes another retained message to them.
On the other hand, if after restarting MQTT Explorer the deleted topics immediately re-appear then it didn’t work correctly.
Got it. The problem was, that the openWB well accepts some MQTT configuration messages from HA (and then replays them), but they cannot be deleted from there.
So everytime I switched the Wallbox back on, I ended up with the entities coming back to HA.
So: Wallbox off, get rid of all values in HA/Mosquitto, restart Wallbox with a fresh installation from SD card. Done.