Tearing my hear out...how do I get MQTT to refresh node info?

I’m using mosquitto + zwave2mqtt for my z-wave devices, but I’m having an issue with autodiscovery in HA. When I first bring a device into zwave2mqtt, it’s given some generic parameters like node_id_9_x, which HA immediately picks up and adds as the appropriate entities. However, I rename the device and location in zwave2mqtt so I actually know what is what. When I do that, it seems like HA picks up on the new device name, but the actual entities within that device are still using the old name, and subsequently I lose control of those entities (like switch on/off state) because HA is publishing the wrong message.

I’ve tried restarting HA, zwave2mqtt, and mosquitto in various orders, but I haven’t found any consistent way to get HA on the same page as everyone else; it just seems like I fiddle with all the different components for a while and suddenly it works. Is there some way to force HA to refresh the MQTT info so I don’t have to screw with this every time I add a new z-wave device?

I don’t know if you got an answer. Here’s what I end up doing that seems to work:

  • include the node
  • set the name in zwave2mqtt
  • click “rediscover node”
  • click “store”
  • go to the MQTT integration in HA and delete whatever devices it might have already discovered. Whether it’s the new name or the old nodeID_xx name
  • restart the home assistant server

Seems like MQTT then discovers the node with the correct name and message topics.

This might be overkill and there may be settings that I have that cause me to have to do this, but it’s how I got 40+ nodes included, renamed, and correct in HA using zwave2mqtt.

Hope this helps.

1 Like

That is very helpful! I didn’t know what “rediscover node” and “store” did in zwave2mqtt but I will use them in the future. It seems like your procedure also gets rid of the need to remove the MQTT integration and re-add it, so it’s better than what I had for sure!