Closed robyevolution closed 4 years ago
Ok, the problem seems not connected to libraries and not connected to HA version either (i tried downgrading to 107 unsuccessfully)
I could no more see some of my mss310 plug - i tried removing them from the app and readding it with a different name , removing meross integration and reinstalling.
I see the following error logged:
2020-04-08 12:07:10 WARNING (SyncWorker_3) [custom_components.meross_cloud.sensor] The plug meross7 is offline; it's impossible to determine if it supports any ability 2020-04-08 12:07:10 WARNING (SyncWorker_3) [custom_components.meross_cloud.sensor] The plug meross5 is offline; it's impossible to determine if it supports any ability 2020-04-08 12:07:11 WARNING (SyncWorker_3) [custom_components.meross_cloud.sensor] The plug meross4 is offline; it's impossible to determine if it supports any ability 2020-04-08 12:07:11 WARNING (SyncWorker_3) [custom_components.meross_cloud.sensor] The plug meross3 is offline; it's impossible to determine if it supports any ability 2020-04-08 12:07:11 WARNING (SyncWorker_3) [custom_components.meross_cloud.sensor] The plug meross2 is offline; it's impossible to determine if it supports any ability 2020-04-08 12:07:11 WARNING (SyncWorker_3) [custom_components.meross_cloud.sensor] The plug meross1 is offline; it's impossible to determine if it supports any ability
It might be something wrong with Meross itself, now, after disconnecting and connecting all plugs i see in logs:
2020-04-08 16:42:53 ERROR (SyncWorker_3) [custom_components.meross_cloud.common] A timeout exception occurred while executing function <function SwitchEntityWrapper.update at 0x7f2fb846add0> 2020-04-08 16:44:15 WARNING (MainThread) [homeassistant.components.sensor] Updating meross_cloud sensor took longer than the scheduled update interval 0:00:30 2020-04-08 16:44:53 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.meross5 is taking over 10 seconds 2020-04-08 16:44:53 ERROR (SyncWorker_0) [custom_components.meross_cloud.common] A timeout exception occurred while executing function <function PowerSensorWrapper.update at 0x7f2fb7f2fe60>
And I see the entities in HA, but all switches look turned off and no power metering.
meross_info_gather return:
[...]
Please specify your meross email: XXX@XXX.XXX
Please specify your meross password: XXXXXXX
# Collecting devices via HTTP api...
# Starting manager...
# Gathering info about supported devices...
Traceback (most recent call last):
File "/usr/local/bin/meross_info_gather", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/site-packages/utilities/meross_info_gather.py", line 83, in main
describe_device(d, manager)
File "/usr/local/lib/python3.7/site-packages/utilities/meross_info_gather.py", line 39, in describe_device
sysdata = d.get_sys_data()
File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 146, in get_sys_data
return self.execute_command("GET", ALL, {}, online_check=False)
File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 143, 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 315, 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 attach logs for further info.
Hi @override80 ,
I've released a new version of the Meross HA integration. Could you please test it and see if that helped with this issue?
Hi @albertogeniola, unfortunately no, I still get errors like this:
2020-04-12 05:15:56 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.meross1 fails Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 279, in async_update_ha_state await self.async_device_update() File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 476, in async_device_update await self.hass.async_add_executor_job(self.update) 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/sensor.py", line 39, in update self._device.get_status(force_status_refresh=False) File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/power_plugs.py", line 139, in get_status self._state = self._get_status_impl() File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/power_plugs.py", line 93, in _get_status_impl data = self.get_sys_data()['all'] File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 146, in get_sys_data return self.execute_command("GET", ALL, {}, online_check=False) File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 143, 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 321, 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 all the switches and sensor are unavailable. meross_info_gather returns the same error.
Thanks for investigating the issue, let me what else I can do
I confirm same issues with MSS310 with HA 0.108 and 0.107... this come up after latest Meross App (iOS) upgrade.
I updated the app too - I did not think that this could be the issue!
Hi guys, This is strange to me. I cannot reproduce the error in any way, It seems is somehow related to your specific HA configuration. May I ask you to update to the latest HA version and clean the meross_cloud integration and install it from scratch?
@override80 : it seems you are having problems with your network. If the problem shows up with the meross info gather, then you're probably experiencing connection issues or slow network problems.
Hi @albertogeniola , my internet is not the fastest ever (6 mbit down, 1 up), i have a pfsense in front not doing any kind of egress filtering, but the i remember i updated the app before experiencing the problem.
If I do a telnet iot.meross.com 2001 i can connect to the MQTT endpoint from a local PC. I triend increasing SHORT_TIMEOUT to 20 seconds, no change. Do you think Meross changed something server side? I saw weird things happening, plugs i renamed with the Meross App renamed when in LAN but with the old name when switching to LTE. Had to completely uninstall the plug and add it back to see the new name. I see they are using a very shot TTL DNS A record for iot.meross.com because IP addresses are changing frequently (they are based on Amazon Route 53 with no public fixed IP - I had problems with this solution in other circumstances at work).
If this might help, I have the same errors with old Vincenzo Suraci plugin (https://github.com/vincenzosuraci/hassio_meross_sensor_switch)
Hi @albertogeniola I have the same problem with MSS310r power plugs. My internet in faster (fibra).
I noticed that the problem is only for switch, but sensor power consumption for this power plug are enabled (but no values are returned).
meross_info_gather seems not have timeouts data.zip
I don't know if this might help - i both straced meross_info_gather and tcpdumped traffic to iot.meross.com:
[omissis]
# Last https packet
14:10:44.887190 IP 10.10.10.98.47314 > ec2-54-247-85-191.eu-west-1.compute.amazonaws.com.https: Flags [R], seq 3529465495, win 0, length 0
# Start mqtt
14:10:45.014461 IP 10.10.10.98.43893 > ec2-54-247-85-191.eu-west-1.compute.amazonaws.com.2001: Flags [P.], seq 912:1285, ack 5420, win 338, options [nop,nop,TS val 2913098446 ecr 1557682767], length 373
14:10:45.100695 IP ec2-54-247-85-191.eu-west-1.compute.amazonaws.com.2001 > 10.10.10.98.43893: Flags [.], ack 1285, win 12, options [nop,nop,TS val 1557683253 ecr 2913098446], length 0
14:10:46.768015 IP ec2-34-253-63-97.eu-west-1.compute.amazonaws.com.2001 > 10.10.10.98.38941: Flags [.], ack 746, win 43, options [nop,nop,TS val 2918454369 ecr 1592772291], length 0
14:10:46.768044 IP 10.10.10.98.38941 > ec2-34-253-63-97.eu-west-1.compute.amazonaws.com.2001: Flags [.], ack 1, win 327, options [nop,nop,TS val 1592781917 ecr 2918444777], length 0
14:10:47.147869 IP 10.10.10.98.38941 > ec2-34-253-63-97.eu-west-1.compute.amazonaws.com.2001: Flags [P.], seq 746:1119, ack 1, win 327, options [nop,nop,TS val 1592782297 ecr 2918444777], length 373
14:10:47.241757 IP ec2-34-253-63-97.eu-west-1.compute.amazonaws.com.2001 > 10.10.10.98.38941: Flags [.], ack 1119, win 43, options [nop,nop,TS val 2918454811 ecr 1592782297], length 0
14:10:52.166572 IP 10.10.10.98.47079 > ec2-34-253-63-97.eu-west-1.compute.amazonaws.com.2001: Flags [P.], seq 1:32, ack 1, win 340, options [nop,nop,TS val 1592787316 ecr 2918429726], length 31
14:10:52.448089 IP ec2-34-253-63-97.eu-west-1.compute.amazonaws.com.2001 > 10.10.10.98.47079: Flags [P.], seq 1:32, ack 32, win 12, options [nop,nop,TS val 2918459803 ecr 1592787316], length 31
14:10:52.448129 IP 10.10.10.98.47079 > ec2-34-253-63-97.eu-west-1.compute.amazonaws.com.2001: Flags [.], ack 32, win 340, options [nop,nop,TS val 1592787597 ecr 2918459803], length 0
14:10:54.156156 IP 10.10.10.98.38941 > ec2-34-253-63-97.eu-west-1.compute.amazonaws.com.2001: Flags [P.], seq 1119:1150, ack 1, win 327, options [nop,nop,TS val 1592789305 ecr 2918454811], length 31
14:10:54.361893 IP ec2-34-253-63-97.eu-west-1.compute.amazonaws.com.2001 > 10.10.10.98.38941: Flags [.], ack 1150, win 43, options [nop,nop,TS val 2918461893 ecr 1592789305], length 0
14:10:54.361913 IP ec2-34-253-63-97.eu-west-1.compute.amazonaws.com.2001 > 10.10.10.98.38941: Flags [P.], seq 1:32, ack 1150, win 43, options [nop,nop,TS val 2918461894 ecr 1592789305], length 31
14:10:54.361929 IP 10.10.10.98.38941 > ec2-34-253-63-97.eu-west-1.compute.amazonaws.com.2001: Flags [.], ack 32, win 327, options [nop,nop,TS val 1592789511 ecr 2918461894], length 0
# fails with timeout
14:10:57.071471 IP 10.10.10.98.56880 > ec2-34-253-63-97.eu-west-1.compute.amazonaws.com.https: Flags [S], seq 2081729112, win 29200, options [mss 1460,sackOK,TS val 1592792220 ecr 0,nop,wscale 7], length 0
14:10:57.152932 IP 10.10.10.98.38941 > ec2-34-253-63-97.eu-west-1.compute.amazonaws.com.2001: Flags [P.], seq 1150:1523, ack 32, win 327, options [nop,nop,TS val 1592792302 ecr 2918461894], length 373
14:10:57.167885 IP ec2-34-253-63-97.eu-west-1.compute.amazonaws.com.https > 10.10.10.98.56880: Flags [S.], seq 2338078415, ack 2081729113, win 43028, options [mss 1400,sackOK,TS val 1390526123 ecr 1592792220,nop,wscale 12], length 0
It seems to me that iot.meross.com is answering with empty payload initially (leght=0, is it just a TCP ack? Don't know protocol details)
strace shows nothing relevant:
write(1, "Waiting for response to message-"..., 68Waiting for response to message-id 50c5f5c6763d128fb49a2013bc1a6f9c) = 68
futex(0x55d8b8495120, FUTEX_WAIT_PRIVATE, 4294967295, {tv_sec=9, tv_nsec=999997771}
) = -1 ETIMEDOUT (Operation timed out)
futex(0x55d8b8495120, FUTEX_WAKE_PRIVATE, 1) = 0
write(2, "Traceback (most recent call last"..., 35Traceback (most recent call last):
UPDATE: I also did a pip install meross-iot outside homeassistant/qemux86-64-homeassistant:0.108.3 docker container. Guess what, no timeouts. This should be connected to some kind of docker issue. I have no iptables rules on the host apart the ones added by docker itself.
Just wanna chime in that I only run Meross TRVs. They've all been good for 24 hours, even the further-est TRV (downstairs, 3 walls in the way) hasn't dropped a beat (the temp chart was usually missing an hour here, half hour there). Nothing in HA logs too re: Meross... which I think is the first.
Since I got these in Jan, I've always had some communication error logs with Meross, not since the latest update though. Happy to assist in any other way(s).
I also did a pip install meross-iot outside homeassistant/qemux86-64-homeassistant:0.108.3 docker container. Guess what, no timeouts. This should be connected to some kind of docker issue. I have no iptables rules on the host apart the ones added by docker itself.
This is great spot. Could you please provide your detailed configuration so that I can replicate the error on my side and try to investigate? So far, I really am unable to reproduce the issue in either of my test setups (1 dedicated hassbian on a raspberry PI and one homeassistant installation on a dedicated Ubuntu VM).
@webs86 : what version of the homeassistant integration are you running? Can you provide homeassistant logs?
@albertogeniola I have latest version. this are the only logs related to meross_cloud i have on :
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 476, in async_device_update await self.hass.async_add_executor_job(self.update) 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/sensor.py", line 39, in update self._device.get_status(force_status_refresh=False) File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/power_plugs.py", line 139, in get_status self._state = self._get_status_impl() File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/power_plugs.py", line 93, in _get_status_impl data = self.get_sys_data()['all'] File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 146, in get_sys_data return self.execute_command("GET", ALL, {}, online_check=False) File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 143, 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 321, 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
UPDATE: @albertogeniola I have updated to 20200412.3. Now I have an error on custom_components/meross_cloud/common.py:88
with no message
With latest Meross 20200412.3 I get
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 263, in _fire_event
c(eventobj)
File "/config/custom_components/meross_cloud/common.py", line 75, in connection_handler
if dev._device.uuid == d['uuid']:
AttributeError: 'SmartIRClimate' object has no attribute '_device'
and no usable meross switches...
I also did a pip install meross-iot outside homeassistant/qemux86-64-homeassistant:0.108.3 docker container. Guess what, no timeouts. This should be connected to some kind of docker issue. I have no iptables rules on the host apart the ones added by docker itself.
This is great spot. Could you please provide your detailed configuration so that I can replicate the error on my side and try to investigate? So far, I really am unable to reproduce the issue in either of my test setups (1 dedicated hassbian on a raspberry PI and one homeassistant installation on a dedicated Ubuntu VM).
@webs86 : what version of the homeassistant integration are you running? Can you provide homeassistant logs?
Yes @albertogeniola i can share my configuration.yaml ad well as installed hacs plugins and integrations. If you want i will share my meross account email and pass by PM, no problem, i just have 7 MSS310 which i can easily bypass ATM. I will also share my screen on a bastion pc with a console via teamviewer if you want.
With latest Meross 20200412.3 I get
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 263, in _fire_event c(eventobj) File "/config/custom_components/meross_cloud/common.py", line 75, in connection_handler if dev._device.uuid == d['uuid']: AttributeError: 'SmartIRClimate' object has no attribute '_device'
and no usable meross switches...
Hi @gianky69 : which device is named SmartIRClimate? Is that a Thermostat ? Is that a sensor? Could you please tell me the device model?
With latest Meross 20200412.3 I get
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 263, in _fire_event c(eventobj) File "/config/custom_components/meross_cloud/common.py", line 75, in connection_handler if dev._device.uuid == d['uuid']: AttributeError: 'SmartIRClimate' object has no attribute '_device'
and no usable meross switches...
Hi @gianky69 : which device is named SmartIRClimate? Is that a Thermostat ? Is that a sensor? Could you please tell me the device model?
I have a SmartIR (app) vDevice climate used with Samsung Conditioner And Broadlink Remotr
@albertogeniola Enabling logger in debug level I have noticed that here seems waiting for a response from meross cloud but no timeout exception or this debug message are printed to log.
Also, in log every 10 seconds many messages like this are printed: Executing message-id 4bef478cfc2bf07fad6e74e6ab05d33a, GET on Appliance.System.All command for device 1910183281183390803748e1e910625a
with differents ids, like an infinite loop, and no changes to power plug state change (now switch entity are present and enabled).
@albertogeniola Enabling logger in debug level I have noticed that here seems waiting for a response from meross cloud but no timeout exception
@webs86 Isn't this what it is supposed to do function wait_for_response? It returns None on timeout, than it raises
if not success:
raise CommandTimeoutException("A timeout occurred while waiting for the ACK: %d" % timeout)
Sorry i am not as good as a python dev (as a dev in general).
@override80 Yes, but as I have wrote, no CommandTimeoutException or debug message below are reported in logs.
If it could help, I have two istances of HA running, one at living home the other at holiday house. All are on a Raspberri Pi3B+, both running HA 0.108.3, with latest Meross Cloud IoT (20200412.3) installed via HACS. All was working perfect untin 0.106.x, now I cannot control (or is not available) any Meross switch. In my living home I have two MSS425E and this is the log after restart:
2020-04-12 23:25:41 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for shelly which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-04-12 23:25:41 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 experience issues with Home Assistant.
2020-04-12 23:25:41 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for meross_cloud which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-04-12 23:25:41 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for smartir which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-04-12 23:25:41 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for enigma which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-04-12 23:25:55 WARNING (MainThread) [homeassistant.components.automation] The 'hide_entity' option (with value 'True') is deprecated, please remove it from your configuration. This option will become invalid in version 0.110
2020-04-12 23:25:55 WARNING (MainThread) [homeassistant.components.automation] The 'hide_entity' option (with value 'True') is deprecated, please remove it from your configuration. This option will become invalid in version 0.110
2020-04-12 23:25:55 WARNING (MainThread) [homeassistant.components.automation] The 'hide_entity' option (with value 'True') is deprecated, please remove it from your configuration. This option will become invalid in version 0.110
2020-04-12 23:26:07 WARNING (MainThread) [homeassistant.setup] Setup of input_select is taking over 10 seconds.
2020-04-12 23:26:07 WARNING (MainThread) [homeassistant.setup] Setup of timer is taking over 10 seconds.
2020-04-12 23:26:07 WARNING (MainThread) [homeassistant.setup] Setup of input_boolean is taking over 10 seconds.
2020-04-12 23:26:07 WARNING (MainThread) [homeassistant.setup] Setup of updater is taking over 10 seconds.
2020-04-12 23:26:07 WARNING (MainThread) [homeassistant.setup] Setup of input_datetime is taking over 10 seconds.
2020-04-12 23:26:07 WARNING (MainThread) [homeassistant.components.climate] Setup of climate platform smartir is taking over 10 seconds.
2020-04-12 23:26:07 WARNING (MainThread) [homeassistant.setup] Setup of person is taking over 10 seconds.
2020-04-12 23:26:07 WARNING (MainThread) [homeassistant.components.switch] Setup of switch platform broadlink is taking over 10 seconds.
2020-04-12 23:26:07 WARNING (MainThread) [homeassistant.components.alarm_control_panel] Setup of alarm_control_panel platform manual is taking over 10 seconds.
2020-04-12 23:26:07 WARNING (MainThread) [homeassistant.components.weather] Setup of weather platform darksky is taking over 10 seconds.
2020-04-12 23:26:07 WARNING (MainThread) [homeassistant.components.binary_sensor] Setup of binary_sensor platform template is taking over 10 seconds.
2020-04-12 23:26:08 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry giancarlo.massari@gmail.com for cover
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 216, in async_setup
hass, self
File "/usr/src/homeassistant/homeassistant/components/cover/__init__.py", line 148, in async_setup_entry
return await hass.data[DOMAIN].async_setup_entry(entry)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 154, in async_setup_entry
platform_type,
File "/usr/src/homeassistant/homeassistant/setup.py", line 244, in async_prepare_setup_platform
platform = integration.get_platform(domain)
File "/usr/src/homeassistant/homeassistant/loader.py", line 277, in get_platform
f"{self.pkg_path}.{platform_name}"
File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/config/custom_components/meross_cloud/cover.py", line 18, in <module>
class OpenGarageCover(CoverDevice):
File "/config/custom_components/meross_cloud/cover.py", line 41, in OpenGarageCover
@cloud_io()
NameError: name 'cloud_io' is not defined
2020-04-12 23:26:12 ERROR (MainThread) [homeassistant.components.updater] Timeout fetching Home Assistant update data
2020-04-12 23:26:15 ERROR (CoAP) [pyShelly] Error http GET: http://192.168.1.135/settings, timed out, Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/pyShelly/utils.py", line 57, in shelly_http_get
resp = conn.getresponse()
File "/usr/local/lib/python3.7/http/client.py", line 1344, in getresponse
response.begin()
File "/usr/local/lib/python3.7/http/client.py", line 306, in begin
version, status, reason = self._read_status()
File "/usr/local/lib/python3.7/http/client.py", line 267, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/local/lib/python3.7/socket.py", line 589, in readinto
return self._sock.recv_into(b)
socket.timeout: timed out
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/pyShelly/utils.py", line 57, in shelly_http_get
resp = conn.getresponse()
File "/usr/local/lib/python3.7/http/client.py", line 1344, in getresponse
response.begin()
File "/usr/local/lib/python3.7/http/client.py", line 306, in begin
version, status, reason = self._read_status()
File "/usr/local/lib/python3.7/http/client.py", line 267, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/local/lib/python3.7/socket.py", line 589, in readinto
return self._sock.recv_into(b)
socket.timeout: timed out
2020-04-12 23:26:19 WARNING (SyncWorker_13) [custom_components.meross_cloud.common]
2020-04-12 23:26:19 WARNING (MainThread) [homeassistant.components.switch] Setup of switch platform meross_cloud is taking over 10 seconds.
2020-04-12 23:26:26 WARNING (MainThread) [homeassistant.setup] Setup of hacs is taking over 10 seconds.
2020-04-12 23:26:28 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform meross_cloud is taking over 10 seconds.
2020-04-12 23:26:29 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up meross_cloud platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
return fut.result()
File "/config/custom_components/meross_cloud/sensor.py", line 172, in async_setup_entry
sensor_entities = await hass.async_add_executor_job(sync_logic)
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/sensor.py", line 160, in sync_logic
elif plug.type.startswith("mss310") or plug.supports_consumption_reading():
File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 179, in supports_consumption_reading
return CONSUMPTIONX in self.get_abilities()
File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 151, 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 143, 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 321, 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-04-12 23:26:29 WARNING (SyncWorker_13) [custom_components.meross_cloud.common]
2020-04-12 23:26:39 WARNING (SyncWorker_13) [custom_components.meross_cloud.common]
2020-04-12 23:26:49 WARNING (SyncWorker_13) [custom_components.meross_cloud.common]
2020-04-12 23:26:59 WARNING (SyncWorker_13) [custom_components.meross_cloud.common]
2020-04-12 23:27:09 ERROR (MainThread) [homeassistant.components.switch] Setup of platform meross_cloud is taking longer than 60 seconds. Startup will proceed without waiting any longer.
2020-04-12 23:27:14 WARNING (SyncWorker_13) [custom_components.meross_cloud.common]
2020-04-12 23:27:24 WARNING (SyncWorker_13) [custom_components.meross_cloud.common]
2020-04-12 23:27:34 WARNING (SyncWorker_13) [custom_components.meross_cloud.common]
2020-04-12 23:27:44 WARNING (SyncWorker_13) [custom_components.meross_cloud.common]
2020-04-12 23:27:54 WARNING (SyncWorker_13) [custom_components.meross_cloud.common]
In my holiday house I have one MSS425e and two MSS310, and the log is this:
2020-04-12 23:25:23 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 experience issues with Home Assistant.
2020-04-12 23:25:24 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for meross_cloud which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-04-12 23:25:34 WARNING (MainThread) [homeassistant.components.automation] The 'hide_entity' option (with value 'True') is deprecated, please remove it from your configuration. This option will become invalid in version 0.110
2020-04-12 23:25:34 WARNING (MainThread) [homeassistant.components.automation] The 'hide_entity' option (with value 'True') is deprecated, please remove it from your configuration. This option will become invalid in version 0.110
2020-04-12 23:25:34 WARNING (MainThread) [homeassistant.components.automation] The 'hide_entity' option (with value 'True') is deprecated, please remove it from your configuration. This option will become invalid in version 0.110
2020-04-12 23:25:38 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry giancarlo.massari@gmail.com for cover
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 216, in async_setup
hass, self
File "/usr/src/homeassistant/homeassistant/components/cover/__init__.py", line 148, in async_setup_entry
return await hass.data[DOMAIN].async_setup_entry(entry)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 154, in async_setup_entry
platform_type,
File "/usr/src/homeassistant/homeassistant/setup.py", line 244, in async_prepare_setup_platform
platform = integration.get_platform(domain)
File "/usr/src/homeassistant/homeassistant/loader.py", line 277, in get_platform
f"{self.pkg_path}.{platform_name}"
File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/config/custom_components/meross_cloud/cover.py", line 18, in <module>
class OpenGarageCover(CoverDevice):
File "/config/custom_components/meross_cloud/cover.py", line 41, in OpenGarageCover
@cloud_io()
NameError: name 'cloud_io' is not defined
2020-04-12 23:25:51 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform meross_cloud is taking over 10 seconds.
2020-04-12 23:25:51 WARNING (MainThread) [homeassistant.components.switch] Setup of switch platform meross_cloud is taking over 10 seconds.
2020-04-12 23:25:51 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up meross_cloud platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
return fut.result()
File "/config/custom_components/meross_cloud/sensor.py", line 172, in async_setup_entry
sensor_entities = await hass.async_add_executor_job(sync_logic)
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/sensor.py", line 160, in sync_logic
elif plug.type.startswith("mss310") or plug.supports_consumption_reading():
File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 179, in supports_consumption_reading
return CONSUMPTIONX in self.get_abilities()
File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 151, 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 143, 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 321, 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-04-12 23:25:55 WARNING (SyncWorker_18) [custom_components.meross_cloud.common]
2020-04-12 23:26:06 WARNING (SyncWorker_18) [custom_components.meross_cloud.common]
2020-04-12 23:26:16 WARNING (SyncWorker_18) [custom_components.meross_cloud.common]
2020-04-12 23:26:26 WARNING (SyncWorker_18) [custom_components.meross_cloud.common]
2020-04-12 23:26:36 WARNING (SyncWorker_18) [custom_components.meross_cloud.common]
2020-04-12 23:26:41 ERROR (MainThread) [homeassistant.components.switch] Setup of platform meross_cloud is taking longer than 60 seconds. Startup will proceed without waiting any longer.
2020-04-12 23:26:46 WARNING (SyncWorker_18) [custom_components.meross_cloud.common]
2020-04-12 23:26:56 WARNING (SyncWorker_18) [custom_components.meross_cloud.common]
Hi guys, that is probably because of a deadlock issue. I need to refactor both the low-level library and the HA component in order to catch the exact root of the problem. In the meanwhile, I'm preparing a new release that will hopefully mitigate part of the problem. I'd ask you to test it while I prepare the "debug" version of the component. I'll keep you informed in this thread.
Hi guys. Please update to 20200413.1 and let me know if that's better. Hopefully later today / tomorrow I'll release a dev version to spot the deadlock.
Thanks a lot to everybody who is helping me debugging this library. I appreciate your time and contribution.
Hi guys. Please update to 20200413.1 and let me know if that's better. Hopefully later today / tomorrow I'll release a dev version to spot the deadlock.
Thanks a lot to everybody who is helping me debugging this library. I appreciate your time and contribution.
Hi @albertogeniola, with this update power plugs working again. Thank you
HA not starting now :( i get:
Connecting to broker iot.meross.com
In wait loop
In wait loop
In wait loop
In wait loop
In wait loop
In wait loop
In wait loop
In wait loop
In wait loop
In wait loop
2020-04-13 11:43:57 ERROR (SyncWorker_6) [custom_components.meross_cloud.common] Component version: unknown, Message: "A command timeout occurred while handling cloud_io function."
Traceback (most recent call last):
File "/config/custom_components/meross_cloud/common.py", line 79, in func_wrapper
return func(*args, **kwargs)
File "/config/custom_components/meross_cloud/switch.py", line 35, in update
self._device.get_status(force_status_refresh=True)
File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/power_plugs.py", line 139, in get_status
self._state = self._get_status_impl()
File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/power_plugs.py", line 93, in _get_status_impl
data = self.get_sys_data()['all']
File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 146, in get_sys_data
return self.execute_command("GET", ALL, {}, online_check=False)
File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 143, 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 321, 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
In wait loop
In wait loop
In wait loop
Hi @override80, where did you get the "In wait loop" messages? As reported by @webs86 , this should be working...
@gianky69 : could you also test the latest version and report if that's working?
@albertogeniola i removed completely integration and restarted, now i get:
2020-04-13 12:09:39 ERROR (SyncWorker_2) [custom_components.meross_cloud.common] Component version: unknown, Message: "A command timeout occurred while handling cloud_io function." Traceback (most recent call last): File "/config/custom_components/meross_cloud/common.py", line 79, in func_wrapper return func(*args, **kwargs) File "/config/custom_components/meross_cloud/switch.py", line 35, in update self._device.get_status(force_status_refresh=True) File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/power_plugs.py", line 139, in get_status self._state = self._get_status_impl() File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/power_plugs.py", line 93, in _get_status_impl data = self.get_sys_data()['all'] File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 146, in get_sys_data return self.execute_command("GET", ALL, {}, online_check=False) File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 143, 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 321, 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
home assistant in not loading
@override80 it seems your setup is unable to correctly talk to the Meross Cloud. Are you trying from the docker container? Could you please install the integration from scratch, manually, without passing via HACS?
Please find version 20200413.1 attached. meross_cloud.zip
@albertogeniola inside the container i see:
bash-5.0# pip list | grep meross meross-iot 0.3.3.0
bash-5.0# ls /config/custom_components/ garbage_collection homeconnect meross_cloud anniversaries google_geocode linkplay shelly attributes hacs magicbluelight
in meross_cloud i put the content of the zip you linked here. Tried restaring the container i still get "Unable to connect to Home Assistant."
@override80 if you did it correctly, the error message should be logged with a version 20200413.1. Can you paste the error log?
sorry @albertogeniola , here you go:
2020-04-13 12:25:36 ERROR (SyncWorker_0) [custom_components.meross_cloud.common] Component version: 20200413.1, Message: "A command timeout occurred while handling cloud_io function."
Traceback (most recent call last):
File "/config/custom_components/meross_cloud/common.py", line 79, in func_wrapper
return func(*args, **kwargs)
File "/config/custom_components/meross_cloud/switch.py", line 37, in update
self._device.get_status(force_status_refresh=True)
File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/power_plugs.py", line 139, in get_status
self._state = self._get_status_impl()
File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/devices/power_plugs.py", line 93, in _get_status_impl
data = self.get_sys_data()['all']
File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 146, in get_sys_data
return self.execute_command("GET", ALL, {}, online_check=False)
File "/usr/local/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 143, 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 321, 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
@override80 , from the logs, I see the version has not been updated. This means that the component has not been installed correctly. Most probably, this is due to the zipfile I've attached. My bad: I should have warned you about. You should first unzip it, then copy the custom_component folder over the custom_component folder of HA. To double check, run a
tree
command on the custom_component folder after installation
@albertogeniola but doesn't this report "2020-04-13 12:25:36 ERROR (SyncWorker_0) [custom_components.meross_cloud.common] Component version: 20200413.1, Message: "A command timeout occurred while handling cloud_io function.""?
This is tree from /config/custom_components:
├── meross_cloud │ ├── climate.py │ ├── common.py │ ├── config_flow.py │ ├── cover.py │ ├── fan.py │ ├── init.py │ ├── light.py │ ├── manifest.json │ ├── pycache │ │ ├── climate.cpython-37.pyc │ │ ├── common.cpython-37.pyc │ │ ├── config_flow.cpython-37.pyc │ │ ├── cover.cpython-37.pyc │ │ ├── fan.cpython-37.pyc │ │ ├── init.cpython-37.pyc │ │ ├── light.cpython-37.pyc │ │ ├── sensor.cpython-37.pyc │ │ ├── switch.cpython-37.pyc │ │ └── version.cpython-37.pyc │ ├── sensor.py │ ├── strings.json │ ├── switch.py │ └── version.py
Sorry, you're right, I'm tired. The component seems corretly installed. I am unable to replicate the issue neither on my hassbian raspberry nor on my Ubuntu VM: I'm a bit lost here.
Anyways, I think the only possible cause of the error might be a deadlock somewhere. I need some time before preparing the DEBUG version which logs lock-acquire attempts. Would you be able to test homeassistant + meross_cloud on a separate device/VM as ubuntu VM?
Hi @override80, where did you get the "In wait loop" messages? As reported by @webs86 , this should be working...
@gianky69 : could you also test the latest version and report if that's working?
After restart I’m unable to load Home Assistant
Hi @gianky69 , can I get some logs?
Sorry, you're right, I'm tired. The component seems corretly installed. I am unable to replicate the issue neither on my hassbian raspberry nor on my Ubuntu VM: I'm a bit lost here.
Anyways, I think the only possible cause of the error might be a deadlock somewhere. I need some time before preparing the DEBUG version which logs lock-acquire attempts. Would you be able to test homeassistant + meross_cloud on a separate device/VM as ubuntu VM?
I'm setting up another env right now ;)
@albertogeniola Oh my they look like working in a fresh environment... :( what could it be then?
Damn... Well, the first candidate is the garbage-collector component you have installed... I have no idea what it is, but I know what a garbage collector does.... might it be interfering with the meross_cloud setup?
Anyways, the best thing to do now, in your case, is to selectively disable components and detect what's interfering with meross_cloud...
Hi @gianky69 , can I get some logs? This is my log... home-assistant.log.zip
Damn... Well, the first candidate is the garbage-collector component you have installed... I have no idea what it is, but I know what a garbage collector does.... might it be interfering with the meross_cloud setup?
@albertogeniola it has nothing to do with python GC :D It's a calendar for door-to-door physical garbage collection. I will try disabling extensions and eventually... well, reinstall everything. Thanks for your precious help!
I got the same issue. I am forced to remove the component's folder to start HA.
Here's an extract of my logs https://pastebin.com/Q9jdiT8K
Edit: would it be more useful to have a more accurate title ? The issue seems independent from the HA version.
Just for sake of completeness: i tried with different versions of meross-iot library, down to 0.3.2 version. I tried in my HA prodution docker, in a clean homeassistant docker, in a bare metal linux installation. meross_info_gather now fails as here https://github.com/albertogeniola/meross-homeassistant/issues/60#issuecomment-612840107.
What's weird is that it worked for a while yesterday during reinstallation. Sometimes it just works, then starts failing.
Thanks for your precious help. This must be some sort of race condition happening somewhere in the code. For this reason, here is what I'll do:
Obviously, I'll need some voluteers for the cause. Would you help me to test such dev releases?
Obviously, I'll need some voluteers for the cause. Would you help me to test such dev releases?
Volunteer 1!
Mee to!
After the last update of supervisor and HA (made this afternoon), the plugin works again, but in log I have the same errors about Meross... mah?!? Using Meross cloud IoT 20200412.1
Not for me :( same behaviour
Hi guys, please try this one.
Closing in favour of #70
In the log show this:
2020-04-08 21:07:29 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up meross_cloud platform for sensor Traceback (most recent call last): File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT) File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for return fut.result() File "/home/homeassistant/.homeassistant/custom_components/meross_cloud/sensor.py", line 180, in async_setup_entry sensor_entities = await hass.async_add_executor_job(sync_logic) File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/home/homeassistant/.homeassistant/custom_components/meross_cloud/sensor.py", line 173, in sync_logic elif plug.type.startswith("mss310") or plug.supports_consumption_reading(): File "/srv/homeassistant/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 179, in supports_consumption_reading return CONSUMPTIONX in self.get_abilities() File "/srv/homeassistant/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 151, in get_abilities self._abilities = self.execute_command("GET", ABILITY, {})['ability'] File "/srv/homeassistant/lib/python3.7/site-packages/meross_iot/cloud/device.py", line 143, in execute_command return self.__cloud_client.execute_cmd(self.uuid, command, namespace, payload, callback=callback, timeout=timeout) File "/srv/homeassistant/lib/python3.7/site-packages/meross_iot/cloud/client.py", line 315, 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