SonoffLAN icon indicating copy to clipboard operation
SonoffLAN copied to clipboard

Local control of POW Elite (POWR320D) fails

Open eyesoft opened this issue 2 years ago • 8 comments

diagnostic.txt Turning the switch on/off with local configuration returns an error 400 response. Cmd 'Info' works fine and receiving notifications works fine.

With som added debug to the code when operating the switch I get this information.

The in parameter device in method send() in SonoffLAN/custom_components/sonoff/core/ewelink/local.py has the following value:

device = {'name': 'POWR320D', 'deviceid': '100173869c', 'apikey': '1d42c870-0000-0000-0000-3151153874c9', 'extra': {'uiid': 190, 'description': '20220523003', 'brandId': '5c4c1aee3a7d24c7100be054', 'apmac': 'd0:27:02:e7:0a:89', 'mac': 'd0:27:02:e7:0a:88', 'ui': 'POWR3-显示屏版本', 'modelInfo': '61b83734d12cfa5e630c8770', 'model': 'SN-ESP32D0-POWR3-01', 'manufacturer': '深圳松诺技术有限公司', 'chipid': 'C4DEE2112568'}, 'brandName': 'SONOFF', 'brandLogo': 'https://eu-ota.coolkit.cc/logo/q62PevoglDNmwUJ9oPE7kRrpt1nL1CoA.png', 'showBrand': True, 'productModel': 'POWR320D', 'tags': {'m_74c9_audu': 'on'}, 'devConfig': {}, 'settings': {'opsNotify': 0, 'opsHistory': 1, 'alarmNotify': 1, 'wxAlarmNotify': 0, 'wxOpsNotify': 0, 'wxDoorbellNotify': 0, 'appDoorbellNotify': 1}, 'devGroups': [], 'family': {'familyid': '6310633053e6200009e2548a', 'index': 0, 'members': [], 'roomid': '6310633053e6200009e25489'}, 'shareTo': [], 'devicekey': 'fba936bc-0000-0000-0000-346dd8f1fc2a', 'online': True, 'params': {'bindInfos': {}, 'version': 8, 'current': 1178, 'voltage': 23233, 'power': 300379, 'fwVersion': '1.0.6', 'uiActive': 60, 'ssid': '100 Iot', 'bssid': 'b6:fb:e4:21:cf:3f', 'timeZone': 2, 'switches': [{'outlet': 0, 'switch': 'on'}], 'configure': [{'startup': 'stay', 'outlet': 0}], 'pulses': [{'pulse': 'off', 'switch': 'off', 'outlet': 0, 'width': 500}], 'sledOnline': 'on', 'rssi': -52, 'dayKwh': 282, 'monthKwh': 344, 'threshold': {'actPow': {'min': 10, 'max': 500000}, 'voltage': {'min': 18500, 'max': 26400}, 'current': {'min': 10, 'max': 2000}}, 'operSide': 1}, 'isSupportGroup': False, 'isSupportedOnMP': False, 'deviceFeature': {}, 'host': 'ewelink_100173869c.local.', 'localtype': 'plug'}

The payload variable being populated on line 224 has the following value:

payload = {'sequence': '1663238680000', 'deviceid': '100173869c', 'selfApikey': '123', 'data': {'switches': [{'outlet': 0, 'switch': 'on'}]}}

The log statement on line 255 then gives this result:

2022-09-15 12:44:41 [W] 100173869c => Local4 | {'switches': [{'outlet': 0, 'switch': 'on'}]} <= {'sequence': '1663238680000', 'seq': 1842, 'error': 400, 'encrypt': True} diagnostic.txt

Turning on the switch with cloud configuration works without problem:

2022-09-15 12:40:17 [D] 100173869c => Cloud4 | {'switches': [{'outlet': 0, 'switch': 'on'}]} | 1663238417000

The diagnostic file is attached.

eyesoft avatar Sep 15 '22 11:09 eyesoft

Is problem same now? Try to reboot Hass and device (power off/on). There was some problems with ewelink cloud. I wonder it it can break device for receiving local commands.

AlexxIT avatar Sep 16 '22 04:09 AlexxIT

I have experienced similar behaviour with POW & POWR2 ie inaccessible locally when ewelink service goes down. Configuration auto 2022.9

VimalO avatar Sep 16 '22 05:09 VimalO

eWeLink cloud was down, yes. It seems today is back and all works again

FelisucoVFR avatar Sep 16 '22 06:09 FelisucoVFR

Is problem same now? Try to reboot Hass and device (power off/on). There was some problems with ewelink cloud. I wonder it it can break device for receiving local commands.

Local control is still not working. This problem persist even if ewelink cloud is up and running.

eyesoft avatar Sep 16 '22 07:09 eyesoft

  1. Check you still receiving 400 from device
  2. Reboot Hass. Step 1
  3. Reboot device (power off/on). Step 1

AlexxIT avatar Sep 16 '22 07:09 AlexxIT

  1. Check you still receiving 400 from device

2022-09-16 09:25:18 [W] 100173869c => Local4 | {'switches': [{'outlet': 0, 'switch': 'off'}]} <= {'sequence': '1663313118000', 'seq': 3317, 'error': 400, 'encrypt': True} 2022-09-16 09:25:18 [D] 100173869c => Cloud4 | {'switches': [{'outlet': 0, 'switch': 'off'}]} | 1663313118000

  1. Reboot Hass. Step 1

2022-09-16 09:28:45 [W] 100173869c => Local4 | {'switches': [{'outlet': 0, 'switch': 'off'}]} <= {'sequence': '1663313325000', 'seq': 3320, 'error': 400, 'encrypt': True} 2022-09-16 09:28:45 [D] 100173869c => Cloud4 | {'switches': [{'outlet': 0, 'switch': 'off'}]} | 1663313325000

  1. Reboot device (power off/on). Step 1

2022-09-16 09:35:19 [W] 100173869c => Local4 | {'switches': [{'outlet': 0, 'switch': 'off'}]} <= {'sequence': '1663313718000', 'seq': 3322, 'error': 400, 'encrypt': True} 2022-09-16 09:35:19 [D] 100173869c => Cloud4 | {'switches': [{'outlet': 0, 'switch': 'off'}]} | 1663313718000

eyesoft avatar Sep 16 '22 07:09 eyesoft

Have you ever had this device work locally? Or did the problem only start yesterday?

AlexxIT avatar Sep 16 '22 07:09 AlexxIT

It has never worked locally.

eyesoft avatar Sep 16 '22 09:09 eyesoft

https://github.com/AlexxIT/SonoffLAN/releases/tag/v3.5.1

AlexxIT avatar Mar 31 '23 12:03 AlexxIT