yllibed / Zigbee2MqttAssistant

GUI for Zigbee2Mqtt running in docker and HASS.IO
450 stars 42 forks source link

Zigbee2MqttAssitant unable to connect to mqtt server #374

Open utsnik opened 3 years ago

utsnik commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

Hoerli1337 commented 3 years ago

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.