Meross mss310

Hello,

I have a smart plug (Meross Mss310), which is not HA compatible
However, i found this : https://github.com/albertogeniola/MerossIot
It’s a python lib that can do some nice things :slight_smile:

 # Returns most of the info about the power plug
    data = devices[0].get_sys_data()
    # Turns the power-plug on
    devices[0].turn_off()
    # Turns the power-plug off
    devices[0].turn_on()
    # Reads the historical device consumption
    consumption = devices[0].get_power_consumptionX()

Has someone tested it ? Is it usable for HA (to monitor consumption?) I don’t know how to start to put it on sensor ?

Thanks !

3 Likes

Awaiting a MSS310HIT, when it comes (few days) I will test it

Try this: https://github.com/vincenzosuraci/hassio_meross_sensor_switch

I tested It with mss310 and mss210.

Regards,
Vincenzo

tried. The switch and sensor are created. Sensor I think work, but switch no. I put the log in github

After a month of hard work and debug, the Meross custom-component seems to be quite stable. I warmly suggest to test it and feedback me in case of issues: link

2 Likes

Hi guys!
Thanks to the help of Vincenzo and many others who made me discover the Homeassistant framework, I finally decided to build up a custom component to enable full control of any Meross device (from bulbs to garage openers). Feel free to give it a try here!.

Hi, I have the garage door opener setup and working via the meross app. I’ve installed your component, but am currently getting a connection error, which appears to be related to the userid and password image

I’ve checked and double checked that the credentials are correct, I’ve tried encasing them with quotes (and without) with no success. Any suggestions?

Hi! Is the Homeassistant device connected to the internet? Meross requires internet connection tgo be working, while HomeAssistant might not.

@albertogeniola Hi, yes connected. I restarted again this morning to see if it was a synchronisation issue (I’d reset the password, just before trying this), but that hasn’t fixed it either.

In your secrets file do you use any form of quotes? for either the userid or password. Is there any restrictions on password characters? i.e. upper/lower case letters or special characters?

@albertogeniola. Sorry for this, I’ve gone back and reset the password (to something less complicated) and that seems to resolved the issue. I’m now seeing the garage door. Brilliant! I’ll let you know if any other issues arise, but looking great so far. Thanks for the great component.

Awesome! Don’t forget to star the GitHub repository if you liked it.

Hi!, is it possible to get last period consumption kWh, so then i can calculate consumption in €.

Hi, you can achieve that by using standard HA features. The only meross power plug that supports power consumption reading is the MSS310. If you have that, you can!

Thanks! Following instruction showed from your link, work fine with mss210.
Thank also alberogeniola

I just installed the MSS310R smart plug into HA and got these errors that make the log file grows speedly.

2019-12-06 13:03:16 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.presa_meross fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 270, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 448, in async_device_update
    await self.async_update()
  File "/config/custom_components/meross_cloud/sensor.py", line 40, in async_update
    sensor_info = self._device.get_electricity()
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/power_plugs.py", line 136, in get_electricity
    return self._get_electricity()['electricity']
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/power_plugs.py", line 21, in _get_electricity
    return self.execute_command("GET", ELECTRICITY, {})
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 126, in execute_command
    return self.__cloud_client.execute_cmd(self.uuid, command, namespace, payload, callback=callback, timeout=timeout)
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/client.py", line 300, in execute_cmd
    raise CommandTimeoutException("A timeout occurred while waiting for the ACK: %d" % timeout)
meross_iot.cloud.exceptions.CommandTimeoutException.CommandTimeoutException: A timeout occurred while waiting for the ACK: 10
2019-12-06 13:03:47 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.presa_meross fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 270, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 448, in async_device_update
    await self.async_update()
  File "/config/custom_components/meross_cloud/sensor.py", line 40, in async_update
    sensor_info = self._device.get_electricity()
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/power_plugs.py", line 136, in get_electricity
    return self._get_electricity()['electricity']
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/power_plugs.py", line 21, in _get_electricity
    return self.execute_command("GET", ELECTRICITY, {})
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 126, in execute_command
    return self.__cloud_client.execute_cmd(self.uuid, command, namespace, payload, callback=callback, timeout=timeout)
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/client.py", line 300, in execute_cmd
    raise CommandTimeoutException("A timeout occurred while waiting for the ACK: %d" % timeout)
meross_iot.cloud.exceptions.CommandTimeoutException.CommandTimeoutException: A timeout occurred while waiting for the ACK: 10
2019-12-06 13:04:49 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.presa_meross fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 270, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 448, in async_device_update
    await self.async_update()
  File "/config/custom_components/meross_cloud/sensor.py", line 40, in async_update
    sensor_info = self._device.get_electricity()
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/power_plugs.py", line 136, in get_electricity
    return self._get_electricity()['electricity']
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/power_plugs.py", line 21, in _get_electricity
    return self.execute_command("GET", ELECTRICITY, {})
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 126, in execute_command
    return self.__cloud_client.execute_cmd(self.uuid, command, namespace, payload, callback=callback, timeout=timeout)
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/client.py", line 300, in execute_cmd
    raise CommandTimeoutException("A timeout occurred while waiting for the ACK: %d" % timeout)
