merdok / homebridge-miot

Homebridge plugin for devices supporting the Xiaomi miot protocol
MIT License
388 stars 61 forks source link

Could not retrieve device list from i2 server #368

Closed ahmadnazirafiq closed 1 year ago

ahmadnazirafiq commented 1 year ago

I have recently updated the plugin to version 1.4.0 and it was working fine despite some breaking changes as stated. However, after a few hours later, some of the miot devices (especially those that rely on MiCloud) doesn't work in the Home app nor in Homebridge.

When I try to click on Plugins > MIOT > Discover All Devices via MiCloud, this is what I get:

Screenshot 2022-10-28 at 2 34 51 AM

I didn't add anything or modifying anything on Xiaomi account. I'm not sure what the problem is. Homebridge said it can still connect to MiCloud as stated below:

[28/10/2022, 02:47:29] [homebridge-miot] [Utilities] Successfully connected to MiCloud! Setting up miot device from MiCloud connection! [28/10/2022, 02:47:29] [homebridge-miot] [Fountains] Successfully connected to MiCloud! Setting up miot device from MiCloud connection! [28/10/2022, 02:47:29] [homebridge-miot] [Stand Fan] Successfully connected to MiCloud! Setting up miot device from MiCloud connection! [28/10/2022, 02:47:29] [homebridge-miot] [Multimedia] Successfully connected to MiCloud! Setting up miot device from MiCloud connection! [28/10/2022, 02:47:29] [homebridge-miot] [Mom’s A/C°] Successfully connected to MiCloud! Setting up miot device from MiCloud connection! [28/10/2022, 02:47:29] [homebridge-miot] [Ariff's A/C°] Successfully connected to MiCloud! Setting up miot device from MiCloud connection! [28/10/2022, 02:47:29] [homebridge-miot] [Robot Vacuum] Successfully connected to MiCloud! Setting up miot device from MiCloud connection! [28/10/2022, 02:47:29] [homebridge-miot] [Dehumidifier] Successfully connected to MiCloud! Setting up miot device from MiCloud connection! [28/10/2022, 02:47:29] [homebridge-miot] [Nazir's A/C°] Successfully connected to MiCloud! Setting up miot device from MiCloud connection!

merdok commented 1 year ago

You would need to post a debug log. The messages indicate that the plugin can connect to your MiCloud account but that does not mean the device can be accessed over the server. Might be that something broke with the i2 server temporary?

ahmadnazirafiq commented 1 year ago

I have no idea what is i2 server, could it be something from Xiaomi's end? It was working just fine almost the entire day. Here's the debug log:

