Open Eikkargh opened 1 week ago
Hi Eikkargh how are you?
I've made some progress with the commands side of things. I used an android app "PCAPdroid" to sniff packets sent from my phone to the Hoover servers. Happy to say I have got commands 'run a 15min wash', 'pause', and 'stop' to work. The best thing is the command executes immediately once sent, that is compared to the app commands which can take a few seconds to travel through the Hoover servers and back to the machine.
Methodology
Commands I have decrypted so far: 14' Wash "Write=1&StSt=1&DelVl=0&PrNm=10&PrCode=39&PrStr=Rapid Care 14'&TmpTgt=30&SLevTgt=1&SpdTgt=8&OptMsk1=0&OptMsk2=0&Lang=1&Stm=0&Dry=0&ED=0&RecipeId=0&StartCheckUp=0&DispTestOn=1" Pause "encrypted=0&Pa=1" Stop "Write=1&StSt=0&PrNm=10" Resume "encrypted=0&Pa=0" You could use the format of the above commands and insert known values to set (custom?) programmes without having to sniff them first. For example, replace "TmpTgt=30" with "TmpTgt=40" to change from 30 to 40 degC wash temperature.
Successful execution "{"response":"SUCCESS"}" Failed execution due to not in remote control mode "{"response":"READ ONLY"}"
To send a command to your machine use the following format "http://192.168.X.XX/http-write.json?encrypted=1&data=ENCRYPTED_COMMAND_GOES_HERE"
The next step should be to check the above can be reliably replicated on your model and then figure out how to combine this process into something Home Assistant can execute from a user input within the Home Assistant UI.
Excellent. Sounds doable. Ill give it a go over the next few days.
Best route seems to be to compile the command as a string in Home Assistant. A few helper input_select
, input_button
and a shell_command
would do this. Ill need to adjust the python script to accept the command a string as an argument, encrypt it, send it and return the response. Pretty sure I can come up with something.
For each command I've used an input button and a rest command as a temporary implementation. Using Mushroom Chips, it looks quite clean. I'd recommend using a confirmation dialog to prevent accidents.
Feels like big progress being able to both view data and control the machine from within HA!
That is plenty for the way I use my machine. Would be fun to be able to do everything the app can do just for completeness. Ill have to see if my machine has the same command format.
Add commands?
Originally posted by @BenGlossop09 in https://github.com/Eikkargh/Candy-API-to-JSON/issues/5#issuecomment-2352374357