meross_iot.cloud.exceptions.CommandTimeoutException.CommandTimeoutException: A timeout occurred while waiting for the ACK: 10
2019-12-06 13:04:49 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 1261, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
    self._platforms.values(), func, call, service_name, required_features
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 348, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 370, in _handle_service_platform_call
    await getattr(entity, func)(**data)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/meross_cloud/switch.py", line 64, in turn_off
    self._device.turn_off_channel(self._channel_id)
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/power_plugs.py", line 154, in turn_off_channel
    return self._channel_control_impl(c, 0, callback=callback)
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/power_plugs.py", line 35, in _channel_control_impl
    return self._togglex(channel, status, callback=callback)
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/power_plugs.py", line 29, in _togglex
    return self.execute_command("SET", TOGGLEX, payload, callback=callback)
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 126, in execute_command
    return self.__cloud_client.execute_cmd(self.uuid, command, namespace, payload, callback=callback, timeout=timeout)
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/client.py", line 300, in execute_cmd
    raise CommandTimeoutException("A timeout occurred while waiting for the ACK: %d" % timeout)
meross_iot.cloud.exceptions.CommandTimeoutException.CommandTimeoutException: A timeout occurred while waiting for the ACK: 10
2019-12-06 13:07:55 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.presa_meross fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 270, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 448, in async_device_update
    await self.async_update()
  File "/config/custom_components/meross_cloud/sensor.py", line 40, in async_update
    sensor_info = self._device.get_electricity()
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/power_plugs.py", line 136, in get_electricity
    return self._get_electricity()['electricity']
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/power_plugs.py", line 21, in _get_electricity
    return self.execute_command("GET", ELECTRICITY, {})
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 126, in execute_command
    return self.__cloud_client.execute_cmd(self.uuid, command, namespace, payload, callback=callback, timeout=timeout)
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/client.py", line 300, in execute_cmd
    raise CommandTimeoutException("A timeout occurred while waiting for the ACK: %d" % timeout)
meross_iot.cloud.exceptions.CommandTimeoutException.CommandTimeoutException: A timeout occurred while waiting for the ACK: 10
2019-12-06 13:08:57 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.presa_meross fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 270, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 448, in async_device_update
    await self.async_update()
  File "/config/custom_components/meross_cloud/sensor.py", line 40, in async_update
    sensor_info = self._device.get_electricity()
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/power_plugs.py", line 136, in get_electricity
    return self._get_electricity()['electricity']
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/power_plugs.py", line 21, in _get_electricity
    return self.execute_command("GET", ELECTRICITY, {})
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 126, in execute_command
    return self.__cloud_client.execute_cmd(self.uuid, command, namespace, payload, callback=callback, timeout=timeout)
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/client.py", line 300, in execute_cmd
    raise CommandTimeoutException("A timeout occurred while waiting for the ACK: %d" % timeout)
meross_iot.cloud.exceptions.CommandTimeoutException.CommandTimeoutException: A timeout occurred while waiting for the ACK: 10
2019-12-06 13:09:59 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.presa_meross fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 270, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 448, in async_device_update
    await self.async_update()
  File "/config/custom_components/meross_cloud/sensor.py", line 40, in async_update
    sensor_info = self._device.get_electricity()
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/power_plugs.py", line 136, in get_electricity
    return self._get_electricity()['electricity']
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/power_plugs.py", line 21, in _get_electricity
    return self.execute_command("GET", ELECTRICITY, {})
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 126, in execute_command
    return self.__cloud_client.execute_cmd(self.uuid, command, namespace, payload, callback=callback, timeout=timeout)
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/client.py", line 300, in execute_cmd
    raise CommandTimeoutException("A timeout occurred while waiting for the ACK: %d" % timeout)
meross_iot.cloud.exceptions.CommandTimeoutException.CommandTimeoutException: A timeout occurred while waiting for the ACK: 10

The switch and the sensor created seems to work well as i can turn on/off the switch and see the power usage. Why those errors?
My configuration is:

meross_cloud:
  username: !secret meross_username
  password: !secret meross_password

And installed the custom component via HACS.

EDIT: When the plug is off i noticed also this error:

2019-12-06 13:19:44 ERROR (Thread-2) [meross.power_plugs] Unknown/Unsupported namespace/command: Appliance.Control.TimerX

Is this project still developed? Is the developer still active? I reported an issue but no reply…

see my answer in github:

Thanks, i replied there…

Hi Guys,
to answer, the developer is busy, but still active and providing support for new Meross Devices. You just have to be patient and contribute with debugging and logging.

Thanks… i will wait patienly… :slight_smile: