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 POWR320D Not Addining #1293

Closed shaundekok closed 9 months ago

shaundekok commented 9 months ago

The POWR320D is not adding, seeing the following in the logs:

2024-01-04 14:19:23 [D] xxxxx320 UIID 0190 | {'version': 8, 'fwVersion': '1.1.1', 'demNextFetchTime': 1704405600000, 'switches': [{'switch': 'on', 'outlet': 0}], 'configure': [{'startup': 'off', 'outlet': 0}], 'pulses': [{'pulse': 'off', 'switch': 'off', 'outlet': 0, 'width': 500}], 'sledOnline': 'on', 'rssi': -73, 'current': 557, 'voltage': 22832, 'power': 122907, 'timeZone': 2, 'dayKwh': 33, 'monthKwh': 33, 'threshold': {'actPow': {'min': 10, 'max': 500000}, 'voltage': {'min': 16500, 'max': 27700}, 'current': {'min': 10, 'max': 2100}}, 'overload_00': {'minAP': {'en': 0, 'val': 10}, 'maxAP': {'en': 1, 'val': 500000}, 'minV': {'en': 0, 'val': 16500}, 'maxV': {'en': 0, 'val': 27700}, 'maxC': {'en': 1, 'val': 2100}, 'minC': {'en': 0, 'val': 10}}, 'getHoursKwh': {'start': 0, 'end': 743}}

2024-01-04 14:19:23 [W] xxxxx320 !! can't setup device| File "/config/custom_components/sonoff/core/ewelink/init.py", line 57, in setup_devices| entities += [cls(self, device) for cls in get_spec(device)]| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^|RecursionError: maximum recursion depth exceeded|

2024-01-04 14:19:24 [D] xxxxx320 !! skip setup for encrypted device

shaundekok commented 9 months ago

I tried to reinstall the integration and got the same result.

Thank you in advance for your help.

hdjweb commented 9 months ago

I've the same prblem with sonoff PowR320D and Home Assistant 2024.1 in debug i've read that there is a problem in file init.py row 57. This is the error in debug: can't setup device| File "/config/custom_components/sonoff/core/ewelink/init.py", line 57, in setup_devices| entities += [cls(self, device) for cls in get_spec(device)]| I hope you can solve. Thank You

aleenca1309 commented 9 months ago

I've the same prblem with sonoff PowR320D

2024-01-04 21:57:38 [D] AUTO mode start 2024-01-04 21:57:38 [D] 1000cd9bdc UIID 0032 | {'version': 8, 'sledOnline': 'on', 'fwVersion': '3.6.0', 'rssi': -69, 'init': 1, 'alarmType': 'pcv', 'alarmVValue': [-1, -1], 'alarmCValue': [-1, -1], 'alarmPValue': [-1, -1], 'switch': 'off', 'startup': 'on', 'pulse': 'off', 'pulseWidth': 500, 'power': '0.00', 'voltage': '223.68', 'current': '0.00', 'oneKwh': 'stop', 'uiActive': 60, 'timeZone': 8, 'hundredDaysKwh': 'get', 'endTime': '2023-10-31T16:17:14.672Z', 'startTime': '2023-09-13T16:55:00.908Z', 'demNextFetchTime': 1704124800000, 'onKwh': 'start', 'only_device': {'ota': 'success'}, 'rstReason': 0, 'exccause': 0, 'epc1': 0, 'epc2': 0, 'epc3': 0, 'excvaddr': 0, 'depc': 0} 2024-01-04 21:57:38 [D] 1000cda6de UIID 0032 | {'version': 8, 'sledOnline': 'on', 'fwVersion': '3.6.0', 'rssi': -61, 'init': 1, 'alarmType': 'pcv', 'alarmVValue': [-1, -1], 'alarmCValue': [-1, -1], 'alarmPValue': [-1, -1], 'switch': 'off', 'startup': 'on', 'pulse': 'off', 'pulseWidth': 500, 'power': '0.00', 'voltage': '223.85', 'current': '0.00', 'oneKwh': 'stop', 'uiActive': 60, 'timeZone': 8, 'hundredDaysKwh': 'get', 'demNextFetchTime': 1704124800000, 'only_device': {'ota': 'success'}, 'rstReason': 0, 'exccause': 0, 'epc1': 0, 'epc2': 0, 'epc3': 0, 'excvaddr': 0, 'depc': 0} 2024-01-04 21:57:38 [D] AUTO mode start 2024-01-04 21:57:38 [D] 1001f44592 !! skip setup for encrypted device 2024-01-04 21:57:38 [D] 1001f44598 !! skip setup for encrypted device

I Hope, you can solve. Thank you very much

shaundekok commented 9 months ago

I rolled back to the 2024.12.0 and the PowR320D is working again

aleenca1309 commented 9 months ago

I rolled back to the 2024.12.0 and the PowR320D is working again

there is any other way except roll back mate ?

shaundekok commented 9 months ago

Not that am I aware of, the addon would need to be updated.

Regards, Shaun de Kok +27 (0) 83 263 0767


From: aleenca1309 @.> Sent: Thursday, January 4, 2024 5:51:33 PM To: AlexxIT/SonoffLAN @.> Cc: shaundekok @.>; Author @.> Subject: Re: [AlexxIT/SonoffLAN] After 2024.1 POWR320D Not Addining (Issue #1293)

I rolled back to the 2024.12.0 and the PowR320D is working again

there is any other way except roll back mate ?

— Reply to this email directly, view it on GitHubhttps://github.com/AlexxIT/SonoffLAN/issues/1293#issuecomment-1877327869, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AORNS3FBCUJM37L2W2OXLZTYM3FYLAVCNFSM6AAAAABBM3IGXKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZXGMZDOOBWHE. You are receiving this because you authored the thread.Message ID: @.***>

aleenca1309 commented 9 months ago

Not that am I aware of, the addon would need to be updated. Regards, Shaun de Kok +27 (0) 83 263 0767 ____ From: aleenca1309 @.> Sent: Thursday, January 4, 2024 5:51:33 PM To: AlexxIT/SonoffLAN @.> Cc: shaundekok @.>; Author @.> Subject: Re: [AlexxIT/SonoffLAN] After 2024.1 POWR320D Not Addining (Issue #1293) I rolled back to the 2024.12.0 and the PowR320D is working again there is any other way except roll back mate ? — Reply to this email directly, view it on GitHub<#1293 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AORNS3FBCUJM37L2W2OXLZTYM3FYLAVCNFSM6AAAAABBM3IGXKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZXGMZDOOBWHE. You are receiving this because you authored the thread.Message ID: @.***>

I do same way, rolled back to version 2023.12.4 and running well

AndreLubbe7 commented 9 months ago

I have the same issue. I found a workaround by messing around with the code which prevents the recursion error and actually adds the devices. If you don't mind disabling the use of dayKwh and monthKwh, remove this code in /config/custom_components/sonoff/core/devices.py ln 332-335:

spec(XEnergyTotal, param="dayKwh", uid="energy_day", multiply=0.01, round=2), spec( XEnergyTotal, param="monthKwh", uid="energy_month", multiply=0.01, round=2 ),

So it should now look like this: 190: [ XSwitchPOWR3, LED, RSSI, spec(XSensor100, param="current"), spec(XSensor100, param="power"), spec(XSensor100, param="voltage"), spec( XEnergySensorPOWR3, param="hoursKwhData", uid="energy", get_params={"getHoursKwh": {"start": 0, "end": 24 * 30 - 1}}, ), ], # Sonoff POWR3

After the change, restart Home Assistant.

My PowR devices are at least functioning again.

AlexxIT commented 9 months ago

1285