ohmantics / homebridge-airmega

Homebridge plugin for the Coway Airmega air purifier series
12 stars 2 forks source link

Unable to authenticate. 400 #64

Open moonwatcher opened 4 months ago

moonwatcher commented 4 months ago

Tried using this with a new Airmega 250S.

getting the following error, I assume the API has changed?

[7/23/2024, 4:33:15 PM] [Airmega] [ERROR] Unable to authenticate. 400 - "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"  \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" class=\"\">\n\n<head>\n    <title>Coway - Login</title>\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n    <meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no\">\n    <meta name=\"format-detection\" content=\"telephone=no, address=no, email=no\">\n\n    <meta name=\"title\" content=\"coway\">\n    <meta name=\"keywords\" content=\"coway\">\n    <meta name=\"description\" content=\"coway\">\n\n    <meta property=\"og:title\" content=\"coway\">\n    <meta property=\"og:type\" content=\"website\">\n    <meta property=\"og:url\" content=\"coway\">\n    <meta property=\"og:site_name\" content=\"coway\">\n    <meta property=\"og:description\" content=\"coway\">\n    <meta charset=\"utf-8\">\n\n    <meta name=\"robots\" content=\"noindex, nofollow\">\n\n    <!-- Global site tag (gtag.js) - Google Analytics -->\n    <script\n            async\n            src=\"https://www.googletagmanager.com/gtag/js?id=G-67LG8PXDQZ\"\n    ></script>\n    <script>\n        window.dataLayer = window.dataLayer || []\n        function gtag() {\n            dataLayer.push(arguments)\n        }\n        gtag('js', new Date())\n\n        gtag('config', 'G-67LG8PXDQZ', {\n            send_page_view: false,\n        })\n    </script>\n\n    <!-- Google Tag Manager -->\n    <script async>\n        ;(function (w, d, s, l, i) {\n            w[l] = w[l] || []\n            w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' })\n            var f = d.getElementsByTagName(s)[0],\n                j = d.createElement(s),\n                dl = l != 'dataLayer' ? '&l=' + l : ''\n            j.async = true\n            j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl\n            f.parentNode.insertBefore(j, f)\n        })(window, document, 'script', 'dataLayer', 'GTM-NRTM7JZ')\n    </script>\n\n    <!-- End Google Tag Manager -->\n\n\n\n\n            <link href=\"/auth/resources/aj0g8/login/cw-account/css/common.css?ver=202400150454\" rel=\"stylesheet\" />\n            <link href=\"/auth/resources/aj0g8/login/cw-account/css/member.css?ver=202400150454\" rel=\"stylesheet\" />\n            <link href=\"/auth/resources/aj0g8/login/cw-account/css/account.css?ver=202400150454\" rel=\"stylesheet\" />\n            <link href=\"/auth/resources/aj0g8/login/cw-account/css/login.css?ver=202400150454\" rel=\"stylesheet\" />\n            <script src=\"/auth/resources/aj0g8/login/cw-account/js/jquery-3.6.0.min.js?ver=202400150454\" type=\"text/javascript\"></script>\n            <script src=\"/auth/resources/aj0g8/login/cw-account/js/core-js.3.21.1.min.js?ver=202400150454\" type=\"text/javascript\"></script>\n            <script src=\"/auth/resources/aj0g8/login/cw-account/js/ui.js?ver=202400150454\" type=\"text/javascript\"></script>\n            <script src=\"/auth/resources/aj0g8/login/cw-account/js/common.js?ver=202400150454\" type=\"text/javascript\"></script>\n            <script src=\"/auth/resources/aj0g8/login/cw-account/js/ga-utils.js?ver=202400150454\" type=\"text/javascript\"></script>\n\n\n</head>\n\n<body class=\"\">\n<div id=\"wrap\" class=\"\">\n    <!--  global variable  -->\n\n\n\n    \n    <input type=\"hidden\" id=\"loginOnly\" name=\"loginOnly\" value=\"false\"/>\n    <input type=\"hidden\" id=\"clientName\" value=\"\"/>\n    <!--  //global variable  -->\n    <!-- header -->\n    <header id=\"member_header\" class=\"\">\n        <input type=\"hidden\" id=\"currentLocaleTag\" name=\"currentLocaleTag\" value=\"en\" />\n        <input type=\"hidden\" id=\"currentLocale\" name=\"currentLocale\" value=\"English\" />\n        \n        <div class=\"h_container\">\n            <a href=\"#\" class=\"page_depth\">Page back</a>\n        </div>\n    </header>\n    <!-- //header -->\n\n    <!-- container -->\n    <div id=\"container\" class=\"\">\n        <div id=\"kc-error-message\">\n            <p class=\"instruction\">Client disabled.</p>\n        </div>\n    </div>\n    <!-- //container -->\n\n    <!-- footer -->\n    <!-- //footer -->\n</div>\n</body>\n</html>\n"
nbraunstein commented 4 months ago

Yeah, same for me too. I tried the other way plugin by origamidream with no luck

We've all been waiting for a fix for a while. I think this project might be dead since it hasn't been updated in over a year.

ohmantics commented 4 months ago

You'll just have to be patient with me. It didn't need any changes until late Spring when Coway broke the API.

moonwatcher commented 4 months ago

is it just the api url that changed or has the whole API changed?

nbraunstein commented 4 months ago

You're awesome. Thank you for continuing to support this plug-in.

newhouse commented 3 months ago

You'll just have to be patient with me. It didn't need any changes until late Spring when Coway broke the API.

@ohmantics if it's just something around the authentication bit and/or some URL path changes (vs a deep change in the API) and you can point me in the right direction for the code to change and how to test it, I would be willing to dive in to give it a shot

moonwatcher commented 3 months ago

I suspect it involves sniffing to find out the details. Coway doesn't exactly have a documented API... it's work... I get it. Respect bro. Whenever you have time :)

nbraunstein commented 3 months ago

I was just coming here to check on the status of the update. Thank you everyone who is working on getting this back up and running.

I was about to go buy a new device/different brand, but I'm holding out because the actual product works the best in my opinion. I've been checking for an update once a day 😂

Crossing my fingers!

chrisvanhorn commented 2 months ago

Any hope for an update to this plugin? ❤️

nbraunstein commented 2 months ago

I think this project is dead. The other plugin out there seems to work and was last updated 3 months ago.

He's got a beta test out that works for me and is at least responsive to posts. I don't think this person wants to support this plug-in anymore. Tired getting the runaround, I even offered to pay for his time. Fixing this plug-in shouldn't be rocket science

chrisvanhorn commented 2 months ago

Which project?!On Sep 21, 2024, at 2:00 PM, nbraunstein @.***> wrote: I think this project is dead. The other one seems to work. He's got a beta test out that works for me and is at least responsive to posts.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

ohmantics commented 2 months ago

I think this project is dead. The other plugin out there seems to work and was last updated 3 months ago.

He's got a beta test out that works for me and is at least responsive to posts. I don't think this person wants to support this plug-in anymore. Tired getting the runaround, I even offered to pay for his time. Fixing this plug-in shouldn't be rocket science

Thanks for the premature announcement of my death. I am still working on it. The issue is not "fixing the plugin" but a rewrite because the old code and frankly most of the Homebridge plugins I use do not handle async operations properly and HB eventually traps itself using 100% CPU, requiring a restart every few days. The HB devs have been completely unresponsive to my multiple requests for a proper example of how they expect plugins to work with cloud services since they added obnoxious messages about "this plugin slows down HB" and the like and do that for every plugin I use. I have been endlessly rewriting and trying new approaches to get around that.

I also wasted time messing around with the other plugin and it does not work well for my 400S. It creates HomeKit sensors that do nothing like report incorrect temperature of 32°F. The Korean models are just different.

pinkstrings commented 4 weeks ago

Appreciate the hard work you've put into this.

Anything we can do to support? Any code that's blocking you particularly hard right now?

nbraunstein commented 4 weeks ago

I was actually using the new beta version from Origami dream. It does work but created a bunch of useless sensors.

What was funny though, I actually got my IoCare account banned for what I'm assuming is too my requests when in some kind of HB boot loop. Just said contact customer service 😂 I left it after a couple days of it working, which was a mistake.

I had to create a new account with a different email and re pair it. AH-1512HHS. Now, I can't login to the plugin on homebridge even though my password is correct/same as the previous account, just a different email.

The light button turned the light on but not off (unit still beeped)

Could adjust fan speed and put the device in auto but not back to manual (unit still beeped). Could power the unit off but not on.

Essentially all the buttons were useless, but it was nice to see PM2.5 it in there for a change. I gave up and disabled the plugin

moonwatcher commented 4 weeks ago

I would hardly characterize that as "does work". it might be interesting that it's authenticating but then incorrectly implementing the API.

nbraunstein commented 4 weeks ago

https://github.com/OrigamiDream/homebridge-coway

BastianZim commented 4 weeks ago

@ohmantics Would you be open to create a PR with the work you have done so far? That would allow us to possibly support you or see if we can be of any help. This shouldn't all fall on you although I appreciate that you are undertaking this.