Unsupported callback API version: version 2.0 added a callback_api_version, see docs/migrations.rst for details

I’ve suddenly lost connection with all of my Meross devices. It seems that a package upgrade of Paho (py3-paho-mqtt) has broken it, but none of the suggestions online seem to correspond with any of my files. Please help!

I can see from various articles that a recent breaking change in the Paho package was introduced, but the guidance on how to fix it is not helpful, to say the least.

I’m running HA on RPi 4, and it’s updated to the hilt (2025.3, I think). The log shows the following relevant entry:

Logger: homeassistant.config_entries
Source: config_entries.py:753
First occurred: 14:03:05 (2 occurrences)
Last logged: 14:10:47

Error setting up entry [email protected] for meross_lan: Unsupported callback API version: version 2.0 added a callback_api_version, see docs/migrations.rst for details
Traceback (most recent call last):
  File "/config/custom_components/meross_lan/__init__.py", line 601, in async_setup_entry
    await profile.async_init()
  File "/config/custom_components/meross_lan/meross_profile.py", line 946, in async_init
    mqttconnection = MerossMQTTConnection(self, broker)
  File "/config/custom_components/meross_lan/meross_profile.py", line 753, in __init__
    MerossMQTTAppClient.__init__(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        self,
        ^^^^^
    ...<3 lines>...
        loop=self.hass.loop,
        ^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/config/custom_components/meross_lan/merossclient/mqttclient.py", line 344, in __init__
    super().__init__(
    ~~~~~~~~~~~~~~~~^
        f"app:{app_id}", [(self.topic_push, 1), (self.topic_command, 1)], loop=loop
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/config/custom_components/meross_lan/merossclient/mqttclient.py", line 79, in __init__
    super().__init__(client_id, protocol=mqtt.MQTTv311)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/paho/mqtt/client.py", line 772, in __init__
    raise ValueError(
        "Unsupported callback API version: version 2.0 added a callback_api_version, see docs/migrations.rst for details"
    )
ValueError: Unsupported callback API version: version 2.0 added a callback_api_version, see docs/migrations.rst for details

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 753, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/meross_lan/__init__.py", line 613, in async_setup_entry
    raise ConfigEntryError from error
homeassistant.exceptions.ConfigEntryError: Unsupported callback API version: version 2.0 added a callback_api_version, see docs/migrations.rst for details

I’ve figured it out. I couldn’t find the implicit call to mqtt.Client(), because the meross implementation has abstracted it through several layers of inheritance. I ended up changing the last call to the inherited constructor to include mqtt.CallbackAPIVersion.VERSION1 as the first parameter. The Meross integration is working again:

class _MerossMQTTClient(mqtt.Client):
    ...
    def __init__(
        ...
    ):
        super().__init__(mqtt.CallbackAPIVersion.VERSION1, client_id, protocol=mqtt.MQTTv311)
        ...

I am having the same problem.
Which file do I make these changes? Or is there a new version of the Meross integration I can install in HA?

Same problem with me. I have some meross smart plugs. The devices continue to work in HA even though I’m seeing this error message in the integrations section.

I eventually discovered that my HACS Update process was broken. I followed the instructions in this post to update HACS, and after that I was given the option to update Meross LAN and all now works fine

mqttclient.py. It’s under custom_components/meross_lan/merossclient. The change I made is on line 79, in the call to super().__init__