Problem setting up Mosquitto Broker ; and integrating Aqara temp sensor

Tags: #<Tag:0x00007f73953ea840>

I’m fairly new to Home Assistant (and just created an account in the Home Assistant Community) so forgive me if I say anything “stupid”–I’m learning.

I’m having trouble getting the Mosquitto Broker to work on my set up. Here is a brief of the problem:

My setup:
-I have home assistant 0.113.3 running in a docker container on a NUC running Ubuntu 20.04
-I have a HUSBZB-1 USB hub for Zigbee and Zwave - both of which are working great (have lights, etc. devices working)

I recently bought an Xiaomi Aqara Temperature and Humidity Sensor (w/ barometric pressure) model WSDCGQ11LM and tried to get it integrated into home assistant. It is my understanding to pick this up I need to be able to receive Zibbee2mqtt. To do this I tried to follow the published MQTT instructions (IE install Mosquitto Broker and then add the MQTT integration with device discovery).

I’ve been attempting to install this several times. My first installation of Mosquitto Broker seemed to work; it automatically found the MQTT device; however i couldn’t’ get the device discovery to work (either that or I forgot to do something). I uninstalled the Mosquitto Broker and then tried reinstalling again. After doing that, I’m getting errors in the log. See below. Any idea what I’m doing wrong?

When I go into add the MQTT integration it doesn’t show up automatically, and when I try to add it manually I get an “Unable to Connect to the Broker” error. I guess I’m not totally sure what the “broker” name is supposed to be. Maybe I’m entering that wrong? Or maybe it’s the error below with Mosquitto Broker that is causing the problem?

Any help would be much appreciated!!

MOSQUITTO BROKER LOG:
1596353232: Error: No such file or directory.
1596355033: Saving in-memory database to /data/mosquitto.db.
1596355033: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596355033: Error: No such file or directory.
1596356834: Saving in-memory database to /data/mosquitto.db.
1596356834: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596356834: Error: No such file or directory.
1596358635: Saving in-memory database to /data/mosquitto.db.
1596358635: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596358635: Error: No such file or directory.
1596360436: Saving in-memory database to /data/mosquitto.db.
1596360436: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596360436: Error: No such file or directory.
1596362237: Saving in-memory database to /data/mosquitto.db.
1596362237: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596362237: Error: No such file or directory.
1596364038: Saving in-memory database to /data/mosquitto.db.
1596364038: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596364038: Error: No such file or directory.
1596365839: Saving in-memory database to /data/mosquitto.db.
1596365839: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596365839: Error: No such file or directory.
1596367640: Saving in-memory database to /data/mosquitto.db.
1596367640: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596367640: Error: No such file or directory.
1596369441: Saving in-memory database to /data/mosquitto.db.
1596369441: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596369441: Error: No such file or directory.
1596371242: Saving in-memory database to /data/mosquitto.db.
1596371242: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596371242: Error: No such file or directory.
1596373043: Saving in-memory database to /data/mosquitto.db.
1596373043: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596373043: Error: No such file or directory.
1596374844: Saving in-memory database to /data/mosquitto.db.
1596374844: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596374844: Error: No such file or directory.
1596376645: Saving in-memory database to /data/mosquitto.db.
1596376645: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596376645: Error: No such file or directory.
1596378446: Saving in-memory database to /data/mosquitto.db.
1596378446: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596378446: Error: No such file or directory.
1596380247: Saving in-memory database to /data/mosquitto.db.
1596380247: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596380247: Error: No such file or directory.
1596382048: Saving in-memory database to /data/mosquitto.db.
1596382048: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596382048: Error: No such file or directory.
1596383849: Saving in-memory database to /data/mosquitto.db.
1596383849: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596383849: Error: No such file or directory.
1596385650: Saving in-memory database to /data/mosquitto.db.
1596385650: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596385650: Error: No such file or directory.
1596387451: Saving in-memory database to /data/mosquitto.db.
1596387451: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596387451: Error: No such file or directory.
1596389252: Saving in-memory database to /data/mosquitto.db.
1596389252: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596389252: Error: No such file or directory.
1596391053: Saving in-memory database to /data/mosquitto.db.
1596391053: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596391053: Error: No such file or directory.
1596392854: Saving in-memory database to /data/mosquitto.db.
1596392854: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596392854: Error: No such file or directory.
1596394655: Saving in-memory database to /data/mosquitto.db.
1596394655: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596394655: Error: No such file or directory.
1596396456: Saving in-memory database to /data/mosquitto.db.
1596396456: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596396456: Error: No such file or directory.
1596398257: Saving in-memory database to /data/mosquitto.db.
1596398257: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596398257: Error: No such file or directory.
1596400058: Saving in-memory database to /data/mosquitto.db.
1596400058: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596400058: Error: No such file or directory.
1596401859: Saving in-memory database to /data/mosquitto.db.
1596401859: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596401859: Error: No such file or directory.
1596403660: Saving in-memory database to /data/mosquitto.db.
1596403660: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596403660: Error: No such file or directory.
1596405461: Saving in-memory database to /data/mosquitto.db.
1596405461: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596405461: Error: No such file or directory.
1596407262: Saving in-memory database to /data/mosquitto.db.
1596407262: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596407262: Error: No such file or directory.
1596409063: Saving in-memory database to /data/mosquitto.db.
1596409063: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596409063: Error: No such file or directory.
1596410864: Saving in-memory database to /data/mosquitto.db.
1596410864: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596410864: Error: No such file or directory.
1596412665: Saving in-memory database to /data/mosquitto.db.
1596412665: Error saving in-memory database, unable to open /data/mosquitto.db.new for writing.
1596412665: Error: No such file or directory.

Did you turn on the MQTT auto discovery?

Yes, when I try to add the MQTT integration I click the auto discovery. However, i get the “Unable to Connect to the Broker” error and can’t complete adding the MQTT integration. I was wondering if maybe I have the broker name wrong or something. But the fact that I have errors in the Mosquitto Broker Add-on is why i suspected that maybe.

Question : do you have 2 zigbee dongles ?

If you have a HUSBZB-1 using ZHA, you can add your WSDCGQ11LM to your ZHA network, and you don’t need a separate zigbee network running zigbee2mqtt.

No just have a single dongle (HUSBZB-1).

Regarding running the sensor on ZHA… I tried that and it didn’t discover it. Maybe I’m doing something wrong? After I couldn’t get it working on ZHA I poked around on the internet and concluded it required Zigbee2mqtt. Is that right?

Thanks for the link. After reading I tried adding the temp/humidity sensor multiple times and it does not discover it. I tried different physicals locations compared to my zigbee dongle; I tried holding 5 seconds on the pairing button, 10 seconds, etc. I’m wondering if maybe mine is not working property and that is the problem? Not sure what else to try. … I’m curious if anyone else has had trouble getting the same sensor to be discovered as a ZHA devise? Or for that matter… has anyone been successful getting the sensor paired with ZHA? … any thing I’m missing?

Even if I get the sensor working on ZHA, I would still like to understand the error’s on the MQTT log and why I can’t get that working. So if anyone has advise on that, or can understand from the log what it is doing, I would appreciate any input. Thanks!

Maybe show your mosquitto configuration ?

The Configuration is default. Below I copied and pasted what I have:

logins: []
anonymous: false
customize:
  active: false
  folder: mosquitto
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false

Ok, so I tried pairing the sensor numerous times (over and over again) and now it looks like it is showing up in ZHA. Very cool! Thanks for the input on that!!

So now I’m just wondering why I can’t get the MQTT to work, and if any one has any advice on the errors in the log.