Esp8266 keeps disconnecting from MQTT server

I am very new to HA but love it!.. so bare with me.

I have 2 esp8266-01 connected to different relays so I can control lights remotely. I have set up HA and mosquito as my mqtt broker and it works great when I only have one esp8266 turned on. But a soon is turn on the second one, the first one disconnect -> tries to reconnect -> connects -> and kicks the second one off. When this starts to happen they both become unresponsive to HA and not turn the relay on or off. As soon as I unplug 1 of them, the other works great.

This is what I have in configuration.yaml

mqtt:
 broker: localhost
 port: 1883

light:
 platform: mqtt
 name: "Pond Lights"
 command_topic: "ha/outdoor/pond"
 payload_on: "1"
 payload_off: "0"

light:
 platform: mqtt
 name; "Driveway Lights"
 command_topic: "ha/outdoor/drive"
 payload_on: "1"
 payload_off: "0"

Let me Know if you need any other information.
Thanks for you help in advance!

I’m guessing…both devices uses the same client ID to connect to the MQTT broker.

1 Like

Changing the Client ID worked.

Thank You fabaff for you help!