JeroenVdb / homebridge-daikin-cloud

This Homebrige plugin connects to the Daikin Cloud and loads all your devices to be controled via Homebridge and Homekit.
https://www.npmjs.com/package/homebridge-daikin-cloud
Apache License 2.0
40 stars 11 forks source link

Failed to get cloud devices from Daikin Cloud: Failed to login to Daikin Cloud with [<MY EMAIL ADDRESS>] #38

Closed j-dz closed 1 year ago

j-dz commented 1 year ago

Describe The Bug:

I've been using this plugin for the past several months and it has worked perfectly.

However, yesterday, it suddenly stopped working, and I've since been receiving the following message in my Homebridge console:

[DaikinCloud] Failed to get cloud devices from Daikin Cloud: Failed to login to Daikin Cloud with [<MY EMAIL ADDRESS>]: this.log is not a function

I have repeatedly checked my login credentials (email and password) and was able to log in to the Daikin iOS app (https://apps.apple.com/be/app/onecta/id1474811586) with these same credentials every time.

Logs:

{8/28/2023, 1:36:12 PM] [DaikinCloud] Loading accessory from cache: Living Room AC [8/28/2023, 1:36:12 PM] [DaikinCloud] Loading accessory from cache: Bedroom AC [8/28/2023, 1:36:13 PM] [DaikinCloud] --- Daikin info for debugging reasons (enable Debug Mode for more logs --- [8/28/2023, 1:36:13 PM] [DaikinCloud] Failed to get cloud devices from Daikin Cloud: Failed to login to Daikin Cloud with [MY EMAIL ADDRESS]: this.log is not a function [8/28/2023, 1:36:13 PM] [DaikinCloud] --------------- End Daikin info for debugging reasons --------------------

Plugin Config:

{
    "username": "************",
    "password": "************",
    "showExtraFeatures": false,
    "platform": "DaikinCloud"
}

Environment:

Terabyte1385 commented 1 year ago

Interesting. I can't seem to find an issue with the code. Maybe the repo owner @JeroenVdb can help you further.

JeroenVdb commented 1 year ago

I can't seem to reproduce this error. Could you revert to the previous version v1.5.2, restart and see if it then does work? You can do this from the Homebridge UI interface by clicking the wrench icon and selecting "Select Alternate version".

Screenshot 2023-08-31 at 09 01 43

JeroenVdb commented 1 year ago

Excuse me, I was myself not on the latest version when testing. I'm checking what is wrong.

JeroenVdb commented 1 year ago

Also scratch my last comment, can you update to the latest and see if it works again?

craigcullum commented 1 year ago

Can confirm I also have this issue with version 1.6.0

JeroenVdb commented 1 year ago

@craigcullum can you try restarting your instance?

tomaszkr2021 commented 1 year ago

Started happening to me also on 1.5.5 few days ago. Upgrade to 1.6.0 didn't help. Downgrade to 1.5.5 didn't help. Restarting plugin, homebridge and system didn't help. Unfortunatly can't say exactly when it started to fail as there was no real indication for me - I am still using ONECTA as my main app. Devices are still visible in Home app - temp sensor showing old and outdated value, but it's there...

JeroenVdb commented 1 year ago

Just to be sure, did you try to revert to version v1.5.2? You can do this from the Homebridge UI interface by clicking the wrench icon and selecting "Select Alternate version".

To be sure restart the homebridge instance after the version is reverted.

tomaszkr2021 commented 1 year ago

Just to be sure, did you try to revert to version v1.5.2? You can do this from the Homebridge UI interface by clicking the wrench icon and selecting "Select Alternate version".

To be sure restart the homebridge instance after the version is reverted.

I reverted to 1.5.5 (one before 1.6.0). Actually while I am writing this I reverted to 1.5.2 - result is the same. Daikin is changing a lot with their app recently - can this be also change on their back-end that causes this?

image

JeroenVdb commented 1 year ago

If it would be a backend problem with Daikin I would expect everyone to have this problem.

I seem to be able to reproduce the problem. The faulty version seems to be v1.5.3. Other versions work but when I downgrade or upgrade to them I have to restart twice!

So:

  1. v1.6.0 is installed -> works
  2. Install v1.5.3 -> error
  3. Restart Homebridge -> error
  4. Restart Homebridge -> error
  5. Install v1.6.0 -> error
  6. Restart Homebridge -> error
  7. Restart Homebridge -> works

So my next -crazy- suggestion is:

  1. update to the latest version
  2. restart homebridge twice in a row
tomaszkr2021 commented 1 year ago
  1. updated to 1.6.0
  2. restarted homebrige twice - same error
  3. rebooted system - same error
  4. restarted homebridge twice - same error

My system info:

image

JeroenVdb commented 1 year ago

Are you able to jump into a quick video call with me? If you'd rather not we can continue here: https://meet.google.com/kuq-aoko-xcy

tomaszkr2021 commented 1 year ago

I am at work now, can chat and write. Can't do videcalls... ;)

JeroenVdb commented 1 year ago

No problem could you:

  1. Install alternate version "v1.6.1-beta.0 - beta"
  2. Restart Homebridge
  3. Post the debug log between '--- Daikin info for debugging reasons (enable Debug Mode for more logs) ---' and '--------------- End Daikin info for debugging reasons --------------------' (I disabled excessive logging in this release to minimise the noice)
tomaszkr2021 commented 1 year ago

[9/1/2023, 10:34:50 AM] [homebridge-daikin-cloud] --- Daikin info for debugging reasons (enable Debug Mode for more logs) --- [9/1/2023, 10:34:50 AM] [homebridge-daikin-cloud] was not able to initiateDaikinCloudController [9/1/2023, 10:34:50 AM] [homebridge-daikin-cloud] {} [9/1/2023, 10:34:50 AM] [homebridge-daikin-cloud] was not able to initiateDaikinCloudController [9/1/2023, 10:34:51 AM] [homebridge-daikin-cloud] {} [9/1/2023, 10:34:51 AM] [homebridge-daikin-cloud] Found 0 devices in your Daikin Cloud [9/1/2023, 10:34:51 AM] [homebridge-daikin-cloud] --------------- End Daikin info for debugging reasons --------------------

same log after 1st and 2nd homebridge restart

JeroenVdb commented 1 year ago

I'm just going to add more and more logging to try to find the problem. Could you do the same for "v1.6.1-beta.1 - beta"

tomaszkr2021 commented 1 year ago

--- Daikin info for debugging reasons (enable Debug Mode for more logs) --- Write/read Daikin Cloud tokenset from /var/lib/homebridge/daikincloudtokenset.json Daikin Cloud tokenset found at /var/lib/homebridge/daikincloudtokenset.json Cannot patch http-mitm-proxy/lib/ca.js: Error: EACCES: permission denied, open '/usr/lib/node_modules/homebridge-daikin-cloud/node_modules/http-mitm-proxy/lib/ca.js' [9/1/2023, 10:43:55 AM] Homebridge v1.6.1 (HAP v0.11.1) (homebridge-daikin-cloud) is running on port 52235. [9/1/2023, 10:44:00 AM] [homebridge-daikin-cloud] Retrieved new credentials from Daikin Cloud [9/1/2023, 10:44:01 AM] [homebridge-daikin-cloud] Found 5 devices in your Daikin Cloud

then it lists all my devices in a form of:

[9/1/2023, 10:44:01 AM] [homebridge-daikin-cloud] Device found with id: [ID REMOVED] [9/1/2023, 10:44:01 AM] [homebridge-daikin-cloud] name: Kaja [9/1/2023, 10:44:01 AM] [homebridge-daikin-cloud] last updated: Fri Sep 01 2023 10:44:01 GMT+0200 (Central European Summer Time) [9/1/2023, 10:44:01 AM] [homebridge-daikin-cloud] modelInfo: BRP069C4x [9/1/2023, 10:44:01 AM] [homebridge-daikin-cloud] config.showExtraFeatures: true [9/1/2023, 10:44:01 AM] [homebridge-daikin-cloud] config.excludedDevicesByDeviceId: undefined [9/1/2023, 10:44:01 AM] [homebridge-daikin-cloud] Restoring existing accessory from cache: Kaja [9/1/2023, 10:44:02 AM] [homebridge-daikin-cloud] [Kaja] hasSwingModeFeature, verticalSwing: true [9/1/2023, 10:44:02 AM] [homebridge-daikin-cloud] [Kaja] hasSwingModeFeature, horizontalSwing: true [9/1/2023, 10:44:02 AM] [homebridge-daikin-cloud] [Kaja] Device has SwingMode, add Characteristic [9/1/2023, 10:44:02 AM] [homebridge-daikin-cloud] [Kaja] hasPowerfulModeFeature, powerfulMode: true [9/1/2023, 10:44:02 AM] [homebridge-daikin-cloud] [Kaja] Device has PowerfulMode, add Switch Service [9/1/2023, 10:44:02 AM] [homebridge-daikin-cloud] [Kaja] hasEconoModeFeature, econoMode: true [9/1/2023, 10:44:02 AM] [homebridge-daikin-cloud] [Kaja] Device has EconoMode, add Switch Service [9/1/2023, 10:44:02 AM] [homebridge-daikin-cloud] [Kaja] hasStreamerModeFeature, streamerMode: true [9/1/2023, 10:44:02 AM] [homebridge-daikin-cloud] [Kaja] Device has StreamerMode, add Switch Service [9/1/2023, 10:44:02 AM] [homebridge-daikin-cloud] [Kaja] hasOutdoorSilentModeFeature, outdoorSilentMode: true [9/1/2023, 10:44:02 AM] [homebridge-daikin-cloud] [Kaja] Device has StreamerMode, add Switch Service

I removed device ID

JeroenVdb commented 1 year ago

To be clear, is it now working as expected?

tomaszkr2021 commented 1 year ago

Seems so - I just started AC from Home app and I am told (by house residents) that it actually turned on and started cooling. Will run this version for few days, doing some homebridge restarts from time to time... Let's see...

JeroenVdb commented 1 year ago

Ok, I think I have found the bug then. The only strange thing is that you get this error:

Cannot patch http-mitm-proxy/lib/ca.js: Error: EACCES: permission denied, open '/usr/lib/node_modules/homebridge-daikin-cloud/node_modules/http-mitm-proxy/lib/ca.js'

Might be something related to your file system permissions? Or maybe a firewall blocking the proxy file?

I'm now going to revert some debugs I added and include the fix in a v1.6.1 release. If you can let me know if that release is also working that would be great.

tomaszkr2021 commented 1 year ago

I report that this release is working. For that small box with HB I don't use firewall... Permission to ca.js and in that dir are as follows:

drwxr-xr-x 3 root root 4096 Sep 1 11:01 . drwxr-xr-x 7 root root 4096 Sep 1 11:01 .. -rw-r--r-- 1 root root 6882 Sep 1 11:01 ca.js drwxr-xr-x 2 root root 4096 Sep 1 11:01 middleware -rw-r--r-- 1 root root 37432 Sep 1 11:01 proxy.js

As long as it works - I will not bother changing anything as most probably it was like this since ages... Only log was not cought up...

j-dz commented 1 year ago

Hey, sorry for the late response.

I can confirm that the latest release (v1.6.1) also works for me. Thank you!

craigcullum commented 1 year ago

I’ve updated. The error message now says that login failed because Captcha required. On 1 Sep 2023, at 5:15 pm, tomaszkr2021 @.***> wrote: I report that this release is working. For that small box with HB I don't use firewall... Permission to ca.js and in that dir are as follows: drwxr-xr-x 3 root root 4096 Sep 1 11:01 . drwxr-xr-x 7 root root 4096 Sep 1 11:01 .. -rw-r--r-- 1 root root 6882 Sep 1 11:01 ca.js drwxr-xr-x 2 root root 4096 Sep 1 11:01 middleware -rw-r--r-- 1 root root 37432 Sep 1 11:01 proxy.js As long as it works - I will not bother changing anything as most probably it was like this since ages... Only log was not cought up...

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

JeroenVdb commented 1 year ago

@craigcullum to solve the captch think you can try this: https://github.com/Apollon77/daikin-controller-cloud#login-with-e-mailpassword