Code Monkey home page Code Monkey logo

meross-homeassistant's Issues

MSG100 does not appear in Entity Registry

I have two devices, an MSG100 (garage door opener) and MSL120 (light bulb). The MSL120 appears in the Entity Registry but the MSG100 does not. Functionality isn't affected but figured I would mention it.

Thermostat integration HA timeout error

How often do you get these timeouts?

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/client.py", line 74, in notify_message_received
    self._callback(self._error, self._response)
  File "/config/custom_components/meross_cloud/climate.py", line 119, in action
    self._device.set_mode(ThermostatV3Mode.CUSTOM)
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/subdevices/thermostats.py", line 196, in set_mode
    self.execute_command('SET', HUB_MTS100_MODE, {'mode': [{'id': self.subdevice_id, 'state': mode.value}]})
  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 302, 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
Connection lost. Reconnecting…

Dependancy pb: ModuleNotFoundError: No module named 'meross_iot'

Hi Alberto,,

I'm a total beginner in python and home assistant, so my question is maybe stupid. I have followed your explanations to install Meross cloud iot in Home assistant via HACS but i have this error message.

Error loading custom_components.meross_cloud. Make sure all dependencies are installed
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 338, in _load_file
module = importlib.import_module(path)
File "/usr/local/lib/python3.7/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in _call_with_frames_removed
File "/config/custom_components/meross_cloud/init.py", line 11, in
from meross_iot.api import UnauthorizedException
ModuleNotFoundError: No module named 'meross_iot'

What have i done wrong ?

Thanks

Fanch

Integration not found: meross_cloud

Hello,
I try to install into a docker container (classic HA installations no hassio) but when I try to restart the HA I received this error:
Integration not found: meross_cloud
pi@raspberrypi:~/.homeassistant/config/custom_components/meross_cloud $ ls -ltr
totale 40
-rw-r--r-- 1 pi pi 2578 ago 17 18:54 switch.py
-rw-r--r-- 1 pi pi 3111 ago 17 18:54 sensor.py
-rw-r--r-- 1 pi pi 264 ago 17 18:54 manifest.json
-rw-r--r-- 1 pi pi 3583 ago 17 18:54 light.py
-rw-r--r-- 1 pi pi 6612 ago 17 18:54 init.py
-rw-r--r-- 1 pi pi 4746 ago 17 18:54 cover.py
-rw-r--r-- 1 pi pi 1203 ago 17 18:54 common.py
drwxr-xr-x 2 root root 4096 ago 17 18:57 pycache

can you please help me?

MTS100 Operation and presset reflected in home assistant

Hi Alberto, thanks again for your work!

The climate entities reflects the current temperature what is right, and the target temperature demanded, that it´s also right.
But it shows the current operation and preset, not the target and demanded, and that issue it´s confusing, because if you want to turn off the device, put it to auto, or heating, seems that it´s not responding (in the UI) until the device receives the order (until 3 minutes), making you tap various times the UI thinking you didnt tapped right.
I think it must reflect the target state demanded, so if you tap to turn off like in the meross app, it instantly shows the off state (independly when the device received the order from the hub).

Thanks again and happy new year!!

Change preset ERROR

Hi guys,
after last update, I recive this error when I try to change valve preset:

Mon Feb 17 2020 14:49:25 GMT+0100 (Ora standard dell’Europa centrale)
Error while executing automation automation.set_modalita_economy. Unknown error for call_service at pos 1:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/automation/init.py", line 397, in async_trigger
await self.action_script.async_run(variables, trigger_context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 247, in async_run
await self._handle_action(action, variables, context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 331, in _handle_action
await self._actions[_determine_action(action)](action, variables, context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 413, in _async_call_service
context=context,
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 96, in async_call_from_config
domain, service_name, service_data, blocking=blocking, context=context
File "/usr/src/homeassistant/homeassistant/core.py", line 1226, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File "/usr/src/homeassistant/homeassistant/core.py", line 1251, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/components/script/init.py", line 205, in service_handler
await script.async_turn_on(variables=service.data, context=service.context)
File "/usr/src/homeassistant/homeassistant/components/script/init.py", line 277, in async_turn_on
raise err
File "/usr/src/homeassistant/homeassistant/components/script/init.py", line 272, in async_turn_on
await self.script.async_run(kwargs.get(ATTR_VARIABLES), context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 247, in async_run
await self._handle_action(action, variables, context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 331, in _handle_action
await self._actions[_determine_action(action)](action, variables, context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 413, in _async_call_service
context=context,
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 96, in async_call_from_config
domain, service_name, service_data, blocking=blocking, context=context
File "/usr/src/homeassistant/homeassistant/core.py", line 1226, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File "/usr/src/homeassistant/homeassistant/core.py", line 1251, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/components/script/init.py", line 205, in service_handler
await script.async_turn_on(variables=service.data, context=service.context)
File "/usr/src/homeassistant/homeassistant/components/script/init.py", line 277, in async_turn_on
raise err
File "/usr/src/homeassistant/homeassistant/components/script/init.py", line 272, in async_turn_on
await self.script.async_run(kwargs.get(ATTR_VARIABLES), context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 247, in async_run
await self._handle_action(action, variables, context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 331, in _handle_action
await self._actions[_determine_action(action)](action, variables, context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 413, in _async_call_service
context=context,
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 96, in async_call_from_config
domain, service_name, service_data, blocking=blocking, context=context
File "/usr/src/homeassistant/homeassistant/core.py", line 1226, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File "/usr/src/homeassistant/homeassistant/core.py", line 1251, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 198, in handle_service
self._platforms.values(), func, call, required_features
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 356, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 384, in _handle_service_platform_call
result = await result
File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 438, in async_set_preset_mode
await self.hass.async_add_executor_job(self.set_preset_mode, preset_mode)
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/common.py", line 109, in wrapper_decorator
value = func(*args, **kwargs)
File "/config/custom_components/meross_cloud/climate.py", line 193, in set_preset_mode
self._device.set_mode(ThermostatMode[preset_mode])
File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/subdevices/thermostats.py", line 196, in set_mode
self.execute_command('SET', HUB_MTS100_MODE, {'mode': [{'id': self.subdevice_id, 'state': mode.value}]})
File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 141, in execute_command
(self.name, self.uuid))
meross_iot.cloud.exceptions.OfflineDeviceException.OfflineDeviceException: The device Termo sala (1811063738569229086034298f17d209) is offline. The command cannot be executed

Error Message: "Only one configuration of Meross is allowed.”

I have 2 Home Assistant installations, 1 at home and another one at my holiday house. I have some Meross Switches at home and other 2 ah holiday house, they are all "registered" in Meross App (iOS) and perfectly working.
In both HA I get this error "Only one configuration of Meross is allowed."
But all works as it should.

Meross Color Change

I was just wondering if my new shiny Color Changing Meross Bulb can do a cycle effect to entertain the kids/disco ?

MSL100 Bulb Dimming

Hello,

Just set this up and wanted to report that the MSL100 bulbs I have aren't responding to the dimming from the component. I can dim them from the Meross and Google Home apps. What type of info can I provide to help get this working?

Thank you

Meross - device unavailable

Hi Alberto,

first of all, thanks for this great component. It handles meross devices really well.
I contact you because sometimes a Meross device becomes unavailable and the only way to get it back it is to restart HA. These devices are always available inside Meross App so it looks like it is a comunication problem between HA component and Meross cloud.
Is there a way to force a "scan" of meross devices? Is it possible to have a service that looks for devices on demand?

Usually when I get this problem, the component disconnect to Meross Cloud and I have this log:

2019-12-16 03:56:09 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.presa_xxxxxxxxxx fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 281, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, 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-16 03:56:13 INFO (Thread-2) [meross.connection] Disconnection detected. Reason: 1
2019-12-16 03:56:13 WARNING (Thread-2) [custom_components.meross_cloud] Connection with the Meross cloud dropped.
2019-12-16 03:56:19 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.presa_yyyyyyyyy fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 281, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, 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-16 03:56:29 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.xxxxxxxxx fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 281, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, 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-16 03:56:39 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.xxxxxxxxxxxxx fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 281, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, 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-16 03:56:39 INFO (SyncWorker_14) [custom_components.meross_cloud] Trying to establish a connection with the Meross cloud...
2019-12-16 03:56:39 INFO (SyncWorker_14) [meross.connection] Closing the MQTT connection...
2019-12-16 03:56:39 INFO (SyncWorker_14) [meross.connection] Client has been fully disconnected.
2019-12-16 03:56:39 INFO (SyncWorker_14) [meross.connection] Initializing the MQTT connection...
2019-12-16 03:56:39 WARNING (SyncWorker_14) [custom_components.meross_cloud] Connected to the Meross cloud.
2019-12-16 03:56:39 WARNING (Thread-9) [custom_components.meross_cloud] Connected to the Meross cloud.
2019-12-16 03:56:40 WARNING (Thread-9) [custom_components.meross_cloud] Connected to the Meross cloud.
2019-12-16 03:56:40 INFO (SyncWorker_14) [meross.connection] Client connected to MQTT broker and subscribed to relevant topics.
2019-12-16 03:56:49 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.presa_yyyyyyyyyyy fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 281, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, 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

Thanks for any help you can give me.
Marco

Setup failed for meross_cloud: Component failed to initialize.

Hi,

i'm tryng to install your plugin with HACS, but i receive this error:

2019-07-02 13:09:52 ERROR (MainThread) [custom_components.meross_cloud] An exception occurred while setting up the meross manager.
Traceback (most recent call last):
File "/config/custom_components/meross_cloud/init.py", line 116, in async_setup
manager = MerossManager(meross_email=conf.get(CONF_USERNAME), meross_password=conf.get(CONF_PASSWORD))
File "/usr/local/lib/python3.7/site-packages/meross_iot/manager.py", line 36, in init
self._cloud_creds = self._http_client.get_cloud_credentials()
AttributeError: 'MerossHttpClient' object has no attribute 'get_cloud_credentials'

I have configured the secrets.yaml and configuration.yaml as you described.
Thank you!

Current and voltage values meross mss310 to Grafana

Hi Alberto
Fantastic job. I'm testing the hassio pluguin. I observe the Power data correctly in hassio and in the Grafana instance. But we need monitor Current and Voltage too.

I have two questions:

  1. Is it possible to also graph the current and voltage of the sensor?

  2. I have an external current meter and the external meter and meross data differ greatly. You think it could be from my meter or the formula used in the script.

Thanks for your time & Work

Devices triggered for updates while disabled

Hi,

I get the following errors in the log:

WARNING (MainThread) [homeassistant.helpers.entity] Entity switch.meross_mss310_1 is incorrectly being triggered for updates while it is disabled. This is a bug in the meross_cloud integration.

and

WARNING (MainThread) [homeassistant.helpers.entity] Updating state for switch.meross_mss425e_1_main (<class 'custom_components.meross_cloud.switch.SwitchEntityWrapper'>) took 0.531 seconds. Please report platform to the developers at https://goo.gl/Nvioub

HA with high latency when meross integration added

Hi,

I still have no 100% prove as I am still researching

What I see currently leads me to the point that may the component is driving errors in HA.

If the component is installed but no integration added - I don't see any errors upcoming.

When the integration is added within latest 6 hours after a restart I get the following behavior and errors.

Behavior:
HA gets slow / high latency e.g. 7-8 seconds of button press to light goes on ...

Errors:

2020-01-27 04:30:55 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/urllib/request.py", line 1319, in do_open
    encode_chunked=req.has_header('Transfer-encoding'))
  File "/usr/local/lib/python3.7/http/client.py", line 1252, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1298, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1247, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.7/http/client.py", line 966, in send
    self.connect()
  File "/usr/local/lib/python3.7/http/client.py", line 1414, in connect
    super().connect()
  File "/usr/local/lib/python3.7/http/client.py", line 938, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/usr/local/lib/python3.7/socket.py", line 707, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "/usr/local/lib/python3.7/socket.py", line 752, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Try again

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/tado/__init__.py", line 68, in <lambda>
    lambda now: tadoconnector.update(), SCAN_INTERVAL
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 240, in wrapper
    result = method(*args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/tado/__init__.py", line 111, in update
    self.update_sensor("zone", zone["id"])
  File "/usr/src/homeassistant/homeassistant/components/tado/__init__.py", line 120, in update_sensor
    data = self.tado.getState(sensor)
  File "/usr/local/lib/python3.7/site-packages/PyTado/interface.py", line 197, in getState
    data = self._apiCall(cmd)
  File "/usr/local/lib/python3.7/site-packages/PyTado/interface.py", line 59, in _apiCall
    self._refresh_token()
  File "/usr/local/lib/python3.7/site-packages/PyTado/interface.py", line 128, in _refresh_token
    response = self.opener.open(req)
  File "/usr/local/lib/python3.7/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/usr/local/lib/python3.7/urllib/request.py", line 543, in _open
    '_open', req)
  File "/usr/local/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.7/urllib/request.py", line 1362, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "/usr/local/lib/python3.7/urllib/request.py", line 1321, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno -3] Try again>
2020-01-27 04:31:09 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.meross_steckdose fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
    await self.async_update()
  File "/config/custom_components/meross_cloud/sensor.py", line 42, 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 144, 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 302, 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
2020-01-27 04:31:09 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.processor_use is taking over 10 seconds
2020-01-27 04:31:09 WARNING (MainThread) [homeassistant.components.ring] Time out fetching Ring active dings data
2020-01-27 04:31:09 WARNING (MainThread) [homeassistant.components.ring] Time out fetching Ring device data
2020-01-27 04:31:39 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.meross_steckdose fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
    await self.async_update()
  File "/config/custom_components/meross_cloud/sensor.py", line 42, 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 144, 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 302, 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
2020-01-27 04:31:39 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.work_this_week is taking over 10 seconds
2020-01-27 04:31:39 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.disk_free_home is taking over 10 seconds
2020-01-27 04:32:10 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.meross_steckdose fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
    await self.async_update()
  File "/config/custom_components/meross_cloud/sensor.py", line 42, 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 144, 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 302, 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

I'm running on an Intel NUC with Ubuntu 18.04.3 LTS.
Hassio running in docker with the latest version of HA (0.104.3)
The meross component also in the last version (20200109.5)

The meross devices used with the component are:
mss310 (Switch)
msg100 (Garage Door)

Best
Dominik

Could not connect to the Meross cloud. Please check your internet connection and your Meross credentials

Just started having an issue whereby approximatel 18 hours ago, Meross has stopped authenticating with the server and says it's either can not make contact or my username/password is wrong.

I can login to the Meross account from my phone, and I have changed password numerous times today trying to get this working.

Any ideas?

2020-01-05 22:49:08 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant. 2020-01-05 22:49:09 ERROR (MainThread) [meross.api] Error occurred when logging in. Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/meross_iot/api.py", line 92, in _login response_data = self._authenticated_post(_LOGIN_URL, params_data=data) File "/usr/local/lib/python3.7/site-packages/meross_iot/api.py", line 75, in _authenticated_post raise AuthenticatedPostException() meross_iot.api.AuthenticatedPostException 2020-01-05 22:49:09 ERROR (MainThread) [custom_components.meross_cloud] Your Meross login credentials are invalid or the network could not be reached at the moment. Traceback (most recent call last): File "/config/custom_components/meross_cloud/__init__.py", line 43, in async_setup_entry manager = MerossManager(meross_email=config_entry.data.get(CONF_USERNAME), meross_password=config_entry.data.get(CONF_PASSWORD)) File "/usr/local/lib/python3.7/site-packages/meross_iot/manager.py", line 39, in __init__ self._cloud_creds = self._http_client.get_cloud_credentials() File "/usr/local/lib/python3.7/site-packages/meross_iot/api.py", line 126, in get_cloud_credentials raise UnauthorizedException() meross_iot.api.UnauthorizedException

mss425e with newer firmware not yet supported?

Hi there,
I have several mss425e power bars working well with HA and this plugin. Yesterday, I bought a new one, and for this one, I get only one switch for the entire bar called "switch.smart_surge_protector" (not 5 switches for each channel).

the difference to my other mss425e is that the new one has Firmware 3.1.2 and Hardware Version 3.0.0 (All my other mss425e have Firmware 2.1.3 and Hardware 2.0.0.)

Could this be the problem? Are there any logs to examine?

Thanks,
Philipp

Cannot update to the latest release with HACS

I am trying to update to the latest release through HACS, but i always get the 'download not complete' error and the integration doesn't update

2020-01-07 20:55:51 ERROR (MainThread) [hacs.repository.integration.albertogeniola.meross-homeassistant] Download was not complete.
2020-01-07 21:00:48 ERROR (MainThread) [hacs.repository.integration.albertogeniola.meross-homeassistant] Download was not complete.

I try also to uninstall and then reinstall the component, but unsuccesfully.
Now i have installed manually but in this way HACS doesn't recognize it and i will not have notifications about new updates.

Component doesn't load: "cannot import name 'DeviceDoorStatusEvent'"

Hi,
I tried to use this component comming from this.

I followed the setup but get a python error:

Component error: meross_cloud - cannot import name 'DeviceDoorStatusEvent' from 'meross_iot.meross_event' (/usr/local/lib/python3.7/site-packages/meross_iot/meross_event.py)

Could you look into it why the meross_iot integration is failing? I tried to edit the dependency to version 0.3.1.7 with no luck.

System: Rock64
HassOS 2.12
HAss Version: 0.102.2

Missing support for dedicated white LED (MSL120)

Hey, I just noticed that I could not achieve a strong white color through hassio in comparisson to meross native app. As you can see in this images:
bulb comparisson
meross app comparisson

My guess is that MSL120 has a led specific for white, and it has better brightness than using RGB.

I tried using the attribute "white_value" (Integer between 0 and 255 for how bright a dedicated white LED should be.) as seen here, but had no lucky.

Is it missing support for the dedicated white LED? If so, any way to help you to implement it?
Thanks!

Maybe issue with utility_meter and integration

I wrtite here because I cannot figure out what I am doing wrong.
I amusing 2 MS310 for metering the power costs.
HA is configured correctly with utility_meter and integration platform for converting the W power in Kwh, and passaed the created sensor to the utilty_meter.
The problem is that this thing does not work. The counter of the power is not in Kwh, so when I fire up a stove that consume 1 kwh for 10 seconds, the sensor got 1 kwh of power consumtion. This is not correct.
Since HA is ocnfigured correctly, I want to exclude that this component is all ok with this function. Any other experencie this problem or is getting the power consumtpion meter working properly?
Thanks

When using Home assistant to open/close garage door, status is incorrect

I use an automation to open the garage door when I arrive home. The status turns to 'opening' and never switches to 'open'. When I manually push the wall button to close the garage door it still stays as 'opening'. When in Home Assistant and I push the down arrow button on the garage entity, it switches to 'closing', but never switches to 'closed'. Only after rebooting Home Assistant does the status change to 'closed'. If I use the Meross app or I use the original remotes to open/close the door, the status is updated correctly to 'open' or 'closed' that is if HA has not been used at any point. But when using Home assistant to control the garage door either through an automation or script, the status does not update correctly and as such any subsequent automation does not work until HA has been rebooted. Since it seems to think the door is in the process of transition?

merossOpening

MSS530H Device "Main Switch" don't reflect status on single switch

I have successfully integrated the MSS530H device, a 3-way wall light switch.
HA detects the device as 4 switches, one for each channel, and one for all 3 channels.
Everything works perfectly.
The only problem is that when the 4th device is operated, the states of the individual switches are not updated: The lights are turned on (all 3), but the individual switches on the HA UI remain in the OFF position. And viceversa.

Not working on latest Hassio on raspberry-pi3

Hello,
I have followed the guide on the readme but cannot get it work.

I am using a mms310 smart plug (hardware 1.0.0, firmware 1.1.18)

Following is the log from home-assistant:
ModuleNotFoundError: No module named 'meross_iot'
2019-11-12 20:57:33 ERROR (MainThread) [homeassistant.components.hassio] Component error: meross_cloud - Integration 'meross_cloud' not found.
2019-11-12 20:57:38 WARNING (MainThread) [asyncio] socket.send() raised exception.
2019-11-12 20:57:38 WARNING (MainThread) [asyncio] socket.send() raised exception.
2019-11-12 20:59:46 ERROR (MainThread) [homeassistant.loader] Error loading custom_components.meross_cloud. Make sure all dependencies are installed
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 346, in _load_file
module = importlib.import_module(path)
File "/usr/local/lib/python3.7/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in _call_with_frames_removed
File "/config/custom_components/meross_cloud/init.py", line 11, in
from meross_iot.api import UnauthorizedException
ModuleNotFoundError: No module named 'meross_iot'
2019-11-12 20:59:46 ERROR (MainThread) [homeassistant.components.hassio] Component error: meross_cloud - Integration 'meross_cloud' not found.

Thanks a lot in advance.

Tons of errors after integration in Home Assistant

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

After a restart i got this:

2019-12-06 16:04:32 ERROR (MainThread) [meross.manager] An unhandled error occurred while invoking callback
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/meross_iot/manager.py", line 174, in _fire_event
    c(eventobj)
  File "/config/custom_components/meross_cloud/__init__.py", line 70, in event_handler
    enroll_device(self._hass, self._conf, evt.device)
  File "/config/custom_components/meross_cloud/__init__.py", line 43, in enroll_device
    if device.online and device.supports_consumption_reading():
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 162, in supports_consumption_reading
    return CONSUMPTIONX in self.get_abilities()
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 134, in get_abilities
    self._abilities = self.execute_command("GET", ABILITY, {})['ability']
  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

And the sensor.presa_meross disappeared...

Meross component becomes unresponsive after losing Internet connection (even if Internet connection is restored)

HA Version: 105.2
Component: Latest version: 20200223.2
Devices: various msl120, mss425f,mss425e

The meross cloud component becomes completely unresponsive when it loses Internet connection (even if only for a few minutes). Even after the Internet connection is restored the component does not work (the lights become unavailable, the smartplugs are available but they do not work).The only solution is to restart HA.

This is a link to the debug trace, if you are interested:
https://pastebin.com/x5fjenhs

I believe relevant times are:
2020-02-27 02:46:09 (when meross component loses connection);
2020-02-27 02:46:19 (when meross connection seems restored);
2020-02-27 02:46:20 (when meross connection fails again);
2020-02-27 02:46:30 (when meross component is connected again)

It keeps going thru the same cycle for the next 15 minutes, until
2020-02-27 03:01:44 (when it seems to give up)

However, the internet connection has already been restored by that time. I gave the meross component alamost a whole day to see if it would recover. No dice. I had to restart HA.

Let me know if I can be of further assistance.

Regards,
Javier

How to fix "unavailable" status?

Hi Alberto,

When a device is unavailable (smart switch/bulb), what is the best way to restore them to a normal status?

I tried to turn the device on/off, restart HA without success. I can make the meross devices work in HA when removing the integration, and redoing the setup again, but that's not a practical solution.

On meross native app, all bulbs/devices are connected and responsive.

Tested on switches:

mss310 1.0.0
by Meross
Firmware: 1.1.18

and bulbs:

msl120 2.0.0
by Meross
Firmware: 2.1.18

Note that when I restart HA, I get the following logs:
2020-01-29 20:08:43 WARNING (MainThread) [homeassistant.components.light] Setup of light platform meross_cloud is taking over 10 seconds. 2020-01-29 20:08:43 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 355, in _async_add_entity capabilities=entity.capability_attributes, File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 391, in capability_attributes supported_features = self.supported_features File "/config/custom_components/meross_cloud/light.py", line 123, in supported_features if self._device.supports_luminance(): File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/light_bulbs.py", line 278, in supports_luminance return self.supports_mode(MODE_LUMINANCE) File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/light_bulbs.py", line 259, in supports_mode return (self.get_abilities().get(LIGHT).get('capacity') & mode) == mode File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 134, in get_abilities self._abilities = self.execute_command("GET", ABILITY, {})['ability'] 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 302, 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

Any ideas or tips where to start looking in the code are welcome.
Thanks!

Hassio integration?

I have Homeassistant based on latest hassio image.

The issue is, that in hassio addons live in own docker service.
And the host has not even python installed.

Basically what I need is an addon for hassio. I found this example.
https://github.com/hassio-addons/addon-example

I could also try to create one. but I dont realy know the details of internals of hassio nor from home assistant. But I could help on the docker side, if you are interested in creating one.

Generating No module error

When added to custom_components - the error below is generated in the log:

2019-06-14 10:46:10 ERROR (MainThread) [homeassistant.config] Unable to import meross_cloud: No module named 'common'
2019-06-14 10:46:10 ERROR (MainThread) [homeassistant.setup] Setup failed for meross_cloud: Invalid config.

Home Assistant 0.94.3
Using component commit 537f78d

configuration.yaml

meross_cloud: !include meross_cloud.yaml

secrets.yaml

meross_username: [email protected]
meross_password: "p455w0rD!!"

meross_cloud.yaml

username: !secret meross_username
password: !secret meross_password

Meross no longer starting

Hi,
First of all, thanks for the amazing work. However, my meross devices don't seem to be connecting to the cloud.
Here is the log:

2019-09-22 18:58:32 ERROR (MainThread) [meross.manager] An unhandled error occurred while invoking callback
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/meross_iot/manager.py", line 174, in _fire_event
    c(eventobj)
  File "/config/custom_components/meross_cloud/__init__.py", line 69, in event_handler
    enroll_device(self._hass, self._conf, evt.device)
  File "/config/custom_components/meross_cloud/__init__.py", line 42, in enroll_device
    if device.online and device.supports_consumption_reading():
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 162, in supports_consumption_reading
    return CONSUMPTIONX in self.get_abilities()
  File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 134, in get_abilities
    self._abilities = self.execute_command("GET", ABILITY, {})['ability']
  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

What do you think is going on.

The device Termo sala (xxxxxx) is offline. The command cannot be executed

With Hassio 0.105.3 and last version Merros Cloud Iot I recive this error.
In real my termo valve are ON and available with Meross app.
If I restart Hassio the addon restart to work fine
Thanks for your support

Dettagli registro (ERROR)
Fri Feb 14 2020 23:02:32 GMT+0100 (Ora standard dell’Europa centrale)
The device Termo sala (1811063738569229086034298f17d209) is offline. The command cannot be executed
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 134, in handle_call_service
connection.context(msg),
File "/usr/src/homeassistant/homeassistant/core.py", line 1226, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File "/usr/src/homeassistant/homeassistant/core.py", line 1251, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 198, in handle_service
self._platforms.values(), func, call, required_features
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 356, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 384, in _handle_service_platform_call
result = await result
File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 438, in async_set_preset_mode
await self.hass.async_add_executor_job(self.set_preset_mode, preset_mode)
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/common.py", line 109, in wrapper_decorator
value = func(*args, **kwargs)
File "/config/custom_components/meross_cloud/climate.py", line 193, in set_preset_mode
self._device.set_mode(ThermostatMode[preset_mode])
File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/subdevices/thermostats.py", line 196, in set_mode
self.execute_command('SET', HUB_MTS100_MODE, {'mode': [{'id': self.subdevice_id, 'state': mode.value}]})
File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 141, in execute_command
(self.name, self.uuid))
meross_iot.cloud.exceptions.OfflineDeviceException.OfflineDeviceException: The device Termo sala (1811063738569229086034298f17d209) is offline. The command cannot be executed

Unable to update to latest version

Like issue #38 I cannot update via HACS.
In my Home Assistant (with hass.io) on raspberry 4 this integration get stuck at 20191111.1.

My Home Assistant version:

Host system
System	        HassOS 3.10
Deployment	production
Supervisor
Version	200

HACS 0.21.5

Issue with more than 2 smart plugs?

Over the last two weeks, I bought 4 Meross smart plugs. The first two worked as expected, they each show up as a switch and as a sensor. The third one only showed up as a switch, but no sensor. It also doesn't appear in core.entity_registry which was the most "barebone" place I knew to look for it ;)
I thought maybe it's a problem with this single smart plug, but then I added the fourth smart plug and it also shows up as a switch only.

I'm a programmer, so I'm happy to help debugging. I'm pretty new to Home Assistant though so I don't really know what to look for. The logs don't include anything which seems related (log level debug)

Event is not serializable

I installed your component today and it gave me this warning on first startup:

Log Details (WARNING)
Fri Jun 28 2019 00:07:31 GMT-0400 (Eastern Daylight Time)
Event is not JSON serializable: <Event platform_discovered[L]: service=load_platform.switch, platform=meross_cloud, discovered=None: meross 1 (mss110, HW 1.0.0, FW 1.1.16):
Channels: 0 = OFF>

It found the two devices on the network and registered them, but I don't know what this error means.

merros humidifier not working

from logs
Event is not JSON serializable: <Event platform_discovered[L]: service=load_platform.switch, platform=meross_cloud, discovered=None: Luftbefeuchter (msxh0, HW 3.0.0, FW 3.1.2):

Unknown/Unsupported namespace/command: Appliance.Control.Light

Unknown/Unsupported namespace/command: Appliance.Control.Spray

Exception starting meross manager

I really would like this to work as I want to use the Meross power strips for a few places in my house.
Hassio 0.99.2
Installed via HACS.
Added meross credentials.
On restart of Hassio I see these errors in log:
2019-09-21 13:55:37 ERROR (MainThread) [custom_components.meross_cloud] An exception occurred while setting up the meross manager.
Traceback (most recent call last):
File "/config/custom_components/meross_cloud/init.py", line 130, in async_setup
manager.start()
File "/usr/local/lib/python3.7/site-packages/meross_iot/manager.py", line 45, in start
self._cloud_client.connect()
File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/client.py", line 167, in connect
self._mqtt_client.connect(self._domain, self._port, keepalive=30)
File "/usr/local/lib/python3.7/site-packages/paho/mqtt/client.py", line 839, in connect
return self.reconnect()
File "/usr/local/lib/python3.7/site-packages/paho/mqtt/client.py", line 962, in reconnect
sock = socket.create_connection((self._host, self._port), source_address=(self._bind_address, 0))
File "/usr/local/lib/python3.7/socket.py", line 727, in create_connection
raise err
File "/usr/local/lib/python3.7/socket.py", line 716, in create_connection
sock.connect(sa)
TimeoutError: [Errno 110] Operation timed out

Today kw spent?

Hi, I am trying to set a daily costs with the meross mss310, but I canno figure out how to get the "today kwh" or in the long period.
Is because we are using your "hack" and is not fully compatible? The info I need are in the app itself but I don't know if I can get througth HA.
I want to figure out if I need other smart plug( like tplink or other) or I can get it with these.

Can you help me please?
Many many thanks and keep up the good work!

Confirmed working with MSL120

Not sure if raising an issue is the best way to do this. I just wanted to confirm it working with MSL120 bulbs and thank you for all the hard work.

MSS310 consumption does not appear

Hi ,

i configure the add-on the switch for my 2 MSS310 work great but i don't see the consumption, only the switch.

i miss something ?

Timeout exception occured function PowerSensorWrapper

Hi @albertogeniola. Apologies. Had to disable the component again.
My log is full of those:
2020-02-18 09:55:05 ERROR (SyncWorker_14) [custom_components.meross_cloud.common] A timeout exception occurred while executing function <function PowerSensorWrapper._fetch_power_status at 0x7ff0c6a48c20> 2020-02-18 09:55:15 ERROR (SyncWorker_10) [custom_components.meross_cloud.common] A timeout exception occurred while executing function <function PowerSensorWrapper._fetch_power_status at 0x7ff0c6a48c20> 2020-02-18 09:55:47 ERROR (SyncWorker_18) [custom_components.meross_cloud.common] A timeout exception occurred while executing function <function PowerSensorWrapper._fetch_power_status at 0x7ff0c6a48c20> 2020-02-18 09:55:57 ERROR (SyncWorker_19) [custom_components.meross_cloud.common] A timeout exception occurred while executing function <function PowerSensorWrapper._fetch_power_status at 0x7ff0c6a48c20> 2020-02-18 09:56:07 ERROR (SyncWorker_1) [custom_components.meross_cloud.common] A timeout exception occurred while executing function <function PowerSensorWrapper._fetch_power_status at 0x7ff0c6a48c20> 2020-02-18 09:56:17 ERROR (SyncWorker_14) [custom_components.meross_cloud.common] A timeout exception occurred while executing function <function PowerSensorWrapper._fetch_power_status at 0x7ff0c6a48c20>
and power sensors show as not available. Side effects (not sure it is related to the component):
Netatmo component, alexa component, push notifications, ... fail

A timeout occurred while waiting for the ACK

OS Debian 10 (Docker)
Home Assistant Core 0.105.5
HACS 0.21.5
Meross Cloud IoT 20200216.1 (same problem with 20200109.5)
Device mss310 1.0.0 (Firmware 1.1.18)

Hello,

When Home Assistant just started, no problem, I have the power voltage but after a random time (sometimes 30 minutes, sometimes 10 hours). The power voltage stop to be updated on home assistant.

If I check with the Meross mobile app, is fine, I have the actual power consumption but not with Home Assistant.

If I restart home assistant, problem gone but reappear after a time.

In SSH, I can ping external IP address and resolv domain so it's probably not a dns or connexion issue.

I have this type of log every 30-31 secondes.

2020-02-18 08:30:08 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.ordinateur_julien fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update await self.async_update() File "/config/custom_components/meross_cloud/sensor.py", line 42, 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 144, 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 302, in execute_cmd raise CommandTimeoutException("A timeout occurred while waiting for the ACK: %d" % timeout)

Any clue ?

In an old version the status went into "unavailable" => #42

Status for garagedoor closing instead of closed

After boot of HomeAssistant the meross plugin is telling me the Garagedoor is "Closed". When I open it, status changes to Opening. When the door is fully opened it still says Opening. When closing it back status changes to Closing. It will then stay at closing and not report back it is Closed.

The Meross app sends a message the garagedoor is closed, but never changes in HA. Not sure if this is possible but would be usefull to have it tell me if it is Closed instead of Closing.

[Suggestion] Added custom name for plug as friendly_name

First of all, thank you very much for making this integration. It works great!

However, I would like to suggest adding the custom name I've set in the app as the friendly_name in Home Assistant. That way I know what exactly is connected to switch.stekkerdoos_channel_0, since I've set it in the Meross app already.


I would also like to suggest to use different icons (as everything is currently mdi:flash). In my custom component (which is now archived, since I prefer using this one), I've used mdi:usb for the USB socket (channel 4 on the MSS425e), mdi:power-socket for all the sockets (channel 1, 2 and 3) and the regular mdi:flash for the whole plug itself (channel 0). I used a basic type check to do this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.