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

lumi.ctrl_ln2.aq1 not recognised by mi connect #43

Closed
droliverlewis opened this issue Sep 10, 2019 · 3 comments
Closed

lumi.ctrl_ln2.aq1 not recognised by mi connect #43

droliverlewis opened this issue Sep 10, 2019 · 3 comments

Comments

@droliverlewis
Copy link

Hi,
I'm having issues connecting a lumi.ctrl_ln2.aq1 to mi connect. Here is what appears to happen:

In the Mi Home app (Hub info page) the device is identified as :{"model":"lumi.ctrl_ln2.aq1","did":"lumi.158d00023b265c","name":"Hall Light"}

When this is pulled into the mi connector application, on the page Add device [ST] it comes up as follows:

  • | 192.168.1.24 | lumi.generic.64 | 158d00023b265c

Then I attempt to register the device, mi connect throws an error. This doesn't happen for any other devices (I also have a lumi.ctrl_neutral2 which works fine).

Any thoughts?
Thank you

PS: Fantastic tool.
NB: The gateway tokens now appear in the "Hub info" page of the Mi Home app once the wireless communication protocol, so no need to try to strip them out of the DB any more.

@droliverlewis
Copy link
Author

Sorry, forgot to give you the log entry when I try to register the device with ST:

Get Device State TypeError: deviceMap[id].target.state is not a function Error at
Object.module.exports.getDeviceState (/usr/src/app/miio/miio.js:1487:55) at /usr/src/app/routes/registerST.js:20:10 at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5) at next (/usr/src/app/node_modules/express/lib/router/route.js:137:13) at isAuthenticated (/usr/src/app/routes/dashboard.js:21:12) at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5) at next (/usr/src/app/node_modules/express/lib/router/route.js:137:13) at Route.dispatch (/usr/src/app/node_modules/express/lib/router/route.js:112:3) at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5) at /usr/src/app/node_modules/express/lib/router/index.js:281:22 at Function.process_params (/usr/src/app/node_modules/express/lib/router/index.js:335:12) at next (/usr/src/app/node_modules/express/lib/router/index.js:275:10) at Function.handle (/usr/src/app/node_modules/express/lib/router/index.js:174:3) at router (/usr/src/app/node_modules/express/lib/router/index.js:47:12) at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/usr/src/app/node_modules/express/lib/router/index.js:317:13)

It just looks like mi_connector hasn't been able to ID the device type successfully and has just allocated it as a generic/unknown device.

@droliverlewis
Copy link
Author

Been playing in the docker image (couldn't find sources), to see if I could find the problem and it looks like two changes are required to get lumi.ctrl_ln2.aq1 devices to work:

1. /usr/src/app/node_modules/miio/lib/devices/gateway/subdevices.js

following entry needs to be added to the module.exports:
64: require('./ctrl_ln2'),

2. /usr/src/app/miio/miio.js - line 384

Change
if(child.miioModel == "lumi.ctrl_neutral2" || child.miioModel == "lumi.ctrl_neutral2")
to
if(child.miioModel == "lumi.ctrl_neutral2" || child.miioModel == "lumi.ctrl_ln2")

Maybe fison76 could verify this and add it properly.

@fison67
Copy link
Owner

fison67 commented Sep 23, 2019

Maybe this 64? is a new model.
I will update a source.

Thanks much.

@fison67 fison67 closed this as completed Sep 23, 2019
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

2 participants