AlexxIT / SonoffLAN

Control Sonoff Devices with eWeLink (original) firmware over LAN and/or Cloud from Home Assistant
https://github.com/AlexxIT/Blog
MIT License
2.63k stars 410 forks source link

SonoffLAN Integration seems to stop responding randomly? No updates to devices... #1020

Closed coolspot18 closed 1 year ago

coolspot18 commented 1 year ago

Hi all,

When this integration works, it's fantastic, but from time to time, it mysteriously stops working. I've only been using the integration for <1 day and statistics stopped updated multiple times.

Simply reloading the integration usually fixes the issue.

The log doesn't seem to have anything obvious either? Last message was at 22:07:07, and then I reloaded the integration at 2022-10-28 22:10:53.

I don't think it's WiFi since the units all have good reception?

I'm using S31 Smart Plugs.

Sonoff Log.txt

aboras0500 commented 1 year ago

Same here, devices become unavailable repeatedly since almost a week. Though controlling all devices through ewelink original app seems to be intact and well functioning. Please fix.

coolspot18 commented 1 year ago

@aboras0500 Does local LAN work for you? When I enable it, I seem to get no data, however, I've checked my network and Bonjour is properly propogading?

aXymmetrx commented 1 year ago

i have the same issue with this.

sensors reporting fine in ewelink. rebooting HA or reconfigure/reload the integration seems fix the issue

but I got this WARNING in logs after I rebooted HA

This error originated from a custom integration.

Logger: custom_components.sonoff.core.ewelink.cloud
Source: custom_components/sonoff/light.py:379
Integration: Sonoff (documentation, issues)
First occurred: 12:05:40 AM (3 occurrences)
Last logged: 12:06:47 AM

Cloud processing error
Traceback (most recent call last):
  File "/config/custom_components/sonoff/core/ewelink/cloud.py", line 286, in run_forever
    await self._process_ws_msg(resp)
  File "/config/custom_components/sonoff/core/ewelink/cloud.py", line 346, in _process_ws_msg
    self.dispatcher_send(SIGNAL_UPDATE, data)
  File "/config/custom_components/sonoff/core/ewelink/base.py", line 59, in dispatcher_send
    handler(*args, **kwargs)
  File "/config/custom_components/sonoff/core/ewelink/__init__.py", line 188, in cloud_update
    self.dispatcher_send(did, params)
  File "/config/custom_components/sonoff/core/ewelink/base.py", line 59, in dispatcher_send
    handler(*args, **kwargs)
  File "/config/custom_components/sonoff/core/entity.py", line 108, in internal_update
    self.set_state(params)
  File "/config/custom_components/sonoff/light.py", line 379, in set_state
    state = params[effect]
KeyError: 'white'

not sure it is related or not... all my sonoff devices connected to a specific SSID and i test the connection, everything seems fine.

EDIT: tested using local, all sonoff integration goes unavailable when I use it.

EDIT2: fyi, my main iot system is sonoff, so i have door/motion/temp/humi/plug/camera/zbbridge/rfbridge

EDIT3: just realized zbbridge got a new firmware update and i thought probably the culprit, but nope. image image

asteinarson commented 1 year ago

It looks like the same issue as the one I reported here.

As it happens within a few hours of restarting the integration, it is not possible to reliably use the integration to control something - as is now for me.

I have resorted to using the eWeLink mobile app - and from there every relay is correctly triggered, each time. However, the LAN feature (and HA itself) is of course lost then.

ilgarmehmetali commented 1 year ago

I have currently 2 problem with my integration.

First is same with the issue title here. My problem seems to be with dns discovery, as I only have single device and currently dont have time to debug, I have just replaced {device['host']} part with my localip and port info(eg: 192.168.1.10:8081) https://github.com/AlexxIT/SonoffLAN/blob/master/custom_components/sonoff/core/ewelink/local.py#L258

After restart this solved most of my issues.

My other problem is device state doesnt always match the actual state. So i wrote a script to toggle the device, wait 2 secs and call homeassistant.update_entity to force update its state.

Edit: It seems in one point i wrote some config for this and that might have been the reason for my dns problem

Smawajdeh commented 1 year ago

Same here. Hope it will be solved soon

adaminaus commented 1 year ago

I have the same issue as above it can last from 60 mins to 3 hrs but then it fails and i have no control of the devices from HA

rodrigoasrodrigues commented 1 year ago

I have the same issue, HA doesn't get notified that the entity's status has changed but when I change anything from Lovelace it works perfectly, If I reload the integration it works again for a few minutes.

rodrigoasrodrigues commented 1 year ago

I noticed this error being output, I believe it is related to a few NSPanels I have, I don't think I have any other device that can be considered a "ClimateEntity", does everyone here have one of these? I have another home with the same integrations and no issues but also no NSPanel.

2022-11-14 17:27:52 [W] Cloud processing error| File "/config/custom_components/sonoff/core/ewelink/cloud.py", line 286, in run_forever| await self._process_ws_msg(resp)|TypeError: unsupported operand type(s) for &: 'NoneType' and 'ClimateEntityFeature'|

AlexxIT commented 1 year ago

It looks like the local work is still not fixed. And the devices only work through the cloud. Original here #839

@aXymmetrx @rodrigoasrodrigues you need to create separate issues about your problems and provide device diagnostics for your light and climate

smenzer commented 1 year ago

I'm having this issue even when I'm on auto or cloud mode. I see no errors in the logs, but the symptoms are all the same here. What other information would be useful to help debug this, as it doesn't look directly related to #839 and thus I don't think this issue should be closed.

smenzer commented 1 year ago

it seems like it works after adding the following to configuration.yaml ... since this seems to be a requirement, it would be great to get the docs updated accordingly.

sonoff:
  sensors: [power, current, voltage, rssi, energy]
AlexxIT commented 1 year ago

After does not mean because of...