Support NSPanel120PB
My NSPanel120PB gets detected and added to HA, but without any entities. The logs reports:
2025-06-18 23:16:07.484 DEBUG (MainThread) [custom_components.sonoff.core.ewelink.cloud] CLOUD change state old=None, new=None
2025-06-18 23:16:07.967 DEBUG (MainThread) [custom_components.sonoff] 1 devices loaded from Cloud
2025-06-18 23:16:07.971 DEBUG (MainThread) [custom_components.sonoff.core.ewelink] 100250e003 UIID 0228 | {'bindInfos': {}, 'rooted': True, 'version': 7, 'PREVTZ': 1, 'TZ': 'Europe/Zagreb', 'screenList1': [], 'screenList2': [], 'screenList3': [], 'showablePannels': ['main', 'custom_webShortcut_xwltrnisba7tksfvcdjbv', 'thingList'], 'layout2': [{'type': 'weather-time'}, {'type': ''}], 'theme': 'layout2', 'appVersion': '3.9.4', 'fwVersion': '3.9.4', 'securityType': 0, 'sysVersion': '3.9.4', 'zigbeeVersion': '1.0.0', 'subDevices': [], 'gatewayBindRelations': [], 'supportMatterDeviceType': ['266', '269', '14', '259', '268', '770', '21', '775', '263', '15', '257', '256', '262'], 'zigbeeNetworkRole': 'Repeater', 'guestMode': False, 'searchWebShortcut': 'on', 'foundWebShortcutList': [], 'autoSearchWebShortcut': False, 'webShortcutList': [{'type': 'custom', 'id': 'xwltrnisba7tksfvcdjbv', 'zoom': 100, 'fontSize': 130, 'name': 'Home Assistant', 'url': 'http://192.168.50.9:8123/dashboard-panel', 'iconUrl': 'http://192.168.50.9:8123/static/icons/favicon.ico'}], 'payload': {'type': 'custom', 'id': 'xwltrnisba7tksfvcdjbv', 'zoom': 100, 'fontSize': 130, 'name': 'Home Assistant', 'url': 'http://192.168.50.9:8123/dashboard-panel', 'iconUrl': 'http://192.168.50.9:8123/static/icons/favicon.ico'}, 'webShortcutAction': 'update', 'storageInfo': [{'/storage/self': '0 B', '/system': '1.42 G', '/storage/emulated': '146.14 M', '/storage': '0 B', '/mnt': '0 B', '/vendor': '242.43 M', '/oem': '34.96 M', '/dev': '488.00 K', '/data': '146.14 M', '/metadata': '556.00 K', '/cache': '12.49 M', '/': '3.26 M'}, {'total': '3.36 G', 'free': '3.27 G', 'used': '94.56 M'}, {'/data/data/com.eWeLinkControlPanel/databases': '28.00 K', '/data/data/com.eWeLinkControlPanel/databases/RKStorage-journal': '0 B', '/data/data/com.eWeLinkControlPanel/databases/RKStorage': '28.00 K'}, {'/data/data/com.eWeLinkControlPanel/files': '851.43 K', '/data/data/com.eWeLinkControlPanel/files/eWeLink': '0 B', '/data/data/com.eWeLinkControlPanel/files/eWeLink/record.mp4': '0 B', '/data/data/com.eWeLinkControlPanel/files/Logcat.log': '851.43 K', '/data/data/com.eWeLinkControlPanel/files/log': '1.06 M', '/data/data/com.eWeLinkControlPanel/files/log/controlPanelLog_20250617_1.log': '1.06 M'}, {'/data/data/com.eWeLinkControlPanel/shared_prefs': '2.45 K', '/data/data/com.eWeLinkControlPanel/shared_prefs/com.facebook.react.modules.i18nmanager.I18nUtil.xml': '186.00 B', '/data/data/com.eWeLinkControlPanel/shared_prefs/chip.platform.KeyValueStore.xml': '1.59 K', '/data/data/com.eWeLinkControlPanel/shared_prefs/WebViewChromiumPrefs.xml': '127.00 B', '/data/data/com.eWeLinkControlPanel/shared_prefs/chip.platform.ConfigurationManager.xml': '153.00 B', '/data/data/com.eWeLinkControlPanel/shared_prefs/AwOriginVisitLoggerPrefs.xml': '411.00 B'}, {'/storage/emulated/0': '0 B', '/storage/emulated/0/Notifications': '0 B', '/storage/emulated/0/Pictures': '0 B', '/storage/emulated/0/Ringtones': '0 B', '/storage/emulated/0/Podcasts': '0 B', '/storage/emulated/0/Music': '0 B', '/storage/emulated/0/Download': '0 B', '/storage/emulated/0/Android': '0 B', '/storage/emulated/0/Android/data': '0 B', '/storage/emulated/0/Android/data/com.eWeLinkControlPanel': '0 B', '/storage/emulated/0/Android/data/com.eWeLinkControlPanel/files': '0 B', '/storage/emulated/0/Android/data/com.eWeLinkControlPanel/cache': '0 B', '/storage/emulated/0/Android/data/.nomedia': '0 B', '/storage/emulated/0/Movies': '0 B', '/storage/emulated/0/Alarms': '0 B', '/storage/emulated/0/DCIM': '0 B'}]}
2025-06-18 23:16:07.972 DEBUG (MainThread) [custom_components.sonoff] LOCAL mode start
2025-06-18 23:16:07.998 DEBUG (MainThread) [custom_components.sonoff.core.ewelink] Can't decrypt message
Traceback (most recent call last):
File "/config/custom_components/sonoff/core/ewelink/__init__.py", line 270, in local_update
params = self.local.decrypt_msg(msg, device["devicekey"])
File "/config/custom_components/sonoff/core/ewelink/local.py", line 282, in decrypt_msg
data = decrypt(msg, devicekey)
File "/config/custom_components/sonoff/core/ewelink/local.py", line 71, in decrypt
cipher = AES.new(key, AES.MODE_CBC, iv=base64.b64decode(payload["iv"]))
File "/usr/local/lib/python3.13/site-packages/Crypto/Cipher/AES.py", line 229, in new
return _create_cipher(sys.modules[__name__], key, mode, *args, **kwargs)
File "/usr/local/lib/python3.13/site-packages/Crypto/Cipher/__init__.py", line 52, in _create_cipher
res = _create_cbc_cipher(factory, **kwargs)
File "/usr/local/lib/python3.13/site-packages/Crypto/Cipher/_mode_cbc.py", line 287, in _create_cbc_cipher
raise ValueError("Incorrect IV length (it must be %d bytes long)" %
factory.block_size)
ValueError: Incorrect IV length (it must be 16 bytes long)
2025-06-18 23:16:08.009 DEBUG (MainThread) [custom_components.sonoff.core.ewelink] Can't decrypt message
Traceback (most recent call last):
File "/config/custom_components/sonoff/core/ewelink/__init__.py", line 270, in local_update
params = self.local.decrypt_msg(msg, device["devicekey"])
File "/config/custom_components/sonoff/core/ewelink/local.py", line 282, in decrypt_msg
data = decrypt(msg, devicekey)
File "/config/custom_components/sonoff/core/ewelink/local.py", line 71, in decrypt
cipher = AES.new(key, AES.MODE_CBC, iv=base64.b64decode(payload["iv"]))
File "/usr/local/lib/python3.13/site-packages/Crypto/Cipher/AES.py", line 229, in new
return _create_cipher(sys.modules[__name__], key, mode, *args, **kwargs)
File "/usr/local/lib/python3.13/site-packages/Crypto/Cipher/__init__.py", line 52, in _create_cipher
res = _create_cbc_cipher(factory, **kwargs)
File "/usr/local/lib/python3.13/site-packages/Crypto/Cipher/_mode_cbc.py", line 287, in _create_cbc_cipher
raise ValueError("Incorrect IV length (it must be %d bytes long)" %
factory.block_size)
ValueError: Incorrect IV length (it must be 16 bytes long)
2025-06-18 23:16:08.114 DEBUG (MainThread) [custom_components.sonoff.core.ewelink] Can't decrypt message
Traceback (most recent call last):
File "/config/custom_components/sonoff/core/ewelink/__init__.py", line 270, in local_update
params = self.local.decrypt_msg(msg, device["devicekey"])
File "/config/custom_components/sonoff/core/ewelink/local.py", line 282, in decrypt_msg
data = decrypt(msg, devicekey)
File "/config/custom_components/sonoff/core/ewelink/local.py", line 71, in decrypt
cipher = AES.new(key, AES.MODE_CBC, iv=base64.b64decode(payload["iv"]))
File "/usr/local/lib/python3.13/site-packages/Crypto/Cipher/AES.py", line 229, in new
return _create_cipher(sys.modules[__name__], key, mode, *args, **kwargs)
File "/usr/local/lib/python3.13/site-packages/Crypto/Cipher/__init__.py", line 52, in _create_cipher
res = _create_cbc_cipher(factory, **kwargs)
File "/usr/local/lib/python3.13/site-packages/Crypto/Cipher/_mode_cbc.py", line 287, in _create_cbc_cipher
raise ValueError("Incorrect IV length (it must be %d bytes long)" %
factory.block_size)
ValueError: Incorrect IV length (it must be 16 bytes long)
2025-06-18 23:16:10.974 DEBUG (MainThread) [custom_components.sonoff] Add 1 entities
Would it be possible to add support for it?
Well. It's just debug warning message. Somethings wrong with LAN protocol of your device.
Your device is not supported as an entity. And I do not even know what kind of entities it can have.
I've just seen that some enhancements were added for the NSPanel Pro and was wandering why my NSP120 wasn't showing anything new. It should be the same as device as NSPanel Pro, just the bigger model. Even the API (https://help.sonoff.tech/docs/NSPanel-Pro-API) should be the same.
I added what I could, having remote access. There are problems with the local protocol here. It cannot be debugged remotely.
@AlexxIT I've played around editing the core/devices.py and added (copied from NSPanel Pro) this:
228: [XTemperatureTH, XPanelAlarm, XPanelBuzzer, XPanelScreen],
on line 446.
This seems to get some of the things working - I can turn on and off the screen of the device and I can set the Alarm state.
The device UIID is 228 - I got that from the HA device diagnostics.
@AlexxIT I've created a PR: https://github.com/AlexxIT/SonoffLAN/pull/1679