[28/10/2022, 05:05:07] [homebridge-miot] [Utilities] Log in to MiCloud! [28/10/2022, 05:05:07] [homebridge-miot] [Utilities] (MiCloud) Log in to MiCloud with username ahmadnazirafiq@me.com. Request timeout: 5000 milliseconds. [28/10/2022, 05:05:07] [homebridge-miot] [Nazir's A/C°] Log in to MiCloud! [28/10/2022, 05:05:07] [homebridge-miot] [Nazir's A/C°] (MiCloud) Log in to MiCloud with username ahmadnazirafiq@me.com. Request timeout: 5000 milliseconds. [28/10/2022, 05:05:07] [homebridge-miot] [Robot Vacuum] Log in to MiCloud! [28/10/2022, 05:05:07] [homebridge-miot] [Robot Vacuum] (MiCloud) Log in to MiCloud with username ahmadnazirafiq@me.com. Request timeout: 5000 milliseconds. [28/10/2022, 05:05:07] [homebridge-miot] [Stand Fan] Log in to MiCloud! [28/10/2022, 05:05:07] [homebridge-miot] [Stand Fan] (MiCloud) Log in to MiCloud with username ahmadnazirafiq@me.com. Request timeout: 5000 milliseconds. [28/10/2022, 05:05:07] [homebridge-miot] [Fountains] Log in to MiCloud! [28/10/2022, 05:05:07] [homebridge-miot] [Fountains] (MiCloud) Log in to MiCloud with username ahmadnazirafiq@me.com. Request timeout: 5000 milliseconds. [28/10/2022, 05:05:07] [homebridge-miot] [Ariff's A/C°] Log in to MiCloud! [28/10/2022, 05:05:07] [homebridge-miot] [Ariff's A/C°] (MiCloud) Log in to MiCloud with username ahmadnazirafiq@me.com. Request timeout: 5000 milliseconds. [28/10/2022, 05:05:07] [homebridge-miot] [Dehumidifier] Log in to MiCloud! [28/10/2022, 05:05:07] [homebridge-miot] [Dehumidifier] (MiCloud) Log in to MiCloud with username ahmadnazirafiq@me.com. Request timeout: 5000 milliseconds. [28/10/2022, 05:05:07] [homebridge-miot] [Multimedia] Log in to MiCloud! [28/10/2022, 05:05:07] [homebridge-miot] [Multimedia] (MiCloud) Log in to MiCloud with username ahmadnazirafiq@me.com. Request timeout: 5000 milliseconds. [28/10/2022, 05:05:07] [homebridge-miot] [Mom’s A/C°] (MiCloud) Login step 1 [28/10/2022, 05:05:07] [homebridge-miot] [Utilities] (MiCloud) Login step 1 [28/10/2022, 05:05:07] [homebridge-miot] [Robot Vacuum] (MiCloud) Login step 1 [28/10/2022, 05:05:07] [homebridge-miot] [Nazir's A/C°] (MiCloud) Login step 1 [28/10/2022, 05:05:07] [homebridge-miot] [Stand Fan] (MiCloud) Login step 1 [28/10/2022, 05:05:07] [homebridge-miot] [Dehumidifier] (MiCloud) Login step 1 [28/10/2022, 05:05:07] [homebridge-miot] [Fountains] (MiCloud) Login step 1 [28/10/2022, 05:05:07] [homebridge-miot] [Ariff's A/C°] (MiCloud) Login step 1 [28/10/2022, 05:05:07] [homebridge-miot] [Multimedia] (MiCloud) Login step 1 [28/10/2022, 05:05:07] [homebridge-miot] [Nazir's A/C°] (MiCloud) Login step 2 [28/10/2022, 05:05:07] [homebridge-miot] [Dehumidifier] (MiCloud) Login step 2 [28/10/2022, 05:05:07] [homebridge-miot] [Stand Fan] (MiCloud) Login step 2 [28/10/2022, 05:05:07] [homebridge-miot] [Mom’s A/C°] (MiCloud) Login step 2 [28/10/2022, 05:05:07] [homebridge-miot] [Fountains] (MiCloud) Login step 2 [28/10/2022, 05:05:07] [homebridge-miot] [Utilities] (MiCloud) Login step 2 [28/10/2022, 05:05:07] [homebridge-miot] [Multimedia] (MiCloud) Login step 2 [28/10/2022, 05:05:07] [homebridge-miot] [Ariff's A/C°] (MiCloud) Login step 2 [28/10/2022, 05:05:07] [homebridge-miot] [Robot Vacuum] (MiCloud) Login step 2 [28/10/2022, 05:05:08] [homebridge-miot] [Nazir's A/C°] (MiCloud) Login step 3 [28/10/2022, 05:05:08] [homebridge-miot] [Nazir's A/C°] (MiCloud) Login successful! [28/10/2022, 05:05:08] [homebridge-miot] [Nazir's A/C°] Using server country: cn [28/10/2022, 05:05:08] [homebridge-miot] [Nazir's A/C°] Successfully connected to MiCloud! Setting up miot device from MiCloud connection! [28/10/2022, 05:05:08] [homebridge-miot] [Nazir's A/C°] Fetching device info from the MiCloud! [28/10/2022, 05:05:08] [homebridge-miot] [Nazir's A/C°] Connection to MiCloud device failed! [28/10/2022, 05:05:08] [homebridge-miot] [Nazir's A/C°] Error: error:0308010C:digital envelope routines::unsupported [28/10/2022, 05:05:08] [homebridge-miot] [Nazir's A/C°] Error during connection! Retrying in 60 seconds! [28/10/2022, 05:05:08] [homebridge-miot] [Nazir's A/C°] (MiCloud) Logout from MiCloud for username ahmadnazirafiq@me.com [28/10/2022, 05:05:08] [homebridge-miot] [Nazir's A/C°] Device diconnected! [28/10/2022, 05:05:08] [homebridge-miot] [Stand Fan] (MiCloud) Login step 3 [28/10/2022, 05:05:08] [homebridge-miot] [Stand Fan] (MiCloud) Login successful! [28/10/2022, 05:05:08] [homebridge-miot] [Stand Fan] Using server country: cn [28/10/2022, 05:05:08] [homebridge-miot] [Stand Fan] Successfully connected to MiCloud! Setting up miot device from MiCloud connection! [28/10/2022, 05:05:08] [homebridge-miot] [Stand Fan] Fetching device info from the MiCloud! [28/10/2022, 05:05:08] [homebridge-miot] [Stand Fan] Connection to MiCloud device failed! [28/10/2022, 05:05:08] [homebridge-miot] [Stand Fan] Error: error:0308010C:digital envelope routines::unsupported [28/10/2022, 05:05:08] [homebridge-miot] [Stand Fan] Error during connection! Retrying in 60 seconds! [28/10/2022, 05:05:08] [homebridge-miot] [Stand Fan] (MiCloud) Logout from MiCloud for username ahmadnazirafiq@me.com [28/10/2022, 05:05:08] [homebridge-miot] [Stand Fan] Device diconnected! [28/10/2022, 05:05:08] [homebridge-miot] [Dehumidifier] (MiCloud) Login step 3 [28/10/2022, 05:05:08] [homebridge-miot] [Dehumidifier] (MiCloud) Login successful! [28/10/2022, 05:05:08] [homebridge-miot] [Dehumidifier] Using server country: cn [28/10/2022, 05:05:08] [homebridge-miot] [Dehumidifier] Successfully connected to MiCloud! Setting up miot device from MiCloud connection! [28/10/2022, 05:05:08] [homebridge-miot] [Dehumidifier] Fetching device info from the MiCloud! [28/10/2022, 05:05:08] [homebridge-miot] [Dehumidifier] Connection to MiCloud device failed! [28/10/2022, 05:05:08] [homebridge-miot] [Dehumidifier] Error: error:0308010C:digital envelope routines::unsupported [28/10/2022, 05:05:08] [homebridge-miot] [Dehumidifier] Error during connection! Retrying in 60 seconds! [28/10/2022, 05:05:08] [homebridge-miot] [Dehumidifier] (MiCloud) Logout from MiCloud for username ahmadnazirafiq@me.com [28/10/2022, 05:05:08] [homebridge-miot] [Dehumidifier] Device diconnected! [28/10/2022, 05:05:08] [homebridge-miot] [Fountains] (MiCloud) Login step 3 [28/10/2022, 05:05:08] [homebridge-miot] [Fountains] (MiCloud) Login successful! [28/10/2022, 05:05:08] [homebridge-miot] [Fountains] Using server country: cn [28/10/2022, 05:05:08] [homebridge-miot] [Fountains] Successfully connected to MiCloud! Setting up miot device from MiCloud connection! [28/10/2022, 05:05:08] [homebridge-miot] [Fountains] Fetching device info from the MiCloud! [28/10/2022, 05:05:08] [homebridge-miot] [Fountains] Connection to MiCloud device failed! [28/10/2022, 05:05:08] [homebridge-miot] [Fountains] Error: error:0308010C:digital envelope routines::unsupported [28/10/2022, 05:05:08] [homebridge-miot] [Fountains] Error during connection! Retrying in 60 seconds! [28/10/2022, 05:05:08] [homebridge-miot] [Fountains] (MiCloud) Logout from MiCloud for username ahmadnazirafiq@me.com [28/10/2022, 05:05:08] [homebridge-miot] [Fountains] Device diconnected! [28/10/2022, 05:05:08] [homebridge-miot] [Multimedia] (MiCloud) Login step 3 [28/10/2022, 05:05:08] [homebridge-miot] [Multimedia] (MiCloud) Login successful! [28/10/2022, 05:05:08] [homebridge-miot] [Multimedia] Using server country: cn [28/10/2022, 05:05:08] [homebridge-miot] [Multimedia] Successfully connected to MiCloud! Setting up miot device from MiCloud connection! [28/10/2022, 05:05:08] [homebridge-miot] [Multimedia] Fetching device info from the MiCloud! [28/10/2022, 05:05:08] [homebridge-miot] [Multimedia] Connection to MiCloud device failed! [28/10/2022, 05:05:08] [homebridge-miot] [Multimedia] Error: error:0308010C:digital envelope routines::unsupported [28/10/2022, 05:05:08] [homebridge-miot] [Multimedia] Error during connection! Retrying in 60 seconds! [28/10/2022, 05:05:08] [homebridge-miot] [Multimedia] (MiCloud) Logout from MiCloud for username ahmadnazirafiq@me.com [28/10/2022, 05:05:08] [homebridge-miot] [Multimedia] Device diconnected! [28/10/2022, 05:05:08] [homebridge-miot] [Robot Vacuum] (MiCloud) Login step 3 [28/10/2022, 05:05:08] [homebridge-miot] [Robot Vacuum] (MiCloud) Login successful! [28/10/2022, 05:05:08] [homebridge-miot] [Robot Vacuum] Using server country: cn [28/10/2022, 05:05:08] [homebridge-miot] [Robot Vacuum] Successfully connected to MiCloud! Setting up miot device from MiCloud connection! [28/10/2022, 05:05:08] [homebridge-miot] [Robot Vacuum] Fetching device info from the MiCloud! [28/10/2022, 05:05:08] [homebridge-miot] [Robot Vacuum] Connection to MiCloud device failed! [28/10/2022, 05:05:08] [homebridge-miot] [Robot Vacuum] Error: error:0308010C:digital envelope routines::unsupported [28/10/2022, 05:05:08] [homebridge-miot] [Robot Vacuum] Error during connection! Retrying in 60 seconds! [28/10/2022, 05:05:08] [homebridge-miot] [Robot Vacuum] (MiCloud) Logout from MiCloud for username ahmadnazirafiq@me.com [28/10/2022, 05:05:08] [homebridge-miot] [Robot Vacuum] Device diconnected! [28/10/2022, 05:05:08] [homebridge-miot] [Mom’s A/C°] (MiCloud) Login step 3 [28/10/2022, 05:05:08] [homebridge-miot] [Mom’s A/C°] (MiCloud) Login successful! [28/10/2022, 05:05:08] [homebridge-miot] [Mom’s A/C°] Using server country: cn [28/10/2022, 05:05:08] [homebridge-miot] [Mom’s A/C°] Successfully connected to MiCloud! Setting up miot device from MiCloud connection! [28/10/2022, 05:05:08] [homebridge-miot] [Mom’s A/C°] Fetching device info from the MiCloud! [28/10/2022, 05:05:08] [homebridge-miot] [Mom’s A/C°] Connection to MiCloud device failed! [28/10/2022, 05:05:08] [homebridge-miot] [Mom’s A/C°] Error: error:0308010C:digital envelope routines::unsupported [28/10/2022, 05:05:08] [homebridge-miot] [Mom’s A/C°] Error during connection! Retrying in 60 seconds! [28/10/2022, 05:05:08] [homebridge-miot] [Mom’s A/C°] (MiCloud) Logout from MiCloud for username ahmadnazirafiq@me.com [28/10/2022, 05:05:08] [homebridge-miot] [Mom’s A/C°] Device diconnected! [28/10/2022, 05:05:08] [homebridge-miot] [Ariff's A/C°] (MiCloud) Login step 3 [28/10/2022, 05:05:08] [homebridge-miot] [Ariff's A/C°] (MiCloud) Login successful! [28/10/2022, 05:05:08] [homebridge-miot] [Ariff's A/C°] Using server country: cn [28/10/2022, 05:05:08] [homebridge-miot] [Ariff's A/C°] Successfully connected to MiCloud! Setting up miot device from MiCloud connection! [28/10/2022, 05:05:08] [homebridge-miot] [Ariff's A/C°] Fetching device info from the MiCloud! [28/10/2022, 05:05:08] [homebridge-miot] [Ariff's A/C°] Connection to MiCloud device failed! [28/10/2022, 05:05:08] [homebridge-miot] [Ariff's A/C°] Error: error:0308010C:digital envelope routines::unsupported [28/10/2022, 05:05:08] [homebridge-miot] [Ariff's A/C°] Error during connection! Retrying in 60 seconds! [28/10/2022, 05:05:08] [homebridge-miot] [Ariff's A/C°] (MiCloud) Logout from MiCloud for username ahmadnazirafiq@me.com [28/10/2022, 05:05:08] [homebridge-miot] [Ariff's A/C°] Device diconnected! [28/10/2022, 05:05:08] [homebridge-miot] [Utilities] (MiCloud) Login step 3 [28/10/2022, 05:05:08] [homebridge-miot] [Utilities] (MiCloud) Login successful! [28/10/2022, 05:05:08] [homebridge-miot] [Utilities] Using server country: cn [28/10/2022, 05:05:08] [homebridge-miot] [Utilities] Successfully connected to MiCloud! Setting up miot device from MiCloud connection! [28/10/2022, 05:05:08] [homebridge-miot] [Utilities] Fetching device info from the MiCloud! [28/10/2022, 05:05:08] [homebridge-miot] [Utilities] Connection to MiCloud device failed! [28/10/2022, 05:05:08] [homebridge-miot] [Utilities] Error: error:0308010C:digital envelope routines::unsupported [28/10/2022, 05:05:08] [homebridge-miot] [Utilities] Error during connection! Retrying in 60 seconds! [28/10/2022, 05:05:08] [homebridge-miot] [Utilities] (MiCloud) Logout from MiCloud for username ahmadnazirafiq@me.com [28/10/2022, 05:05:08] [homebridge-miot] [Utilities] Device diconnected! [28/10/2022, 05:05:14] [homebridge-miot] [Washer] Preparing property poll! [28/10/2022, 05:05:14] [homebridge-miot] [Washer] Splitting properties into chunks. Number of chunks: 1. Chunk size: 14 [28/10/2022, 05:05:15] [homebridge-miot] [Tower Fan] Preparing property poll! [28/10/2022, 05:05:15] [homebridge-miot] [Tower Fan] Splitting properties into chunks. Number of chunks: 1. Chunk size: 14 [28/10/2022, 05:05:15] [homebridge-miot] [Swing Fan] Preparing property poll! [28/10/2022, 05:05:15] [homebridge-miot] [Swing Fan] Splitting properties into chunks. Number of chunks: 1. Chunk size: 14 [28/10/2022, 05:05:16] [homebridge-miot] [Purifying Fan] Preparing property poll! [28/10/2022, 05:05:16] [homebridge-miot] [Purifying Fan] Splitting properties into chunks. Number of chunks: 1. Chunk size: 14 [28/10/2022, 05:05:16] [homebridge-miot] [Air Purifier 3] Preparing property poll! [28/10/2022, 05:05:16] [homebridge-miot] [Air Purifier 3] Splitting properties into chunks. Number of chunks: 1. Chunk size: 14 [28/10/2022, 05:05:24] [homebridge-miot] [Washer] Preparing property poll! [28/10/2022, 05:05:24] [homebridge-miot] [Washer] Splitting properties into chunks. Number of chunks: 1. Chunk size: 14 [28/10/2022, 05:05:25] [homebridge-miot] [Tower Fan] Preparing property poll! [28/10/2022, 05:05:25] [homebridge-miot] [Tower Fan] Splitting properties into chunks. Number of chunks: 1. Chunk size: 14 [28/10/2022, 05:05:25] [homebridge-miot] [Swing Fan] Preparing property poll! [28/10/2022, 05:05:25] [homebridge-miot] [Swing Fan] Splitting properties into chunks. Number of chunks: 1. Chunk size: 14 [28/10/2022, 05:05:26] [homebridge-miot] [Purifying Fan] Preparing property poll! [28/10/2022, 05:05:26] [homebridge-miot] [Purifying Fan] Splitting properties into chunks. Number of chunks: 1. Chunk size: 14 [28/10/2022, 05:05:26] [homebridge-miot] [Air Purifier 3] Preparing property poll! [28/10/2022, 05:05:26] [homebridge-miot] [Air Purifier 3] Splitting properties into chunks. Number of chunks: 1. Chunk size: 14

merdok commented 1 year ago

I have no idea what that error means, also I see that you are using the cn server from the logs. You need to set the proper server where your devices are located.

ahmadnazirafiq commented 1 year ago

I have no idea what that error means, also I see that you are using the cn server from the logs. You need to set the proper server where your devices are located.

That’s odd as it has always been a cn server all along; as the devices are connected via Mainland China server. Plus, it works just fine in Mi Home app.

Things I’ve tried so far: • downgraded node.js to version 18.11.0 • downgraded miot to version 1.3.1 • rebooted Raspberry Pi server • disabled Pi-hole

Device model affected are: • chuangmi.plug.v3 (outlet) • zhimi.fan.za4 (fan) • rockrobo.vacuum.v1 (robot vacuum) • zimi.powerstrip.v2 (outlet) • lumi.acpartner.v3 (air conditioner) • lumi.acpartner.mcn02 (air conditioner)

[these devices connects via mainland china server and requires MiCloud]

Results I found: • other Xiaomi devices using other plugins aren’t affected • other local (non-MiCloud) devices connected via miot plugin aren’t affected • one of the affected devices works when using other plugins

merdok commented 1 year ago

Seems like this is not related to the plugin but to your node.js version: https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported

ahmadnazirafiq commented 1 year ago

Seems like this is not related to the plugin but to your node.js version: https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported

If that’s the case, an older version of node.js should work but the issue persists. I’ve tried downgrading to older version using the official Homebridge command sudo hb-service update-node 18.11.0 (plus even older version) yet the issue persists.

Going through the link you shared, I have no idea which command to try as it might break my entire Homebridge setup if I’m not careful.

I’m stuck here and I have no idea how else to do. I regret updating node.js had I knew if it leads to this.

merdok commented 1 year ago

There is really nothing I can do about it as this is a node.js issue and is completely unrelated to the plugin. I myself did not experience the issue but after I goggled the error message then I got quite some results so I would recommend that you go through them and check if any of them has a solution which will help you.

ahmadnazirafiq commented 1 year ago

Oddly this issue is only affecting this plugin using MiCloud and nothing else. However, by downgrading node.js from version 18.X.X to 16.18.0 seems to fix it.

Spy-1 commented 1 year ago

same here!

merdok commented 1 year ago

As already mentioned, this is a nodejs issue.

Spy-1 commented 1 year ago

Did you found a way getting the plugin work within node v18.X.X ??

merdok commented 1 year ago

This is not an issue with the plugin, but something with the combination of nodejs and openssl. There is no solution yet other then do stick to nodejs 16.x.x

merdok commented 1 year ago

As of version 1.4.3, the plugin should now work with the recent nodejs version without any issues again

Spy-1 commented 1 year ago

Great Job! It works. Thanks!!