albertogeniola / meross-homeassistant

Custom component that leverages the Meross IoT library to integrate with Homeassistant
MIT License
728 stars 83 forks source link

Integration errors after about 1 day #287

Closed nigelspowage closed 2 years ago

nigelspowage commented 2 years ago

I have the integration working but I have found it errors after about a day. Restarting the integration fixes it for another day.

This was on home assistant core-2021.11.4, running on a raspberrypi.

This error originated from a custom integration.

Logger: homeassistant.helpers.entity
Source: custom_components/meross_cloud/sensor.py:401
Integration: Meross Cloud IoT
First occurred: 16 November 2021, 23:11:46 (77087 occurrences)
Last logged: 20:56:36

Update for sensor.kitchen_cupboard_lights_mss310_power_sensor_v_0 fails
Update for sensor.living_room_lamp_mss310_power_sensor_v_0 fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 468, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 658, in async_device_update
    raise exc
  File "/config/custom_components/meross_cloud/sensor.py", line 401, in async_update
    await self._device.async_get_instant_metrics(channel=self._channel_id)
  File "/usr/local/lib/python3.9/site-packages/meross_iot/controller/mixins/electricity.py", line 43, in async_get_instant_metrics
    result = await self._execute_command(method="GET",
  File "/usr/local/lib/python3.9/site-packages/meross_iot/controller/device.py", line 281, in _execute_command
    return await self._manager.async_execute_cmd(destination_device_uuid=self.uuid,
  File "/usr/local/lib/python3.9/site-packages/meross_iot/manager.py", line 838, in async_execute_cmd
    return await self.async_execute_cmd_client(client=client,
  File "/usr/local/lib/python3.9/site-packages/meross_iot/manager.py", line 903, in async_execute_cmd_client
    response = await self._async_send_and_wait_ack(
  File "/usr/local/lib/python3.9/site-packages/meross_iot/manager.py", line 915, in _async_send_and_wait_ack
    message_info = client.publish(
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1257, in publish
    rc = self._send_publish(
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 2693, in _send_publish
    return self._packet_queue(PUBLISH, packet, mid, qos, info)
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3016, in _packet_queue
    return self.loop_write()
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1577, in loop_write
    rc = self._packet_write()
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 2464, in _packet_write
    write_length = self._sock_send(
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 649, in _sock_send
    return self._sock.send(buf)
  File "/usr/local/lib/python3.9/ssl.py", line 1173, in send
    return self._sslobj.write(data)
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:2483)
Raul-7-7 commented 2 years ago

Same here, if you reload the integration it goes away.

jasonhyland commented 2 years ago

I'm getting the same, "ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:2483)" - requires a reboot daily.

nigelspowage commented 2 years ago

I've updated homeassistant-core to 2021-11.5 and the issue still happens.

patrick-blom commented 2 years ago

Same problem as in issue: https://github.com/albertogeniola/meross-homeassistant/issues/286

lkroeker commented 2 years ago

I've got the same/similar issue. Reloading solves it temporarily.

K3ndaar commented 2 years ago

Same issue here, reload is solving temoprarily for me too

alessandrovecchio commented 2 years ago

Same here, I confirm that Reload fixes.

core-2021.11.5 supervisor-2021.10.8 HACS-1.18.0

jsaare commented 2 years ago

Hello! Having same issues as described here. HA restart does the trick for maximum a day. Then the issue repeats.

HA environment information: core-2021.12.3 supervisor-2021.12.2 HACS 1.18.0 Meross custom component 1.1.4 6 meross devices (plugs, switches, extension cord)

Log file snippets: meross_issues.txt

Raul-7-7 commented 2 years ago

@jsaare you can fix it by reloading the integration everytime it happens, or switch to https://github.com/krahabb/meross_lan

albertogeniola commented 2 years ago

Hi guys, unfortunately that happens to be an anti-flood system adopted by the Meross Cloud. I'll try to investigate this issue, but I belive there is little we can do to workaround this problem unless switching to local-only addons. You can, for the moment, rely on the MerossLAN great integration, or just wait until the local-addon is completed (I'm working on it).