I installed tasmota on two esp32 to monitor energy consumption of two electric terminals (with pzem).
Everything is working well in the web terminal of both devices and I can read the measurements.
Now after configuring mqtt on home assistant, the two devices were discovered successfully, however sensors are keeping constantly reloading and being unavailable! I made a gif of this behavior, very weird…
Thank you for helping and for your quick answer, I’ll start by taking a look into your suggestions.
I noticed now after taking one of them off the grid, that the remaining one is working correctly without interruptions.
Yes they do. The http api terminal is working on both.
When both are connected to the grid, i remember seeing in the console of tasmota “mqt : retained”.
In the log of the mqtt broker, i have this :
2025-07-01 23:15:19: New connection from 192.168.188.100:52765 on port 1883.
2025-07-01 23:15:19: Client core-mosquitto already connected, closing old connection.
2025-07-01 23:15:19: New client connected from 192.168.188.100:52765 as core-mosquitto (p2, c1, k30, u'mqtt').
2025-07-01 23:15:20: New connection from 192.168.188.101:64242 on port 1883.
2025-07-01 23:15:20: Client core-mosquitto already connected, closing old connection.
2025-07-01 23:15:20: New client connected from 192.168.188.101:64242 as core-mosquitto (p2, c1, k30, u'mqtt').
2025-07-01 23:15:20: New connection
I think the client is a name you give the client ( the tasmota device ) so you can recognize it in error logs and such. It probably pops into HA as well as the entity.
They should be unique…
So the client connects, sends the data, then a new client with the same name different IP connects, drops the old connection, then it does it again… and again…