ohmantics / homebridge-airmega

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

Unable to authenticate. 400 #64

Open moonwatcher opened 1 month ago

moonwatcher commented 1 month 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 1 month 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 1 month 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 1 month ago

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

nbraunstein commented 1 month ago

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

newhouse commented 1 month 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 1 month 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 1 month 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!