This python script is designed to communicate with Candy/Hoover washer dryers to produce a JSON readable by Home Assistant.
Tested and working on:
To obtain the key for the machine I used: xorknown.py from: @Alamot.
For most reliable responses, getting the key should be done while the machine is running a program.
curl -s http://CANDY_IP/http-read.json?encrypted=1 | xxd -r -p > ./coded.txt
./xorknown.py ./coded.txt '{"statusLavatric' 16
Plaintext: {
"statusLavatrice":{
"WiFiStatus":"0",
"Err":"255",
"MachMd":"1",
"Pr":"4",
"PrPh":"0",
"SLevel":"255",
"Temp":"60",
"SpinSp":"10",
"Opt1":"0",
"Opt2":"0",
"Opt3":"0",
"Opt4":"0",
"Opt5":"0",
"Opt6":"0",
"Opt7":"0",
"Opt8":"0",
"Steam":"0",
"DryT":"0",
"DelVal":"255",
"RemTime":"59",
"RecipeId":"0",
"CheckUpState":"0"
}
}
candy.py gets the data, decodes it and strips down the JSON to meet Home Assistants 255 character limit on sensors.
To set up in Home Assistant you can use the sensor:
command_line:
- sensor:
name: 'Candy Washer Dryer'
scan_interval: 60
command_timeout: 30
command: python3 ./pyscript/candy.py
value_template: '{{ value_json }}'
json_attributes:
- WiFiStatus
- Err
- MachMd
- Pr
- PrPh
- Temp
- SpinSp
- RemTime
- DryT
- DelVal
- TotalTime
This may be different on some machines. Yaml exmaples for test machines are above. If your machine is not listed please raise an issue with a copy of your decoded output.