I'm using mosquitto as mqtt broker on hass.io. i refered to troubleshoot and it suggested there be two devices with same client ID, however, I'm pretty sure there is only one sonoff connected and the client id is unique, yet the two clients are with different "keepalive"s, respectively 15 and 60. any help is appreciated!
configuration.yaml:
mqtt:
broker: 192.168.1.154
port: 1883
client_id: Sonoff_modified_on_3_20_2018
keepalive: 60
username: sonoff
password: sonoffpwd
protocol: 3.1
birth_message:
topic: "tele/hass/LWT"
payload: "Online"
qos: 1
retain: true
will_message:
topic: "tele/hass/LWT"
payload: "Offline"
qos: 1
retain: true
light:
- platform: mqtt
name: "Sonoff Switch 01"
state_topic: "stat/sonoff/POWER"
command_topic: "cmnd/sonoff/POWER"
availability_topic: "tele/sonoff/LWT"
qos: 1
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
retain: true
mqtt log:
starting version 3.2.2
1521956842: mosquitto version 1.4.12 (build date 2017-06-01 13:03:48+0000) starting
1521956842: Config loaded from /etc/mosquitto.conf.
1521956842: Opening ipv4 listen socket on port 1883.
1521956842: Opening ipv6 listen socket on port 1883.
1521956842: Warning: Mosquitto should not be run as root/administrator.
1521956858: New connection from 192.168.1.113 on port 1883.
1521956858: New client connected from 192.168.1.113 as Sonoff_modified_on_3_20_2018 (c1, k15, u'sonoff').
1521956870: New connection from 192.168.1.113 on port 1883.
1521956870: Client Sonoff_modified_on_3_20_2018 already connected, closing old connection.
1521956870: Client Sonoff_modified_on_3_20_2018 disconnected.
1521956870: New client connected from 192.168.1.113 as Sonoff_modified_on_3_20_2018 (c1, k15, u'sonoff').
1521956876: New connection from 192.168.1.154 on port 1883.
1521956877: Socket error on client, disconnecting.
1521956877: New connection from 192.168.1.154 on port 1883.
1521956877: Client Sonoff_modified_on_3_20_2018 already connected, closing old connection.
1521956877: Client Sonoff_modified_on_3_20_2018 disconnected.
1521956877: New client connected from 192.168.1.154 as Sonoff_modified_on_3_20_2018 (c1, k60, u'sonoff').
1521956878: New connection from 192.168.1.113 on port 1883.
1521956878: Client Sonoff_modified_on_3_20_2018 already connected, closing old connection.
1521956878: Client Sonoff_modified_on_3_20_2018 disconnected.
1521956878: New client connected from 192.168.1.113 as Sonoff_modified_on_3_20_2018 (c1, k15, u'sonoff').
1521956878: New connection from 192.168.1.154 on port 1883.
1521956879: Socket error on client, disconnecting.
sonoff log:
06:48:04 MQT: stat/sonoff/POWER = ON
06:48:06 MQT: Attempting connection...
06:48:06 MQT: Connected
06:48:06 MQT: tele/sonoff/LWT = Online (retained)
06:48:06 MQT: cmnd/sonoff/POWER =
06:48:08 MQT: Attempting connection...
06:48:08 MQT: Connected
06:48:08 MQT: tele/sonoff/LWT = Online (retained)
06:48:08 MQT: cmnd/sonoff/POWER =
06:48:08 MQT: stat/sonoff/RESULT = {"POWER":"ON"}
06:48:08 MQT: stat/sonoff/POWER = ON
06:48:10 MQT: Attempting connection...
06:48:10 MQT: Connected
06:48:10 MQT: tele/sonoff/LWT = Online (retained)
06:48:10 MQT: cmnd/sonoff/POWER =
06:48:10 MQT: stat/sonoff/RESULT = {"POWER":"ON"}
06:48:10 MQT: stat/sonoff/POWER = ON
06:48:12 MQT: Attempting connection...
06:48:12 MQT: Connected
06:48:12 MQT: tele/sonoff/LWT = Online (retained)
06:48:12 MQT: cmnd/sonoff/POWER =
06:48:12 MQT: stat/sonoff/RESULT = {"POWER":"ON"}
06:48:12 MQT: stat/sonoff/POWER = ON
06:48:14 MQT: Attempting connection...
06:48:14 MQT: Connected
06:48:14 MQT: tele/sonoff/LWT = Online (retained)
06:48:14 MQT: cmnd/sonoff/POWER =
06:48:14 MQT: stat/sonoff/RESULT = {"POWER":"ON"}
06:48:14 MQT: stat/sonoff/POWER = ON
06:48:16 MQT: Attempting connection...
06:48:16 MQT: Connected
06:48:16 MQT: tele/sonoff/LWT = Online (retained)
06:48:16 MQT: cmnd/sonoff/POWER =
06:48:16 MQT: stat/sonoff/RESULT = {"POWER":"ON"}
06:48:16 MQT: stat/sonoff/POWER = ON
06:48:18 MQT: Attempting connection...
06:48:18 MQT: Connected
06:48:18 MQT: tele/sonoff/LWT = Online (retained)
06:48:18 MQT: cmnd/sonoff/POWER =
06:48:18 MQT: stat/sonoff/RESULT = {"POWER":"ON"}
06:48:18 MQT: stat/sonoff/POWER = ON
06:48:20 MQT: Attempting connection...
06:48:20 MQT: Connected
06:48:20 MQT: tele/sonoff/LWT = Online (retained)
06:48:20 MQT: cmnd/sonoff/POWER =
06:48:20 MQT: stat/sonoff/RESULT = {"POWER":"ON"}
06:48:20 MQT: stat/sonoff/POWER = ON
sonoff info:
Program Version | 5.12.0
-- | --
2018-03-20T15:50:39
2_4_0/2.1.0(deb1901)
0T00:02:26
114 at FA000
55
Power on
Sonoff
Â
DzinYit (100%)
sonoff-5633
192.168.1.113
192.168.1.1
255.255.255.0
192.168.1.1
5C:CF:7F:72:96:01
Â
192.168.1.154
1883
Sonoff_modified_on_3_20_2018
sonoff
sonoff
sonoffs
cmnd/sonoff/
Â
None
Enabled
Web Server
Â
7509505
1327198
1024kB
1024kB
495kB
508kB
20kB
Your Sonoff and your Home Assistant are connecting using same client id.
On Mar 25, 2018, at 07:51, dzinyit notifications@github.com wrote:
I'm using mosquitto as mqtt broker on hass.io. i refered to troubleshoot and it suggested there be two devices with same client ID, however, I'm pretty sure there is only one sonoff connected and the client id is unique, yet the two clients are with different "keepalive"s, respectively 15 and 60. any help is appreciated!
configuration.yaml:
mqtt:
broker: 192.168.1.154
port: 1883
client_id: Sonoff_modified_on_3_20_2018
keepalive: 60
username: sonoff
password: sonoffpwd
protocol: 3.1
birth_message:
topic: "tele/hass/LWT"
payload: "Online"
qos: 1
retain: true
will_message:
topic: "tele/hass/LWT"
payload: "Offline"
qos: 1
retain: true
light:
- platform: mqtt
name: "Sonoff Switch 01"
state_topic: "stat/sonoff/POWER"
command_topic: "cmnd/sonoff/POWER"
availability_topic: "tele/sonoff/LWT"
qos: 1
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
retain: truemqtt log:
starting version 3.2.2
1521956842: mosquitto version 1.4.12 (build date 2017-06-01 13:03:48+0000) starting
1521956842: Config loaded from /etc/mosquitto.conf.
1521956842: Opening ipv4 listen socket on port 1883.
1521956842: Opening ipv6 listen socket on port 1883.
1521956842: Warning: Mosquitto should not be run as root/administrator.
1521956858: New connection from 192.168.1.113 on port 1883.
1521956858: New client connected from 192.168.1.113 as Sonoff_modified_on_3_20_2018 (c1, k15, u'sonoff').
1521956870: New connection from 192.168.1.113 on port 1883.
1521956870: Client Sonoff_modified_on_3_20_2018 already connected, closing old connection.
1521956870: Client Sonoff_modified_on_3_20_2018 disconnected.
1521956870: New client connected from 192.168.1.113 as Sonoff_modified_on_3_20_2018 (c1, k15, u'sonoff').
1521956876: New connection from 192.168.1.154 on port 1883.
1521956877: Socket error on client , disconnecting.
1521956877: New connection from 192.168.1.154 on port 1883.
1521956877: Client Sonoff_modified_on_3_20_2018 already connected, closing old connection.
1521956877: Client Sonoff_modified_on_3_20_2018 disconnected.
1521956877: New client connected from 192.168.1.154 as Sonoff_modified_on_3_20_2018 (c1, k60, u'sonoff').
1521956878: New connection from 192.168.1.113 on port 1883.
1521956878: Client Sonoff_modified_on_3_20_2018 already connected, closing old connection.
1521956878: Client Sonoff_modified_on_3_20_2018 disconnected.
1521956878: New client connected from 192.168.1.113 as Sonoff_modified_on_3_20_2018 (c1, k15, u'sonoff').
1521956878: New connection from 192.168.1.154 on port 1883.
1521956879: Socket error on client , disconnecting.sonoff log:
06:48:04 MQT: stat/sonoff/POWER = ON
06:48:06 MQT: Attempting connection...
06:48:06 MQT: Connected
06:48:06 MQT: tele/sonoff/LWT = Online (retained)
06:48:06 MQT: cmnd/sonoff/POWER =
06:48:08 MQT: Attempting connection...
06:48:08 MQT: Connected
06:48:08 MQT: tele/sonoff/LWT = Online (retained)
06:48:08 MQT: cmnd/sonoff/POWER =
06:48:08 MQT: stat/sonoff/RESULT = {"POWER":"ON"}
06:48:08 MQT: stat/sonoff/POWER = ON
06:48:10 MQT: Attempting connection...
06:48:10 MQT: Connected
06:48:10 MQT: tele/sonoff/LWT = Online (retained)
06:48:10 MQT: cmnd/sonoff/POWER =
06:48:10 MQT: stat/sonoff/RESULT = {"POWER":"ON"}
06:48:10 MQT: stat/sonoff/POWER = ON
06:48:12 MQT: Attempting connection...
06:48:12 MQT: Connected
06:48:12 MQT: tele/sonoff/LWT = Online (retained)
06:48:12 MQT: cmnd/sonoff/POWER =
06:48:12 MQT: stat/sonoff/RESULT = {"POWER":"ON"}
06:48:12 MQT: stat/sonoff/POWER = ON
06:48:14 MQT: Attempting connection...
06:48:14 MQT: Connected
06:48:14 MQT: tele/sonoff/LWT = Online (retained)
06:48:14 MQT: cmnd/sonoff/POWER =
06:48:14 MQT: stat/sonoff/RESULT = {"POWER":"ON"}
06:48:14 MQT: stat/sonoff/POWER = ON
06:48:16 MQT: Attempting connection...
06:48:16 MQT: Connected
06:48:16 MQT: tele/sonoff/LWT = Online (retained)
06:48:16 MQT: cmnd/sonoff/POWER =
06:48:16 MQT: stat/sonoff/RESULT = {"POWER":"ON"}
06:48:16 MQT: stat/sonoff/POWER = ON
06:48:18 MQT: Attempting connection...
06:48:18 MQT: Connected
06:48:18 MQT: tele/sonoff/LWT = Online (retained)
06:48:18 MQT: cmnd/sonoff/POWER =
06:48:18 MQT: stat/sonoff/RESULT = {"POWER":"ON"}
06:48:18 MQT: stat/sonoff/POWER = ON
06:48:20 MQT: Attempting connection...
06:48:20 MQT: Connected
06:48:20 MQT: tele/sonoff/LWT = Online (retained)
06:48:20 MQT: cmnd/sonoff/POWER =
06:48:20 MQT: stat/sonoff/RESULT = {"POWER":"ON"}
06:48:20 MQT: stat/sonoff/POWER = ONsonoff info:
Program Version 5.12.0
2018-03-20T15:50:39
2_4_0/2.1.0(deb1901)
0T00:02:26
114 at FA000
55
Power on
SonoffDzinYit (100%)
sonoff-5633
192.168.1.113
192.168.1.1
255.255.255.0
192.168.1.1
5C:CF:7F:72:96:01192.168.1.154
1883
Sonoff_modified_on_3_20_2018
sonoff
sonoff
sonoffs
cmnd/sonoff/None
Enabled
Web Server7509505
1327198
1024kB
1024kB
495kB
508kB
20kB
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
Your Sonoff and your Home Assistant are connecting using same client id.
oh, stupid me, i copied the sonoff name to the HA, many thanks!!
Most helpful comment
Your Sonoff and your Home Assistant are connecting using same client id.