PrPh value of 10 = Spin
Does any one have a full set of attribute and sensor templates to bring all of the data in to Home Assistant?
I’ve got the decrypted JSON from my new washer/dryer but am not sure of the best way to bring this all in to home assistant in one go.
Thanks
Hi everyone, I’m seeing a great job of integrating Candy / Hoover appliances into Home Assistant. I can watch in admiration as my skills stop much earlier.
I would like to ask you if one day it will also be possible to control pause / stop / restarting during a wash via Home Assistant.
Thank you
Hi @dzamlo, thanks for the help so far
I’ve downloaded your script and would like to test it using a text file, could you please possibly convert the following lines to read a text file that resides in my appdeamon/apps/
folder called hotpoint.txt
res = requests.get(
"http://" + appliance_ip + "/http-" + command + ".json?encrypted=1",
timeout=request_timeout,
return json.loads(self.decrypt(codecs.decode(res.text, "hex"), encryption_key))
def decrypt(self, cipher_text, key):
Oh, the file will consist of this:
13616F684E1A170A13111222320318064A561E6C66606A49341000120A350228014E5F435D4B4F666D6D6844260D0F070B0920131E06110E455E43235540476362656C433F1D021F08203607160A49544A5E474D61636A624529041204210A1C010F0A43564B53494B696B6F6C40381A091E1132180613495D465144496F6167614E311309000D3E090B435C4752494265666C684E2C0004455E4356474E6664616547311E0604190609435C4732594C44616F68654B261313160022171B49544A5C474D61636A62452B11030B2604011A2315154E53415B45486C6C6C6B492A0D0004183F1D021913465B445540476362656C433E0C0E3F0E0904445F405A5D584E496C66606A492A0D12153603071A4A5647504E456E616E6D432B0C11183C010216044E53415B45486C6C6C6B492118090B25030611495D465144496F6167614E37041F0C17495D465144496F6167614E2609090A083E17465B445540476362656C431E5841514555434A686862674A1E5743564B53494B696B6F6C40195D4A5647534E456E616E6D43145140514C594E496C66606A491551435C4752494265666C684E1B55495D465044496F6167614E17564E53415845486C6C6C6B491C504E5F435C4B4F666D6D6844175B49544A22302D204B4F666D6D684417535E4C524E544361636A166A6E1C
which I get by going to this address:
http://192.168.0.180/http-read.json?encrypted=1
I know it’s a bit of an ask, but I’ll study it and see where I’ve been going wrong for the past few hours
Sorted, took hours, but sorted.
def get_data(self, command):
with open('//config/appdaemon/apps/hotpoint.txt', 'r') as file:
data = file.read().replace('\n', '')
return json.loads(self.decrypt(codecs.decode(data, "hex"), encryption_key))
I’m not expert, but I can’t see that happening for a while, if ever, as we’re only reading info at the moment.
Just to thank all the people involved for providing info on accessing Candy appliances.
I’ve implemented set of sensors, scripts and automations for this but I find it to cumbersome and somewhat unreliable, so I’m now developing code that I hope will soon mature enough to be ready to be used as a HA custom component/integration for this purpose.
I decided to wrap around raw response, to provide a bit more friendly info, so it reports something like this (for laundry washer), language aware:
{
'Status': 'Idle',
'Finish': '03-22-2021 23:27:24',
'Phase': 'Preparation',
'Program': 'Perfect Cotton',
'Remaining': 59.0,
'SpinSpeed': 800,
'Temperature': 40
}
Regarding occasional drops or inaccessibility of appliance endpoint - it disconnects from network when there’s nothing to update for some time, whether it’s idling or running program.
Slightly off topic but does anyone know how to reset the Wifi on a Candy/Hoover appliance when you can’t connect to it, e.g. you’ve changed ISP and your SSID etc. have changed? I’ve seen a Hoover doc that says:
" RESET:
This is a combination of two buttons that
you press simultaneously to restore the WiFi system to the “default” status."
But doesn’t say which two buttons. It does look like the sequence to set up the Wi-Fi in the first place and get the ‘rr’ prompt but I don’t know which two keys to press, I think I’ve tried all of them. My Hoover HBTDW H7A1TCE-80 tumble dryer has the following buttons left to right:
- Time Selection
- Memory
- Delay Start
- Drying Selection
- Rapids
- Best ironing
Anyone know?
Hi,
Someone manage to pause/stop the machine ?
Best Regards,
Fernando Gomes
Hi
I’ve been running through the guidance on here (thanks!) as I would like to show the remaining time & stop start state of my washer in Home Assistant.
- I downloaded the xorknown py script
- Then I ran - curl -s http:///http-read.json?encrypted=1 | xxd -r -p > ./crypted.txt
- Tried to find key using various combinations - ./xorknown.py ./crypted.txt ‘{"Status’ 16 etc. but no joy
- Decided to check the contents of the crytped.txt file and notice its already in plain text
#cat crypted.txt
{
“statusLavatrice”:{
“WiFiStatus”:“1”,
“Err”:“255”,
“MachMd”:“1”,
“Pr”:“15”,
“PrPh”:“0”,
“SLevel”:“2”,
“Temp”:“90”,
“SpinSp”:“4”,
“Opt1”:“0”,
“Opt2”:“0”,
“Opt3”:“0”,
“Opt4”:“0”,
“Opt5”:“0”,
“Opt6”:“0”,
“Opt7”:“0”,
“Opt8”:“0”,
“Steam”:“0”,
“DryT”:“0”,
“DelVal”:“255”,
“RemTime”:“136”,
“RecipeId”:“0”,
“CheckUpState”:“0”
}
What options have I got to get this info into HA please ?
If you read posts further up, like mine and many others you will see what “Pr”, “PrPh” etc a, means.
“RemTime” is 136 seconds
“MachMd” 1 means “Not yet started” Machine is on but no program has been selected or started.
Hi, that could be very interesting to be able to set machine status not only reading updated values!
Anyone able to POST to the machine?
Thanks!
I only tested the following on a washer-dryer, it may or may not apply to other candy appliances.
The first thing is that the appliance must be in remote control mode. On mine, this is done using the program selection wheel. This also means that you cannot stop/pause remotely a program launched manually.
To control the appliance you send GET
request to the http-write.json
end point.
Then it depends if you appliance works with encrypted=0
or not. If this works, you pass your arguments normally. Otherwise you make a string with all you argument, encrypt it, encode it in hex and send that as a data argument (just check the example below).
Now, for the arguments, it’s complicated. See the getParameterString
of the various *Command
classes of the application for the details.
It seems that you can start some stuff that you cannot start manually, like a program to wash the machine
To start the machine ():
curl -v 'http://espressif.lan/http-write.json?encrypted=0&Write=1&StSt=1&DelVl=60&PrNm=13&PrCode=77'
or with encryption (the key is is full of zero)
curl -v 'http://espressif.lan/http-write.json?encrypted=1&data=57726974653d3126537453743d312644656c566c3d36302650724e6d3d3133265072436f64653d3737'
To stop the machine (the app add a PrNm parameter, it doesn’t seems to be useful for my appliance):
http://espressif.lan/http-write.json?encrypted=0&Write=1&StSt=0&DelMd=0
Nice! I’ll get a try! thanks
Hi.
Did somebody try with oven?
curl -s http://192.168.168.11/http-write.json?encrypted=1\&Write=1\&RecipeId=NULL\&RecipeStep=0\&Selettore=0\&Program=1\&TempSet=20\&TimeProgr=60\&StartStop=1 | xxd -r -p > ./crypted2.txt && ./xorknown.py crypted2.txt --key=xxxxxxxx
I got
Key length: 16 Partial Key: xxxxxxxx Plaintext: {"response":"SUCCESS"}
But not works…
I see you use ‘?encrypted=1&data=57726974653…’
How do you encrypt the data field?
The same way the machine does it.
Because of the key I set on my machine, I don’t need to actually encrypt it. But I still need to hexlifiy it:
s="Write=1&StSt=1&DelVl=60&PrNm=13&PrCode=77"
binascii.hexlify(s.encode())
I think the actual encryption is the same as the decyption so you can likely use the same code. For example (not tested):
def decrypt(cipher_text, key):
decrypted = []
for i in range(len(cipher_text)):
decrypted.append(cipher_text[i] ^ key[i % len(key)])
return decrypted
binascii.hexlify(bytes(decrypt(s.encode(), b'\0')))
Hi.
My oven returns “TempRead” field(temperature read). Whene oven is off, then this value is between 320 and 340. When over is on, this value go over 700(with selected temperature = 250 celsius).
How can I do to interpret this value? 340 fahrenheit in celsius are about 100 degree … it’s impossible if oven is off.
With oven i can’t set TempSet.
curl -s http://x.x.x.x/http-write.json?encrypted=0\&RecipeId=NULL\&RecipeStep=0\&Selettore=3\&Program=11\&TempSet=208\&RemainingTimeProgr=10\&TimeProgr=0\&StartStop=1
With http-read.json i got TempSet=0
{"statusForno":{
"StatoWiFi":"1",
"CodiceErrore":"E0",
"RecipeId":"NULL",
"RecipeStep":"0",
"StartStop":"1",
"Pausa":"0",
"SicurezzaBambini":"0",
"Selettore":"3",
"Program":"11",
"TempSet":"0",
"TempRead":"350",
"TempSetRaggiunta":"0",
"DelayStart":"0",
"RemainingTimeProgr":"10",
"ora":"19",
"min":"55",
"sec":"53",
"TimeProgr":"10",
"FWver":"004B",
"ts":"0"
}
}
Does somebody know how fix it?
If you got the 70 while the oven was still heating, I would guess the value is in tenth of degree celsius (320=32°C, 700=70°C).
Otherwise you could measure the temperature at various point during heating and get the value returned by the api at the same time. And then plot the values from the api against the real values and see if this helps.
From my VERY limited experience with the http-write.json endpoint this could be because you are missing some mandatory argument(Write=1 for examples, or something to start the program), the value of an argument is not valid, the values of multiple arguments are incompatible, your machine doesn’t support this endpoint with encrypted=0.
It may also be unsupported for safety reasons.