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

TypeError: Cannot read property 'length' of undefined #16

Open
DDsbv1 opened this issue Feb 26, 2020 · 9 comments
Open

TypeError: Cannot read property 'length' of undefined #16

DDsbv1 opened this issue Feb 26, 2020 · 9 comments

Comments

@DDsbv1
Copy link

DDsbv1 commented Feb 26, 2020

Hello,
I have this error when i open MM on a broswer

[22:03:47.907] [ERROR] TypeError: Cannot read property 'length' of undefined
at Class.getDevices (/home/pi/MagicMirror/modules/MMM-xiaomi/node_helper.js:70:41)
at /home/pi/MagicMirror/modules/MMM-xiaomi/node_helper.js:45:20

I don't understand why it doesn't work...

My miio result :

Device ID: 87476118
Model info: lumi.gateway.v3
Address: 192.168.1.139
Token: 369e4b19b7b01ae1227263bc952aaed5 via stored token
Support: At least basic

Device ID: 158d0000ef9071
Model info: lumi.motion
Address: Owned by miio:87476118
Token: Automatic via parent device
Support: At least basic

Device ID: 158d0000d33ba2
Model info: lumi.switch
Address: Owned by miio:87476118
Token: Automatic via parent device
Support: At least basic

Device ID: 158d000117d108
Model info: lumi.sensor_ht
Address: Owned by miio:87476118
Token: Automatic via parent device
Support: At least basic

Device ID: 158d0001141c08
Model info: lumi.sensor_ht
Address: Owned by miio:87476118
Token: Automatic via parent device
Support: At least basic

My config.js

{
module: 'MMM-xiaomi',
position: 'bottom_left',
header: 'Temperature/Humidity', // This is optional
config: {
gatewayIP: '192.168.1.139',
gatewayToken: '369e4b19b7b01ae1227263bc952aaed5',
rooms: [
{
name: 'Salon',sortOrder: 10, devices: ['158d000117d108']
},
}

I hope you could help me.
Thank for your work.

@mirko3000
Copy link
Owner

Hi, sorry for the late reply. It seems that your gateway does not contain any devices, at least that is where the error comes from.
Your config is missing a closing ] for the rooms array - but I don't think this is the root cause. But maybe try that first...

@3vidar
Copy link

3vidar commented Mar 11, 2021

Hi @mirko3000, I have the same error message:
TypeError: Cannot read property 'length' of undefined at Class.getDevices (/Users/sladak/MagicMirror/modules/MMM-xiaomi/node_helper.js:70:41) at /Users/sladak/MagicMirror/modules/MMM-xiaomi/node_helper.js:45:20

My module was working fine until my old gateway became defective. I bought a Xiaomi Mijia Gateway 3 and set it up. I readet out the Tokan of the new Gateway and also of all the sonsors. What I have seen, that the token has a longer string or different format then the old one, could this be the issue? than this is the only thing that I have changet in the config file. New Token of the gateway looks like this: 48473530637c7144596c703932666c37 I would be very grateful if you could help me. I love this module.

@3vidar
Copy link

3vidar commented Mar 16, 2021

Hi @mirko3000
I think that the error occurs because of the old library. Would there be a way to include the new current library?
[(https://www.npmjs.com/package/node-mihome)]

Thanks a lot

@SvensonB79
Copy link

Hi @mirko3000
I think that the error occurs because of the old library. Would there be a way to include the new current library?
[(https://www.npmjs.com/package/node-mihome)]

Thanks a lot
could you solve this? I have the same problem

@mirko3000
Copy link
Owner

Hi @mirko3000
I think that the error occurs because of the old library. Would there be a way to include the new current library?
[(https://www.npmjs.com/package/node-mihome)]

Thanks a lot

I will look into it once I find time, thanks for the hints!

@3vidar
Copy link

3vidar commented Jul 20, 2021

Hi @mirko3000
I think that the error occurs because of the old library. Would there be a way to include the new current library?
[(https://www.npmjs.com/package/node-mihome)]
Thanks a lot
could you solve this? I have the same problem

Unfortunately not, I found an old used gateway and bought this one, now it works great again.

@3vidar
Copy link

3vidar commented Jul 20, 2021

Hi @mirko3000
I think that the error occurs because of the old library. Would there be a way to include the new current library?
[(https://www.npmjs.com/package/node-mihome)]
Thanks a lot

I will look into it once I find time, thanks for the hints!

Hi, ooooh that would be great, thanks in advance for your efforts.

@gavinfraser6
Copy link

Hi @mirko3000
Did you by any chance update this?

@3vidar
Copy link

3vidar commented Dec 20, 2022

Hi @mirko3000
Could be this possible to integrate: https://github.com/Squachen/micloud? There are all Information about all xiaomi devices... thx

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

5 participants