question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The component stopped working today I see alot of Bad Requests in the log

See original GitHub issue

So, I see tons of: error 400 and 406 in the log (below) The interesting part is that state does synchronize after some time (if I manually switch on/off or use the app) so it seems they changed protocol maybe.

I’m using a different account to which I shared my devices and not my main account to login I verified that in the app that account works correctly

I tried using both master branch and the dev branch (log below is from dev)

019-12-17 16:56:04 DEBUG (MainThread) [custom_components.sonoff] Received state event change for: 10008d7ce2 2019-12-17 16:56:04 DEBUG (MainThread) [custom_components.sonoff] Device 10008d7ce2change to: {"switch": "off"} 2019-12-17 16:56:04 DEBUG (Thread-2) [custom_components.sonoff] websocket msg: {"error":406,"sequence":"15765945641975293"} 2019-12-17 16:56:04 ERROR (Thread-2) [custom_components.sonoff] websocket error: Connection is already closed. 2019-12-17 16:56:04 DEBUG (Thread-2) [custom_components.sonoff] websocket closed 2019-12-17 16:56:04 DEBUG (Thread-2) [custom_components.sonoff] (re)init websocket 2019-12-17 16:56:06 DEBUG (Thread-2) [custom_components.sonoff] websocket msg: {"error":400,"reason":"Bad Request","apikey":"068468a7-08fe-4e7f-9ace-e357723a788f","sequence":"15765945657868495","actionName":"userOnline"} 2019-12-17 16:56:38 DEBUG (MainThread) [custom_components.sonoff] Received state event change for: 10008d7ce2 2019-12-17 16:56:39 DEBUG (MainThread) [custom_components.sonoff] Device10008d7ce2change to: {"switch": "off"} 2019-12-17 16:56:39 DEBUG (MainThread) [custom_components.sonoff] Received state event change for: 10007f77df 2019-12-17 16:56:39 DEBUG (MainThread) [custom_components.sonoff] Device10007f77dfchange to: {"switch": "off"} 2019-12-17 16:56:39 DEBUG (MainThread) [custom_components.sonoff] Received state event change for: 10008d79ea 2019-12-17 16:56:39 DEBUG (MainThread) [custom_components.sonoff] Device10008d79eachange to: {"switch": "off"} 2019-12-17 16:56:39 DEBUG (MainThread) [custom_components.sonoff] Received state event change for: 1000333ca7 2019-12-17 16:56:39 DEBUG (MainThread) [custom_components.sonoff] Device1000333ca7change to: {"switch": "off"} 2019-12-17 16:56:39 DEBUG (MainThread) [custom_components.sonoff] Received state event change for: 1000856dae 2019-12-17 16:56:39 DEBUG (MainThread) [custom_components.sonoff] Device1000856daechange to: {"switch": "off"} 2019-12-17 16:56:39 DEBUG (MainThread) [custom_components.sonoff] Received state event change for: 1000857248 2019-12-17 16:56:39 DEBUG (MainThread) [custom_components.sonoff] Device1000857248change to: {"switch": "off"} 2019-12-17 16:56:39 DEBUG (Thread-2) [custom_components.sonoff] websocket msg: {"error":406,"sequence":"15765945990022745"} 2019-12-17 16:56:39 ERROR (Thread-2) [custom_components.sonoff] websocket error: Connection is already closed.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:48 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
peterbugacommented, Dec 18, 2019

houston we have a problem” type of situation here 😑

unfortunately the timing is quite bad for me, i’ll try to take a look at it but i’m quite swamped today in particular… weekend the latest

2reactions
ashoktvmcommented, Dec 20, 2019

i found a fix , you need to add : ‘appid’: ‘oeVkj2lYFGnJu5XUtWisfW4utiN4u9Mq’, to the payload of ws on open. (this is where i found it : https://github.com/CoolKit-Technologies/apiDocs/blob/28e8c33cbb70d63651b8824539ff0b4f28a4aca4/pages/mydoc/application.md)

interesting! i wonder why this change happens only for as or cn regions, did they forced you to update the app recently? can anyone downgrade the eWeLink app an check if it still works?

i’m going to push this little change to dev branch for now as i don’t know how it affect the other regions for now. it does look like they are deploying different server versions for some reason.

thanks @moshezvili and sorry everyone for waiting i cannot be all the time available ready-for-action (this is just a hobby project)

We are really happy that you find this method. Thanks from the bottom of my heart for doing this

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix a 400 Bad Request Error (Causes and Fixes)
The 400 Bad Request error indicates that the server cannot or process the request due to a client error. Read about the common...
Read more >
What is HTTP error 400 and how do you fix it? - IT PRO
If you can't log into a website you previously visited, it means the cookie containing your log in data is no longer valid....
Read more >
How to Fix the 400 Bad Request Error
The 400 Bad Request error means that the request you sent to the website server to view the page was somehow incorrect.
Read more >
Access and Error Logs - The Ultimate Guide To Logging
Contains information about requests coming in to the web server. ... most valuable log fields when monitoring server health or for troubleshooting issues....
Read more >
spring rest Handling empty request body (400 Bad Request)
rest.spring.exception it started working. @ControllerAdvice public class SpringRestExceptionHandler { @ExceptionHandler(NoHandlerFoundException.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found