MQTT device not pulling in data - "Socket error on client sonoff_pow2_01, disconnecting"

I bought some POW R2’s and have them setup as so:

  • platform: mqtt
    name: “Dryer Watts”
    state_topic: “stat/sonoff_pow2_02/STATUS10”
    value_template: ‘{{ value_json.StatusSNS.ENERGY.Power }}’
    unit_of_measurement: ‘W’

  • platform: mqtt
    name: “Dryer Amps”
    state_topic: “stat/sonoff_pow2_02/STATUS10”
    value_template: ‘{{ value_json.StatusSNS.ENERGY.Current }}’
    unit_of_measurement: ‘A’

  • platform: mqtt
    name: “Dryer Volts”
    state_topic: “stat/sonoff_pow2_02/STATUS10”
    value_template: ‘{{ value_json.StatusSNS.ENERGY.Voltage }}’
    unit_of_measurement: ‘V’

However, I keep getting this error in the MQTT broker:

1546657394: New client connected from 192.168.1.217 as sonoff_pow2_01 (c1, k10, u'broker1').

1546657455: Socket error on client sonoff_pow2_01, disconnecting.
1546657455: New connection from 192.168.1.217 on port 1883.

Any ideas? I have several other devices running on MQTT just fine. These are the first POW’s that I bought, but having issues. At one point, I was able to pull in the data just fine - but since then, it’s “unknown” in the front end, and it’s not working. Not sure what config I have wrong, or what’s going on.

In your configuration, it is sonoff_pow2_02.
In the error message, it is sonoff_pow2_01.

I assume the configuration and error message you provided are supposed to be related. However, they refer to different devices. Why?

Sorry - I have 2 POWs that I’ve added. Neither one is providing data into HA. They show up as “unknown”. One is sonoff_po2_01 and other is 02. Config is the same on both.

Well the failure to connect is most likely a mistype of your MQTT credentials.

What firmware are you using on the sonoff?

If you have tasmota or espeasy on sonoff pow check console log on it. Maybe is connection problem. Low wifi signal?

Hi there. I am new to MQTT and Home Assistant. I am trying to setup Internal Broker Mosquito within HA and have followed lots of forums and videos, however I am still getting this message
1555747015: New connection from 192.168.1.100 on port 1883.
1555747015: Socket error on client , disconnecting.

I do not know what it is referring too or what the “Socket error on Client” is
I have removed a Sonoff Device from Configurator File to hopefully start from scratch again
I have added the following to Mosquito
{
“logins”: [],
“anonymous”: true,
“customize”: {
“active”: false,
“folder”: “mosquitto”
},
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”
}
No username or password

I have also added the following to Configurator File

mqtt:
broker: 192.168.x.xx (IP address of Raspberry Pi running HA)

Restarted HA and getting the above message in the Mosquito Log

I am sure it is something simple, however I try to resolve myself but not having any luck sadly
Hope someone can help :smile:

Error, pull up. Read the home-assistant.io documentation, not random (probably out of date) videos and forum posts.

Thanks nickrout, I am reading and looking up lots of documentation and still having problems finding the issues. Thanks for your feedback

I am in the same boat. Running version MQTT Broker 4.2

{
“logins”: [],
“anonymous”: true,
“quiet_logs”: true,
“customize”: {
“active”: false,
“folder”: “mosquitto”
},
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”
}

Did the same in the configuration.yaml file
mqtt:
broker: 192.168.x.xx (IP address of Raspberry Pi running HA 0.9.21)

Getting in the MQTT logs:
1556755281: New client connected from 192.168.4.28 as 1aab49ee-2000-4dfb-b739-e05706d0f657 (c1, k60).
1556755282: New connection from 192.168.4.80 on port 1883.
1556755284: Socket error on client , disconnecting.

Getting sometime the name of the client to show in the logs in stead of unknown but is the same ip address.
Any tip would be appreciated. Could this be a wifi issue from the client?

I was able to fix this by rolling back to MQTT 4. :wink:

Hi,
can you please help how to downgrade from MQTT 5 to 4.xx ?
Because I have the same issue as you had.

Thank you.