timdj / samsung_washer

Get token from Samsung ecobubble washer and get notification in Hassio
1 stars 2 forks source link

cert.pem? #1

Closed brayStorm closed 3 years ago

brayStorm commented 4 years ago

Where would I find this?

timdj commented 4 years ago

I didn't want to link or upload the pem for legality reasons but instructions are below:

Get samsung client certificate This can be retrieved by decompiling the samsung android. However someone else has already done the hard work and you can find ac14k_m.pem at

https://github.com/cicciovo/homebridge-samsung-airconditioner

or

https://github.com/SebuZet/samsungrac/tree/master/custom_components/climate_ip

timdj commented 4 years ago

cert.pem == ac14k_m.pem

brayStorm commented 3 years ago

Still can't get this to work. So do I need 2 identical files in the same directory, 1 named cert.pem, and 1 named ac14k_m.pem? The server.py errors out in the absence of a file called cert.py, and step 2's curl command has a reference to the latter.

brayStorm commented 3 years ago

image

timdj commented 3 years ago

@brayStorm Stat seems to be an issue with your version of curl. I used Linux for this. Maybe you can check if the parameters are same for windows version of curl? Or try logging into your home assistant with ssh and run curl from there.

brayStorm commented 3 years ago

I feel like I'm being a useless pest, but getting my washer/dryer status in HA is a mini-holy grail for me. THANK YOU for responding to me at all! Ok, spun up a VM, and I'm getting this; image Is it due to the version of openssl? Should I downgrade, or can I add a flag somewhere or something to force it to accept that cert?

timdj commented 3 years ago

I added ssl.PROTOCOL_SSLv3 could you try again? Also I changed cert name to ac14k_m.pem

brayStorm commented 3 years ago

Now I get this; image

*Edit - I found this in the python docs, might be helpful

Use the default protocol PROTOCOL_TLS with flags like OP_NO_SSLv3 instead.

timdj commented 3 years ago

@brayStorm This all has to do with deprecation of SSLv3 I think. I committed which starts without error here. Could you check if this works for you? https://github.com/timdj/samsung_washer/commit/8557ec62093b3d331d9cd6ccd31c846b8dc78146

I haven't actually tried this with my washer since I don't want to risk not being able to get a new token ;)

brayStorm commented 3 years ago

server.py seems to run fine now. (on right) I am getting error with the curl command in the readme (on left) The washer is on, and connected to wifi. I tried both with the smartcontrol button on and off. I get the same error.

image

**if I run nMap, it does show an open 8888/tcp on the washer's ip. image

timdj commented 3 years ago

@brayStorm Sorry for my late reply. Any luck so far. The curl error is strange and something you should investigate because it really seems it can't connect to that IP. Even though nmap does show.

brayStorm commented 3 years ago

I'm running curl in a vm, and nmap I'm not. I don't see that affecting much though.

timdj commented 3 years ago

@brayStorm certainly seems like you can't connect to the washer from your VM. Can you ping it from your VM?

brayStorm commented 3 years ago

I could not! So I fixed that. Now I can ping from the VM. Now I get this;

image

timdj commented 3 years ago

Someone with same issue: https://github.com/cicciovo/homebridge-samsung-airconditioner/issues/17

brayStorm commented 3 years ago

Long time no speak! I got it WORKINGGGGGG! I had to adjust the cURL command. curl -k -H "Content-Type: application/json" -H "DeviceToken: xxxxxxxxxxx" --cert ac14k_m.pem --insecure -X POST https://192.168.XX.XX:8888/devicetoken/request -H "Host: 192.168.YY.YY:8889"

XX being IP of applicance, YY being IP of device I'm sending the request from. Got working with both Samsung Washer and Dryer. Both dveices were OFF when sending the cURL command. After sending, turned them on, and pushed the Smart Control button.