Skip to content
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

Am90` #1

Open
steveb85 opened this issue Oct 6, 2020 · 14 comments
Open

Am90` #1

steveb85 opened this issue Oct 6, 2020 · 14 comments

Comments

@steveb85
Copy link

steveb85 commented Oct 6, 2020

Has anyone tried this with a Winix am90?

@steveb85
Copy link
Author

I"ve been working on this. My AM90 seemed to use different servers, but then i am running into authentication issues. still plugging away at it.

@banzalik
Copy link
Owner

HI, do you still have some issues now?

@banzalik
Copy link
Owner

No activity

@steveb85
Copy link
Author

I got a certain amount through, past the authentication, and i can get server responses, and i manually figured out what they meant, but haven’t been able to figure out how to code that into the plugin, it’s a bit different from the c545, i can control the unit via terminal, and read it, but that’s where i got to, and have to pick it back up again soon.

@banzalik
Copy link
Owner

I can add support Am90, it is not a big deal.

But if you ready to testing, and i need additional information from you.

If you alredy can contrlo by terminal, can you provide for me example of request (with fake devise ID)?

I need to make sure is url is correct.

@banzalik banzalik reopened this Dec 10, 2020
@steveb85
Copy link
Author

That's amazing, sorry it took me a day, had to get it together. So I'll share what i've got.

Here is how the control side works (at least for me)

axios({
method:'post',
url: 'https://smart.us.gw.winixcorp.com:9903/homedevice/control’,
data:
{
“body”: {
“controlData”: “17”,
“flag”: “N”,
“hDId”: “ZEROS20180424000184:72:07:23:3A:0E” // i don't know if this is unique to me, but without it it doesn't work
},
“header”: {
“deviceId" : "DCB12345-A1B1-1AB1-1A12-123A1234A1D1", //insert your device id here, this is a fake
"langCode": "EN", //again i tried taking various parts of this out, and it didn't work for me, so i just kept it as i found it via mitmproxy
"modelName": "iPhone11,8",
"networkKind": "WIFI",
"osKind": "IOS",
"osVer": "14.0.1",
"reqTime": "20201012124531228",
"resolution": "320*568",
'serverUId': "UID0100022637”}
}
})

Control data is as follows.

Power on 1
power off 2
Plasmawave off 18
Plasmawave on 17

Manual - 19

sleep 8
low 4
med 5
high 6
turbo 7
auto 3

As for status, here is how that works.

axios({
method:'post',
url: 'https://smart.us.gw.winixcorp.com:9903/homedevice/status',
data:{ body: {
"hDId": "ZEROS20180424000184:72:07:23:3A:0E" //not sure if this is device specific
},
header:{"deviceId" : "DCB12345-A1B1-1AB1-1A12-123A1234A1D1", //insert your device id here, this is a fake
"langCode": "EN",
"modelName": "iPhone11,8",
"networkKind": "WIFI",
"osKind": "IOS",
"osVer": "14.0.1",
"reqTime": "20201012124531228",
"resolution": "320*568",
'serverUId': "UID0100022637"}}, //crucial to have all these fields in the post header

},)

The return looks something like this

4QBPAAAAcAAAqAWoBQAxODA0MjRWMDAxAQ==

and here is how it's decoded.

Y = OFF (FIRST LETTER)
4 = AUTO (FIRST LETTER)

o = MANUAL LOW
k = manual Medium
i = manual high
h = manual turbo
g= manual sleep

3RD LETTER IS PLASMA = A= off B = on
seemingly randomly, manual sleep also has 8th letter is B not A

as you can see, i got a fair bit done, but then i hit a hard wall, not knowing how to put this into anything other than just using CLI to control it. anything you can do would be awesome.

@steveb85
Copy link
Author

@banzalik is this helpful? Anything else I can do or try?

@steveb85
Copy link
Author

just wanted to check in on this.

@shomegit
Copy link

I am interested in having control over the AM90 as well. I don't know if this helps but I can use a terminal window and this python program https://pypi.org/project/winix/ to control it.

@ecoolman
Copy link

Just a quick note, I installed this plugin last night with my am90, and it worked as is, only needed to input my device id which I grabbed using charles proxy for iOS.

Seems everything is working - in the Home app, I see current AQ, can control speed, toggle on/off, toggle plasma on/off, etc. Great work!

@steveb85
Copy link
Author

@ecoolman thanks for that, I’m going to try again this week! I had a lot of trouble when i first tried it, but glad it worked for you!

@loudestnoise
Copy link

I was able to get my AM90 added by getting the Device ID using the instructions with mitmproxy, but it doesn't seem like I can get the purifier to switch to turbo mode. It does seem to give me the option of Manual v Auto, but when I change it to Manual I don't think it's actually doing it, and it never goes to Turbo. I mostly use my purifier as a white noise maker while I sleep, so Turbo is my optimal speed 😂😂😂
Settings
Controls

@fhughes90
Copy link

I just installed this plugin and used the instructions to retrieve the device_id from the mitmproxy. I can confirm this works for the AM90 model and I seem to have all functionality - turn plasma on/off, fan speed, status of air quality, and power on/off the device.

Only gotcha is I noticed the first time I saved the device_id and rebooted Homebridge, the controls were not working. I went to the AM90 device and noticed some lights were flashing. I cycled through on/off manually on the device and that seemed to fix everything.

@banzalik
Copy link
Owner

@fhughes90 Great! Thanks for your feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants