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.67k stars 414 forks source link

After 2024.1.0 update unavailable devices after one use #1301

Closed fotis3d closed 9 months ago

fotis3d commented 9 months ago

After the latest HA update to 2024.1.0 I get all the devices unavailable after I switch them once.

I tried auto/cloud/local with restarts and reloads but it does not fix this.

This happens with all my devices (about 15 Sonoffs) basic, mini, TX switches. Everyone I switch once and then it goes unavailable to HA.

Has anyone experienced the same ?

I switched to 2023.12 and they work fine.

jeremysherriff commented 9 months ago

Same issue here - for eWelink GD-W5 garage door relay (I believe this is supported as a Sonoff G1 relay). A reload of the integration allows another single activation of the switch.

I will attempt to get debug logs.

jeremysherriff commented 9 months ago

@fotis3d it is likely this is resolved with today's release of v3.5.4 ::

Can you confirm whether this update fixes your issue?

devezaam commented 9 months ago

I have the same issue and didn't fix ...

fotis3d commented 9 months ago

@jeremysherriff I hadn't even seen there was an update. It seems that works now.

Thanks ;)

@devezaam have you reloaded/restarted it worked for me

ndoggac commented 9 months ago

Experiencing the same. One use and behavior becomes erratic. I believe the issue might lie with the light."" helper? Even after using the dashboard control, light.turn_on, light_turn_off, or light.toggle - which any of will cause the issue and none of them will work again, I can still go into the device and click on the light's name, which brings up the full sized/screen switch and operate it successfully using the large switch.

Edit: V3.5.4 fixed it! Thanks for the lightning response!

bluestar888 commented 9 months ago

Same issue.No devices get detected whatsoever.Removed itegration ,reinstalled ,no change. Force Update to v 3.5.4 in HACS fixed it.

jeremysherriff commented 9 months ago

All Issues resolved for me, but I only have one switch using this integration.

mihaitaiosub commented 9 months ago

Same bug for me.I have 14 devices that works with Sonoff integration.My question is if we update the integration to version 3.5.4, will this integration work correctly with core version 2024.1.0? Or with the following core updates?

Serebrin commented 9 months ago

Дуже схожа проблема після оновлення 2024.1.0. Немає зворотнього зв'язку з пристроями із інтеграції Lokal Sonoff, тобто вони спрацьовують але не відображається коректно поточний стан. Через це деякі автоматизації непрацюють...

Усунув проблему шляхом оновлення інтеграції Sonoff до версії - 3.5.4...

Capcave commented 9 months ago

I am getting this error now even after the 3.5.4 update (and Core 2024.1.0, Supervisor 2023.12.0, Operating System 11.3) both before and after the OS update to 11.3. It works for about 15 mins and then stops. However, I have both ZBBridge and ZBBridgePro on the network and I notice the Pro connected devices are working fine - seems to be limited to the older non Pro devices. There is an error in the logs after the failure which looks like an authentication issue (I assume the Pro is working in local mode)?

Traceback (most recent call last): File "/config/custom_components/sonoff/core/ewelink/cloud.py", line 323, in connect raise Exception(resp) Exception: {'error': 406, 'reason': 'Authentication Failed', 'apikey': 'xxxxxxx', 'sequence': '1704442832479', 'actionName': 'userOnline'}

mihaitaiosub commented 9 months ago

I don't understand why you mention ZBBridge or ZBBridgePro. These bridges work with the Zigbee network and with Zigbee devices, but we have problems with Sonoff devices connected via Wifi directly to the home router, and further through Sonoff integration with Home Assistant.Zigbee Home Automation works ok.

Capcave commented 9 months ago

I don't understand why you mention ZBBridge or ZBBridgePro. These bridges work with the Zigbee network and with Zigbee devices, but we have problems with Sonoff devices connected via Wifi directly to the home router, and further through Sonoff integration with Home Assistant.Zigbee Home Automation works ok.

Ah apologies - my Wifi sonoff devices are not having any issues at all - the zigbee ones I mentioned above through the bridges suddenly started dying after the upgrade.

mihaitaiosub commented 9 months ago

It means that after the last updates, you have another bug that is now related to zigbee integration.

devezaam commented 9 months ago

@jeremysherriff I hadn't even seen there was an update. It seems that works now.

Thanks ;)

@devezaam have you reloaded/restarted it worked for me

It worked for me

mihaitaiosub commented 9 months ago

@devezaam How does it work for you? With the latest updates to Sonoff integration, i.e. v3.5.4, and core 2024.1.0?

Babe-n commented 9 months ago

I can confirm running Sonoff LAN 3.5.4 with HA Core 2023.12.4 works without any problems. Not brave enough to try upgrade to the new HA Core 2024.1.0 and OS 11.3 again :p

mihaitaiosub commented 9 months ago

An hour ago I did all three updates, Sonoff v3.5.4, HA core 2024.1.0 and OS 11.3 and I did all possible checks regarding Sonoff and Zigbee devices.So far everything is working perfectly.

7R0D3N commented 9 months ago

Thanks for the v3.5.4 update, so damn quickly too. Champion. Cheers 🍻

bluestar888 commented 9 months ago

In order to force update ,this is what I did 1) Go in HACS , 2) search for Sonoff LAN 3) choose redownload 4) remove integration restart HA 5) add Integration again

At some point in the journey I read on an old thread that after redownload you need to restart HA in order to be picked up so maybe Removing the Integration was not needed. So it all works now. Let's see if the devices stay connected via HA Local as at some point only the cloud linked (via SmartThings or eWelink add-on) worked .

Kiphouder commented 9 months ago

Fixed thanks!

jmcollin78 commented 9 months ago

I just tried with HA 2024.1.1 and SONOFF 3.5.4 and it don't work for me:

