Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zigbee2MqttAssitant unable to connect to mqtt server #374

Open
utsnik opened this issue Apr 5, 2021 · 4 comments
Open

Zigbee2MqttAssitant unable to connect to mqtt server #374

utsnik opened this issue Apr 5, 2021 · 4 comments

Comments

@utsnik
Copy link

utsnik commented Apr 5, 2021

Hi!

Been trying for 5 hours to get this to connect to zigbee2mqtt.

Error below.

Hass is newly installed, and zigbee2mqtt works perfectly (as in entities pairs and shows up) However i'm unable to make this works. Isn't it suppose to work out of the box?

Starting Zigbee2MqttAssistant v0.3.157+Branch.master.Sha.ea388c3bbc2d43c4c9c62f27bb6764911ba4acc9...
warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
No XML encryptor configured. Key {0d305bcf-71a8-4217-a9fa-df40291a6eb8} may be persisted to storage in unencrypted form.
Hosting environment: Production
Content root path: /app
Now listening on: http://[::]:80
Application started. Press Ctrl+C to shut down.
warn: Zigbee2MqttAssistant.Services.MqttConnectionService[0]
Unable to connect to MQTT server addon_core_mosquitto.

@utsnik
Copy link
Author

utsnik commented Apr 7, 2021

Ok, so i finally managed to fix this myself, and thought i'd give an update to how i did it.

I installed Zigbee2MqttAssistant, then Mosquitto broker (MQTT Broker)

I added a new user in configuration in HASS itself, (with password and user as mqtt)
Then went into configuration in Zigbee2MqttAssistant, and set user/pass as mqtt/mqtt there.

Finally after a reboot my errors went away.

I still have on bug left though, it says my coordinator is offline, lol. All devices are working, so just another bug i guess.

@utsnik
Copy link
Author

utsnik commented Apr 7, 2021

Oh, also remember to enable MQTT broker under configuration/integrations in hass

@Hoerli1337
Copy link

Have the same problem with the Docker container.
Started everything with Docker Compose and the normal Docker command.
It always comes up with the following:

warn: Zigbee2MqttAssistant.Services.MqttConnectionService[0]
      Disconnected from MQTT server 192.168.178.110.
MQTTnet.Exceptions.MqttCommunicationTimedOutException: Exception of type 'MQTTnet.Exceptions.MqttCommunicationTimedOutException' was thrown.
   at MQTTnet.PacketDispatcher.MqttPacketAwaiter`1.WaitOneAsync(TimeSpan timeout)
   at MQTTnet.Client.MqttClient.SendAndReceiveAsync[TResponsePacket](MqttBasePacket requestPacket, CancellationToken cancellationToken)
   at MQTTnet.Client.MqttClient.TrySendKeepAliveMessagesAsync(CancellationToken cancellationToken)

The Mosquitto log shows the following:

1628869235: New client connected from 192.168.178.5 as 9fbf4c87670b449dbae30dac014a7bd5 (c1, k15, u'zigbee2mqtt').
1628869256: Socket error on client 9fbf4c87670b449dbae30dac014a7bd5, disconnecting.
  • I use Docker
  • The Docker container runs on a different machine than Mosquitto
  • I use OpenHAB for control, not Home Assistant
  • MQTT explorer works fine with the login data
  • I have not encrypted the connection
  • The user's password consists of numbers and letters

@federicotravaini
Copy link

Have the same problem with the Docker container. Started everything with Docker Compose and the normal Docker command. It always comes up with the following:

warn: Zigbee2MqttAssistant.Services.MqttConnectionService[0]
      Disconnected from MQTT server 192.168.178.110.
MQTTnet.Exceptions.MqttCommunicationTimedOutException: Exception of type 'MQTTnet.Exceptions.MqttCommunicationTimedOutException' was thrown.
   at MQTTnet.PacketDispatcher.MqttPacketAwaiter`1.WaitOneAsync(TimeSpan timeout)
   at MQTTnet.Client.MqttClient.SendAndReceiveAsync[TResponsePacket](MqttBasePacket requestPacket, CancellationToken cancellationToken)
   at MQTTnet.Client.MqttClient.TrySendKeepAliveMessagesAsync(CancellationToken cancellationToken)

The Mosquitto log shows the following:

1628869235: New client connected from 192.168.178.5 as 9fbf4c87670b449dbae30dac014a7bd5 (c1, k15, u'zigbee2mqtt').
1628869256: Socket error on client 9fbf4c87670b449dbae30dac014a7bd5, disconnecting.
  • I use Docker
  • The Docker container runs on a different machine than Mosquitto
  • I use OpenHAB for control, not Home Assistant
  • MQTT explorer works fine with the login data
  • I have not encrypted the connection
  • The user's password consists of numbers and letters

I have exactly the same issue and have no idea how to solve it. The mqtt server, user and password are correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants