Configuration of Meross devices connected to a local MQTT (https://github.com/wsw70/meross-local-mqtt)

I’m stuck. I run home assistant and MQTT server on same laptop. In pairer setup i enter ip address of laptop and port 8883.
When i’m done with pairing i get meross lan entry in HA. They work fine until i switch to mqtt only.
Mqtt explorer see my device as appliance (separate entry from HA with no title).
I know i’m missing something.

@fajrstartr if it’s like my problem the devices are not actually connected via MQTT. You mentioned seeing them in MQTT Explorer so that seems odd. However, every one of my devices that are HomeKit compatible will not actually connect via MQTT. If I connect and subscribe to the topic that the devices are supposed to be publishing to, and then manually turn then on/off I never see any MQTT messages. These devices only work over IP/HTTP and are not actually connected via MQTT.

What do you mean exactly by “switch to MQTT only”?

MQTT explorer on your laptop sees the messages from the devices?

I do not understand that part - separate from what?

  • You have an MQTT broker → devices are connected to it and send/retrieve messages from there.
  • You have HA which does all kind of things, and also connects to MQTT to send/receive messages

If HA sees in the MQTT broker messages from devices in a specific format (Autodiscovery), it adds them to its database.
It will then communicate with these devices via MQTT.
If the clients stop being connected to MQTT, you will see them as unavailable in HA.

HomeKit and MQTT are different protocols.

A device can be compatible with HomeKit or Google Home → this means that HK/GH will make use of their presence in the native, proprietary environment (cloud).

Once you connect them to MQTT, HK/GH capabilities are lost - you only have MQTT messaging. You can then retrieve (some) HK functionality via HA (I did it once to try it out and it is not spectacular)

@WoJWoJ I am perfectly aware of the difference between HomeKit and MQTT, that is not what I’m talking about. Newer Meross devices have firmware that supports HomeKit and older Meross devices don’t. The newer Meross devices that support HomeKit are the ones that are having problems being setup with MQTT.

@timnolte Sorry for having been Captain Obvious – my limited English is to blame as I do not always get everything right :slight_smile:

I have several Meross devices bought over two years or so, I would need to check whether they support HK - I did not have any issues so far after moving them to Meross LAN. (EDIT: this will require some research as there are no stickers on the devices :))

EDIT: ah crap, the only device that was advertised as compatible was a double purchase and I returned it (at least this is what I see on my Amazon commands). I think however that I connected it to Meross LAN before realizing this so I do not believe I had the problem. But that may just be my memory failing.

@WoJWoJ ah, my apologies as well. I forget sometimes that English is not everyone’s first language and it’s one of the hardest languages to understand with all of our slang and strange use of words.

What I’ve found is that I’m able to pair the non-HomeKit with Meross LAN via MQTT however, it seems like the newer HomeKit compatible devices have a problem with the Custom Pairer app & the Node Setup Utility in terms of configuring them to work with MQTT. I’m able to get them connected to Meross LAN, so they are functional, however the will only communicate via IP/HTTP. There does seem to be a difference with these newer devices firmware as the Node Setup Utility is unable to even get information or pair them for me.

Ha, this is something new to me. I did not know that there was a way other than MQTT for the communication. Is Meross LAN starting a new HTTP endpoint for the devices to connect to?

It’s been some time I have paired a Meross device but I do not remember (in the version I had) any other setting than MQTT brokers

@WoJWoJ yeah, there is documentation to the fact that Meross LAN can connect via HTTP or MQTT, and there is an auto mode that can essentially use both in order to be the most responsive since a direct HTTP connection can trigger the device near instantly instead of any minor delays going through the MQTT queue.

My understanding is that Meross LAN uses and auto mode sort of by default which is how, even with the Meross Cloud involved, it can still communicate with devices locally.

If you check the “Configure” option on each device Integration you can see if it is connected via IP/HTTP or MQTT. At the top it will show the IP address of the device when using IP/HTTP mode and simply show MQTT without the IP address when it’s using that mode.

This is very interesting, thanks!

I did not know that the Meross devices have the ability to connect via HTTP (to anything). When I was analyzing their traffic a year or two ago, I saw MQTT calls to the Meross Cloud (I had some issues with throttling when sending too many messages simultaneously).

If the Meross device can connect via HTTP then I will look better in the docs to understand which endpoint they use (the REST API in HA, or something else started by Meross LAN) - I would prefer going directly to HA, MQTT is a SPOF in my case.

@WoJWoJ I should clarify that the Meross LAN has connectivity to the devices via HTTP via polling, I’m pretty sure that the Meross devices themselves don’t do any HTTP connectivity directly to Meross LAN, that’s my understanding anyways. There is some more details here on GitHub.

Ok today i followed this guide: A complete meross integration guide · Discussion #63 · krahabb/meross_lan · GitHub
After many hours only to get:
ERROR: Can’t setup Home Assistant service mqtt
I have no idea what is wrong.
I read about homekit problems with mqtt.
I have 4 devices, only one is homekit.

@fajrstartr which logs is it that you are seeing this error, is it the startup of Meross LAN, Mosquitto MQTT, or Home Assistant itself? I didn’t bother with some of the certificate setup, because in my case I’m using Let’s Encrypt along with Cloudflare managed DNS, and the Nginx SSL Proxy.

Mosquitto addon.
I follow that guide to the letter (installed mqtt 5.1 create and add certificates to HA etc…)
This is full log:
[s6-init] making user provided files available at /var/run/s6/etc…exited 0.
[s6-init] ensuring user provided files have correct perms…exited 0.
[fix-attrs.d] applying ownership & permissions fixes…
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts…
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[08:18:00] INFO: Setup mosquitto configuration
[08:18:00] INFO: Found local users inside config
[08:18:00] INFO: Initialize Home Assistant Add-on services
[08:18:00] ERROR: Can’t setup Home Assistant service mqtt
[08:18:00] INFO: Initialize Home Assistant discovery
[08:18:00] INFO: Start Mosquitto daemon
1653891480: Loading config file /share/mosquitto/acl.conf
1653891480: mosquitto version 1.6.3 starting
1653891480: Config loaded from /etc/mosquitto.conf.
1653891480: Loading plugin: /usr/share/mosquitto/auth-plug.so
1653891480: |-- *** auth-plug: startup
1653891480: ├── Username/password checking enabled.
1653891480: ├── TLS-PSK checking enabled.
1653891480: └── Extended authentication not enabled.
1653891480: Warning: ACL pattern ‘#’ does not contain ‘%c’ or ‘%u’.
1653891480: Warning: ACL pattern ‘#’ does not contain ‘%c’ or ‘%u’.
1653891480: Warning: ACL pattern ‘#’ does not contain ‘%c’ or ‘%u’.
1653891480: Warning: ACL pattern ‘#’ does not contain ‘%c’ or ‘%u’.
1653891480: Opening ipv4 listen socket on port 1883.
1653891480: Opening ipv6 listen socket on port 1883.
1653891480: Opening websockets listen socket on port 1884.
1653891480: Opening ipv4 listen socket on port 8883.
1653891480: Opening ipv6 listen socket on port 8883.
1653891480: Opening websockets listen socket on port 8884.
1653891480: Warning: Mosquitto should not be run as root/administrator.
1653891485: New connection from 192.168.50.197 on port 1883.
[08:18:06] INFO: [INFO] found homeassistant on local database
1653891486: New client connected from 192.168.50.197 as 5ASCH9n06cetGgJchaAmc5 (p2, c1, k60, u’homeassistant’).

I did not use that approach and the errors you show can have many reasons (starting with another MQTT server already running, but there may be more).

I would advise you to consider a different deployment:

  • hassio on a RPi → this is a foolproof method, you won’t have any conflicts because the hardware is dedicated to HA
  • docker → this requires more work (to learn the basics of docker) but once you have it you will be able to dramatically expand your services (each in its own docker). I run 30+ services that way on a single old desktop.
    • In parallel to HA you will also need to deploy a container with MQTT (mosquito)
    • the images you need are all on Docker Hub
    • I would recommend binding your containers to the host, instead of exposing ports. You may adjust this later (but you will likely want to keep it this way to allow for broadcasts etc.)

Bingo :slight_smile:
I tried eclipse MQTT for windows some time before an forgot to disable service.

Edit: only when i restart laptop running HA an MQTT i get no error. :roll_eyes:

This is very likely a conflict of some sort. If I were you I would really go for one of the solutions I suggested, it will make your life and maintenance easier.

I get what you trying to say but this stuff is overwhelming to me.
I barely understand basics (i spent days messing with esp32 to read some ble temp sensors).

I’m not going into RPi or docker stuff its to much for me.

But thanks for help.

Docker I understand, you need a good basis in system administration. But the Rpi version is extremely user-friendly (much more than the step-by-step you’ve been following). It is literally

  • writing an ISO file to an SD card (with step-by-step instructions)
  • plugging that SD card into a RPi
  • done

This is really all it is (Raspberry Pi - Home Assistant)

@fajrstartr I would 2nd what @WoJWoJ says about using the Hassio on RPi method, as that is what I am running and it’s pretty solid. I think I missed the fact that it sounds like you are running Home Assistant on a laptop, running Windows? So does this mean you are running Home Assistant via a Virtual Machine?