2024-01-06 06:45:40.062 ERROR (MainThread) [custom_components.sonoff.core.entity] Can't init device: {'name': 'Ventilateur sam', 'deviceid': '10013f49a9', 'apikey': 'f3060487-fa07-4cb1-8482-4ab52d913f5f', 'extra': {'uiid': 34, 'description': '20210709002', 'brandId': '5c4c1aee3a7d24c7100be054', 'apmac': 'd0:27:02:7e:90:a3', 'mac': 'd0:27:02:7e:90:a2', 'ui': '智能风扇灯', 'modelInfo': '607ffb615a0f126444f59385', 'model': 'PSF-BFB-GL', 'manufacturer': '深圳松诺技术有限公司', 'chipid': '008D95B2', 'staMac': '9C:9C:1F:8D:95:B2'}, 'brandName': 'SONOFF', 'brandLogo': 'https://eu-ota.coolkit.cc/logo/q62PevoglDNmwUJ9oPE7kRrpt1nL1CoA.png', 'showBrand': True, 'productModel': 'iFan04', 'tags': {'m_3f5f_jmco': 'on'}, 'devConfig': {}, 'settings': {'opsNotify': 0, 'opsHistory': 1, 'alarmNotify': 1, 'wxAlarmNotify': 0, 'wxOpsNotify': 0, 'wxDoorbellNotify': 0, 'appDoorbellNotify': 1}, 'devGroups': [], 'family': {'familyid': '61f187a1e24f680009aedb0f', 'index': -9, 'members': [], 'roomid': '61f187a1e24f680009aedb0c'}, 'shareTo': [], 'devicekey': '05d4fc0d-bf63-4d7b-b2a2-f8d57e1170b2', 'online': True, 'params': {'bindInfos': {}, 'version': 8, 'only_device': {'ota': 'success'}, 'sledOnline': 'on', 'ssid': 'LaLiveBoxDesBoulis', 'bssid': '00:00:00:00:00:00', 'init': 1, 'fwVersion': '3.5.0', 'staMac': '9C:9C:1F:8D:95:B2', 'rssi': -83, 'switches': [{'switch': 'on', 'outlet': 0}, {'switch': 'off', 'outlet': 1}, {'switch': 'off', 'outlet': 2}, {'switch': 'off', 'outlet': 3}], 'configure': [{'startup': 'on', 'outlet': 0}, {'startup': 'off', 'outlet': 1}, {'startup': 'stay', 'outlet': 2}, {'startup': 'stay', 'outlet': 3}]}, 'isSupportGroup': True, 'isSupportedOnMP': True, 'isSupportChannelSplit': False, 'deviceFeature': {}, 'device_class': 'fan'}
Traceback (most recent call last):
  File "/config/custom_components/sonoff/core/entity.py", line 86, in __init__
    self.internal_update(params)
  File "/config/custom_components/sonoff/core/entity.py", line 113, in internal_update
    self.set_state(params)
  File "/config/custom_components/sonoff/fan.py", line 58, in set_state
    self._attr_preset_modes.index(mode or SPEED_OFF)
    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 338, in _getter
    return getattr(o, private_attr_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 338, in _getter
    return getattr(o, private_attr_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 338, in _getter
    return getattr(o, private_attr_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  [Previous line repeated 977 more times]
RecursionError: maximum recursion depth exceeded

I tried to force the installation of integration (reload it), restart HA and I still got the error.

Am I missing something ?

Some entities are working (garage door) but not the fan:

2024-01-06 06:47:43.639 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/sonoff/core/ewelink/cloud.py", line 351, in _process_ws_msg
    self.dispatcher_send(SIGNAL_UPDATE, data)
  File "/config/custom_components/sonoff/core/ewelink/base.py", line 63, in dispatcher_send
    handler(*args, **kwargs)
  File "/config/custom_components/sonoff/core/ewelink/__init__.py", line 229, in cloud_update
    self.dispatcher_send(did, params)
  File "/config/custom_components/sonoff/core/ewelink/base.py", line 63, in dispatcher_send
    handler(*args, **kwargs)
  File "/config/custom_components/sonoff/core/entity.py", line 113, in internal_update
    self.set_state(params)
  File "/config/custom_components/sonoff/fan.py", line 58, in set_state
    self._attr_preset_modes.index(mode or SPEED_OFF)
    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 338, in _getter
    return getattr(o, private_attr_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 338, in _getter
    return getattr(o, private_attr_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 338, in _getter
    return getattr(o, private_attr_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  [Previous line repeated 979 more times]
RecursionError: maximum recursion depth exceeded
AlexxIT commented 9 months ago

1285

jmcollin78 commented 9 months ago

1285

@AlexxIT, Sorry but I install 3.5.4 and the problem is still there. It is for me another problem and only with Fan. The others devices seems to work fine.

My device is the following:

iFan04 par SONOFF Micrologiciel : 3.5.0

-- The manifest of the installed release:

{
  "domain": "sonoff",
  "name": "Sonoff",
  "codeowners": [
    "@AlexxIT"
  ],
  "config_flow": true,
  "dependencies": [
    "http",
    "zeroconf"
  ],
  "documentation": "https://github.com/AlexxIT/SonoffLAN",
  "iot_class": "local_push",
  "issue_tracker": "https://github.com/AlexxIT/SonoffLAN/issues",
  "requirements": [
    "pycryptodome>=3.6.6"
  ],
  "version": "3.5.4"
}

The important part is here:

File "/config/custom_components/sonoff/core/entity.py", line 113, in internal_update
    self.set_state(params)
  File "/config/custom_components/sonoff/fan.py", line 58, in set_state
    self._attr_preset_modes.index(mode or SPEED_OFF)
    ^^^^^^^^^^^^^^^^^^^^^^^

@AlexxIT do you need another issue because I see you close this one ?