-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to detect encryption #61
Comments
I'm not sure what is going on here, the error means that the device responded with a simple We are investigating something similar in #53, and one idea is that we need to add an artificial sleep between the API calls. If you have some spare time, you can try running the code in this PR that adds an extra delay. Maybe this solves your problem too. |
I am seeing similar symptoms but maybe not the same cause. Not long after getting the new washing machine (last week), I tried using the CandySimplyFi-tool to successfully get the key and was able to use that key to read the json payload (properly). It worked for days. At the weekend, I tried to set up this integration but it failed with similar symptoms to this issue. Then, when I tried the tool again, it also failed. Tonight, I tried using curl directly and found that calling:
However, calling:
returns
Thus, asking for encrypted doesn't return encrypted but asking for no encryption returns an error! I guess that some kind of firmware update happened after it had been connected to the WIFI for a little while and the behaviour changed as a result? |
Ah, I see that the code already tries to handle this encrypted / not encrypted scenario. I tried commenting out everything in the first try block to make it skip the encrypted=0 case and I was able to add the integration but the sensor doesn't work. I then used the 5s sleep from the PR you linked (restoring the first try block) and it resulted in the same thing (integration was added, sensor fails to update). The logs in both cases are the same:
FWIW, I can rapidly and repeatedly curl the JSON status and there is no error. |
I am not sure how you go about testing a PR in HASS. Tried dumping the changed init.py into custom components but doesnt seem to like changes like that. |
I think I fixed the problem with handling encrypted=1 but no key. The status() method assumed that key="" means not encrypted so I changed it to match the detect_encryption() logic where there is slightly different processing for encrypted with and without key as follows:
I now have the sensors working in HA (though I note that the time remaining sensor is converting the input in minutes to hours but reporting it as minutes). FWIW, I wonder whether there should be an explicit call to |
Thank you @gee-jay-bee for the very detailed investigation, that was indeed a bug in the The main branch doesn't have any sleep commands between the API calls yet, I'm hoping that this other fix is going to solve at least some of the problems. |
This did not resolve my issue. Updated HACS, HASS and Redownloaded your Candy integration, then a restart. After entering IP address in flow im still getting "Failed to detect encryption, check logs"
I can get the same output that curl | xxd gives before running it through xorknown.py in python using:
If I am reading your code correctly at this point in detect_encryption it tries connection without encryption and gets a bad response (line 62) but then fails the next get request with encryption after the except (line 69). I am very much a beginner and why this is happening I do not know. |
Hi everyone I have a Candy clothes washer model GVFWFL4139WHR-12. I have downloaded the Candy SimplyFi addon from HACS, but when I want to add the integration, I receive the following error: "Failed to detect encryption". I have the correct IP, it responds well to the sentence: With encrypted=0 I receive as response Trying to decode the response received with "encryption=1" on the website https://www.online-python.com/pm93n5Sqg4 I get no response. The integration never asks me for the KEY in v0.7.0 Now I do in master version also with error. http://192.x.y.z/http-read.json?encrypted=1 116F626D4E18190A101412290D100F11180B0B014E5116666E6868473B0F280C3916091019184F5146504349616C676C48271A164E514F5951544349616C676C482F0907042609495E435347406B646C634038164E514F5A56434D68666F67473A10380C4E514F5D464D6C6F656F4C3626071E010049574956545447406B646C63403C01011B4F51465354504E4A636F636B4A371C02033814435B475E535B47466F626D6549221B1050435F4E564C496768616D4E241D1F56435B475C444268606B6146231B1958465B43554E4A636F636B4A2B1C1F59495E435147406B646C63402714185E4F5146514349616C676C482D18105A49574954434D68666F674725121C534E514F5B464D6C6F656F4C2A1A16504656495D49486C6B6C65443D110F03054656495D49486C6B6C65442A1713364A5E4E5F4F47696B686C4E220B093C03044656495F5E51434D68666F674738070530050608495E435047406B646C63403A010F021D0E2D05435F4E564C496768616D4E28050E070A34153F120F110F4052465C4960616D1C6C6F11 |
Same problem here , i tried with 0.7,main and 0.62 and same problem: `Logger: custom_components.candy.config_flow Server disconnected During handling of the above exception, another exception occurred: Traceback (most recent call last):
|
Solved with #54 |
Hi What I see is that every time I run the code http://IP/http-read.json?encrypted=1 the response changes. I couldn't get the CandySimplyFi-tool to work either the python site to obtain the key. |
Try with the latest update, it fixed a similar issue for me |
Hi With last version I' had the same error that in #61 (comment) |
Same here, with previo ya versión, chamging manifest.json line 8, the problem was solved. Reintentando la configuración: Error communicating with API: TimeoutError() |
Hello everyone 👋 I released version 0.8.0 that contains API rate-limiting, which is the long-term fix for those who had to add the The rate limiter is set up to only allow 1 request every 3 seconds, I think this will be a good start. If you want to tweak the value, you can find it here:
|
Hi Candy Simply-Fi tool by Melvin Groenendaalerror: connect If I try to add it to HA, I get the Failed to detect encryption, check logs The machine works fine with the hOn app. |
@dennisnn87 if even the CLI tool can't connect to your appliance then I don't think your problem is related to this integration. |
Any ideas what the problem could be?Best regards l Med venlig hilsenDennis Nygaard NielsenDen 30. nov. 2022 kl. 08.32 skrev Olivér Falvai ***@***.***>:
@dennisnn87 if even the CLI tool can't connect to your appliance then I don't think your problem is related to this integration.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I have a Candy washing machine and when I put it on "Wifi" mode, it lasts for 5 or 10 minutes before it goes standby. So you have to be quick configuring everything, otherwise, Home Assistant will not recognize it. Anyway this Washing machine automation is very weird. One the bright side, it's using an ESP device, so maybe it can be Tasmotized! |
@SirLouen I find I get more reliable responses from the machines API when a manually set program is running. Not sure why this is. In Wifi mode it can take me a few requests to get a response with curl. It has been a year though and I still have not got this integration working. This update fails differently to all previous versions. After entering IP in the dialogue flow it just hangs. No responses and no errors. This locked up all of Home Assistant even after closing the box and restarting home assistant. I had to reboot to clear it. No errors showing in logs. I still use the python script that I wrote to test responses a year ago. A few modifications and I can call it with a command line sensor and that works fine. Not as robust as the integration but does the job for me. I tried comparing what my script does differently but nothing obvious jumps out. The code is here if anybody want to have a go at it. |
Logger: custom_components.candy.config_flow Cannot connect to host 192.168.1.28:80 ssl:default [Connect call failed ('192.168.1.28', 80)] The above exception was the direct cause of the following exception: Traceback (most recent call last): |
Getting Failed to detect encryption after entering IP in config flow.
I have obtained the key and can manually get JSON data in HASS terminal with:
JSON values are:
Apologies if I have missed something obvious. Im pretty new to all this.
The text was updated successfully, but these errors were encountered: