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

Error at homebridge launch #3

Open
niccolospa opened this issue Jan 28, 2018 · 10 comments
Open

Error at homebridge launch #3

niccolospa opened this issue Jan 28, 2018 · 10 comments

Comments

@niccolospa
Copy link

niccolospa commented Jan 28, 2018

Can you help me to sort this out? I did all the installation ad the read me says, but at launch I get:
[2018-1-28 10:09:19] [Security] Initializing MiGatewaySecurity accessory...
/usr/lib/node_modules/homebridge-mi-gateway-security/index.js:48
this.device = new miio.Device({
^

TypeError: miio.Device is not a constructor
at new MiGatewaySecurity (/usr/lib/node_modules/homebridge-mi-gateway-security/index.js:48:19)
at Server._loadAccessories (/usr/lib/node_modules/homebridge/lib/server.js:274:29)
at Server.run (/usr/lib/node_modules/homebridge/lib/server.js:86:38)
at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:40:10)
at Object. (/usr/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)

@niccolospa
Copy link
Author

I solved that renaming "Device" to "device" but I encounter this other problem: /usr/lib/node_modules/homebridge-mi-gateway-security/index.js:101
that.device.call("get_arming", []).then(result => {
^

TypeError: that.device.call is not a function
at MiGatewaySecurity. (/usr/lib/node_modules/homebridge-mi-gateway-security/index.js:101:29)

@YinHangCode
Copy link
Owner

You can use 'npm install -g miio@0.14.1' temporarily, then I'll think about a solution.

@niccolospa
Copy link
Author

Done, now in console I get:
[Security] [MiGatewaySecurity][ERROR]get SecuritySystemTargetState Error: Error: Call to device timed out
[2018-1-28 12:33:54] [Security] [MiGatewaySecurity][ERROR]get SecuritySystemCurrentState Error: Error: Call to device timed out

@YinHangCode
Copy link
Owner

make sure token and ip is right.

@niccolospa
Copy link
Author

niccolospa commented Feb 5, 2018

I double checked both, they should be correct but still getting the 2 errors

@niccolospa
Copy link
Author

I was thinking that could conflict with another plugin that is homebridge-miio https://github.com/Bluebie/homebridge-miio could it be?

@Kohle81
Copy link

Kohle81 commented Feb 6, 2018

@niccolospa

I hava the same errors, first time because of miio, then the second error .

Have you solved the problem?

@niccolospa
Copy link
Author

Right now I solved because I pasted the wrong token actually

@niccolospa
Copy link
Author

I discovered that the token changes every time the gateway is being reset, if can help someone

@nikolaevigor
Copy link

Note to further readers. Better to obtain token and ip of the gateway from Mi Home app. To do this in iOS App follow to gateway about page > tap at the bottom of the screen about 5 times > new rows will appear > choose 4th > find token and ip.

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

4 participants