Open marcinlubojanski opened 3 years ago
Im facing the same issue.
I've found new appid and apikey here https://github.com/AlexxIT/SonoffLAN/blob/master/custom_components/sonoff/sonoff_cloud.py
payload for "userOnline" was changed also a bit.
Once I've changed it it works now
Here is my edited sonoff.py that seems to work now. sonoff.zip
@marcinlubojanski sometimes it work and the other time it shows the error
failed to create the websocket invalid websocket, state cannot be changed
That looks like network issue. Try using different DNS server and maybe increase timeout in socket creation.
wt., 10 maj 2022, 08:22 użytkownik Shishir Chauhan @.***> napisał:
@marcinlubojanski https://github.com/marcinlubojanski sometimes it work and the other time it shows the error
failed to create the websocket invalid websocket, state cannot be changed
— Reply to this email directly, view it on GitHub https://github.com/lucien2k/sonoff-python/issues/27#issuecomment-1121976576, or unsubscribe https://github.com/notifications/unsubscribe-auth/APFJRO6OVUGWAWU2K6NB2QLVJH6A3ANCNFSM4THLAFVA . You are receiving this because you were mentioned.Message ID: @.***>
@marcinlubojanski which version of Websocket are you using? i can't find any with "create_connection" function.
EDIT: it seems to be https://pypi.org/project/websocket-client/. Now Marcin's script works like a charm. Thank you very much mate!
@fgplastina good to hear that :)
Worked for me thx.
Since yesterday I'm able to list devices but switching sockets end with error. If I print output of wsresponse I'm getting this: {"error":406,"sequence":"16043159535"}
Maybe it has something to do with the old appid and secret as mentioned on other issue ?