homebridge-mi-aqara icon indicating copy to clipboard operation
homebridge-mi-aqara copied to clipboard

No response - No device - Maybe fix

Open xinteksik opened this issue 6 years ago • 6 comments

Problem is in index.js. I know, some bugs is still there, but it works :-)

edit index.js and find line with: if(that.ConfigUtil.isHostGateway(gatewaySid) && cmd != 'virtual_iam') {

and insert this code before that line:

var gateway = that.GatewayUtil.getBySid(gatewaySid); if(!gateway) { // add gateway gateway = { sid: gatewaySid, passwd: that.ConfigUtil.getGatewayPasswordByGatewaySid(gatewaySid), ip: jsonObj['ip'], // rinfo.address, port: jsonObj['port'], // rinfo.port, proto_version: jsonObj['proto_version'], model: jsonObj['model'] } gateway = that.GatewayUtil.addOrUpdate(gatewaySid, gateway); }

Maybe help, maybe not :-)

xinteksik avatar Jan 07 '19 19:01 xinteksik

This hack works like magic, my edit for Gateway Security Kit:

var gateway = that.GatewayUtil.getBySid(gatewaySid);
        if(!gateway) {
            console.log(jsonObj);
            console.log('now gateway motherfucker');
            // add gateway
            gateway = {
                sid: gatewaySid,
                passwd: that.ConfigUtil.getGatewayPasswordByGatewaySid(gatewaySid),
                ip: jsonObj['ip'], // rinfo.address,
                port: jsonObj['port'], // rinfo.port,
                proto_version: '1.1.2', // hardcoded
                // proto_version: jsonObj['proto_version'], // this field was empty
                // model: jsonObj['model'] // this field was empty
                model: 'gateway' // hardcoded
            }
            console.log('add this gateway', gateway);
            gateway = that.GatewayUtil.addOrUpdate(gatewaySid, gateway);
        }

before line if(that.ConfigUtil.isConfigGateway(gatewaySid)) {

there were no proto_version and model and I've simple hardcoded it hehe, now manage show me the devices, at least this is the progress

image

studentIvan avatar Jan 12 '19 11:01 studentIvan

this is my problem. i copy your text in index.js and dont work

Jan 22 22:17:38 homebridge homebridge[11763]: { cmd: 'iam', Jan 22 22:17:38 homebridge homebridge[11763]: port: '9898', Jan 22 22:17:38 homebridge homebridge[11763]: sid: '04cf8c8fa58b', Jan 22 22:17:38 homebridge homebridge[11763]: model: 'gateway', Jan 22 22:17:38 homebridge homebridge[11763]: proto_version: '1.1.2', Jan 22 22:17:38 homebridge homebridge[11763]: ip: '192.168.5.127' } Jan 22 22:17:38 homebridge homebridge[11763]: now gateway motherfucker Jan 22 22:17:38 homebridge homebridge[11763]: add this gateway { sid: '04cf8c8fa58b', Jan 22 22:17:38 homebridge homebridge[11763]: passwd: 'xxxxxxxxxxxxxxxxxxx', Jan 22 22:17:38 homebridge homebridge[11763]: ip: '192.168.5.127', Jan 22 22:17:38 homebridge homebridge[11763]: port: '9898', Jan 22 22:17:38 homebridge homebridge[11763]: proto_version: '1.1.2', Jan 22 22:17:38 homebridge homebridge[11763]: model: 'gateway' } Jan 22 22:17:38 homebridge homebridge[11763]: { cmd: 'iam', Jan 22 22:17:38 homebridge homebridge[11763]: port: '9898', Jan 22 22:17:38 homebridge homebridge[11763]: sid: '7811dcb8fd12', Jan 22 22:17:38 homebridge homebridge[11763]: model: 'gateway', Jan 22 22:17:38 homebridge homebridge[11763]: proto_version: '1.1.2', Jan 22 22:17:38 homebridge homebridge[11763]: ip: '192.168.5.116' } Jan 22 22:17:38 homebridge homebridge[11763]: now gateway motherfucker Jan 22 22:17:38 homebridge homebridge[11763]: add this gateway { sid: '7811dcb8fd12', Jan 22 22:17:38 homebridge homebridge[11763]: passwd: undefined, Jan 22 22:17:38 homebridge homebridge[11763]: ip: '192.168.5.116', Jan 22 22:17:38 homebridge homebridge[11763]: port: '9898', Jan 22 22:17:38 homebridge homebridge[11763]: proto_version: '1.1.2', Jan 22 22:17:38 homebridge homebridge[11763]: model: 'gateway' } Jan 22 22:17:38 homebridge homebridge[11763]: [2019-1-22 22:17:38] [MiAqaraPlatform] [WARN][Revc]{"cmd":"read_ack","model":"gateway","sid":"4cf8c8fa58b","short_id":0,"data":"{"rgb":0,"illumination":407,"proto_version":"1.1.2"}"} Jan 22 22:17:43 homebridge homebridge[11763]: [2019-1-22 22:17:43] [Config] Using Form Authentication Jan 22 22:17:43 homebridge homebridge[11763]: [2019-1-22 22:17:43] [Config] Starting server using HTTPS Jan 22 22:17:43 homebridge homebridge[11763]: [2019-1-22 22:17:43] [Config] Console v3.9.4 is listening on port 8050. Jan 22 22:18:08 homebridge homebridge[11763]: [2019-1-22 22:18:08] [MiAqaraPlatform] [WARN][Revc]{"cmd":"read_ack","model":"gateway","sid":"4cf8c8fa58b","short_id":0,"data":"{"rgb":0,"illumination":402,"proto_version":"1.1.2"}"} Jan 22 22:18:38 homebridge homebridge[11763]: [2019-1-22 22:18:38] [MiAqaraPlatform] [WARN][Revc]{"cmd":"read_ack","model":"gateway","sid":"4cf8c8fa58b","short_id":0,"data":"{"rgb":0,"illumination":407,"proto_version":"1.1.2"}"} Jan 22 22:19:08 homebridge homebridge[11763]: [2019-1-22 22:19:08] [MiAqaraPlatform] [WARN][Revc]{"cmd":"read_ack","model":"gateway","sid":"4cf8c8fa58b","short_id":0,"data":"{"rgb":0,"illumination":416,"proto_version":"1.1.2"}"} Jan 22 22:19:38 homebridge homebridge[11763]: [2019-1-22 22:19:38] [MiAqaraPlatform] [WARN][Revc]{"cmd":"read_ack","model":"gateway","sid":"4cf8c8fa58b","short_id":0,"data":"{"rgb":0,"illumination":413,"proto_version":"1.1.2"}"} Jan 22 22:20:08 homebridge homebridge[11763]: [2019-1-22 22:20:08] [MiAqaraPlatform] [WARN][Revc]{"cmd":"read_ack","model":"gateway","sid":"4cf8c8fa58b","short_id":0,"data":"{"rgb":0,"illumination":412,"proto_version":"1.1.2"}"} Jan 22 22:20:38 homebridge homebridge[11763]: [2019-1-22 22:20:38] [MiAqaraPlatform] [WARN][Revc]{"cmd":"read_ack","model":"gateway","sid":"4cf8c8fa58b","short_id":0,"data":"{"rgb":0,"illumination":413,"proto_version":"1.1.2"}"} Jan 22 22:21:08 homebridge homebridge[11763]: [2019-1-22 22:21:08] [MiAqaraPlatform] [WARN][Revc]{"cmd":"read_ack","model":"gateway","sid":"4cf8c8fa58b","short_id":0,"data":"{"rgb":0,"illumination":418,"proto_version":"1.1.2"}"} Jan 22 22:21:38 homebridge homebridge[11763]: [2019-1-22 22:21:38] [MiAqaraPlatform] [WARN][Revc]{"cmd":"read_ack","model":"gateway","sid":"4cf8c8fa58b","short_id":0,"data":"{"rgb":0,"illumination":418,"proto_version":"1.1.2"}"} Jan 22 22:22:08 homebridge homebridge[11763]: [2019-1-22 22:22:08] [MiAqaraPlatform] [WARN][Revc]{"cmd":"read_ack","model":"gateway","sid":"4cf8c8fa58b","short_id":0,"data":"{"rgb":0,"illumination":408,"proto_version":"1.1.2"}"}

Gateway one (7811dcb8fd12) works finely, the new gateway dont work. i have open the port 9898 with UART and psm-set. dont work with homebridge-plugins

marcoschmidt79 avatar Jan 22 '19 21:01 marcoschmidt79

passwd: undefined, // should be filled with your gateway password

studentIvan avatar Jan 23 '19 14:01 studentIvan

passwd: undefined, // should be filled with your gateway password

Yes. This gateway is configured in a different instance. my problem concerns the gateway with the ip 127.

an 22 22:17:38 homebridge homebridge[11763]: { cmd: 'iam', Jan 22 22:17:38 homebridge homebridge[11763]: port: '9898', Jan 22 22:17:38 homebridge homebridge[11763]: sid: '04cf8c8fa58b', Jan 22 22:17:38 homebridge homebridge[11763]: model: 'gateway', Jan 22 22:17:38 homebridge homebridge[11763]: proto_version: '1.1.2', Jan 22 22:17:38 homebridge homebridge[11763]: ip: '192.168.5.127' } Jan 22 22:17:38 homebridge homebridge[11763]: now gateway motherfucker Jan 22 22:17:38 homebridge homebridge[11763]: add this gateway { sid: '04cf8c8fa58b', Jan 22 22:17:38 homebridge homebridge[11763]: passwd: 'xxxxxxxxxxxxxxxxxxx',

marcoschmidt79 avatar Jan 23 '19 14:01 marcoschmidt79

passwd: undefined, // should be filled with your gateway password

Yes. This gateway is configured in a different instance. my problem concerns the gateway with the ip 127.

an 22 22:17:38 homebridge homebridge[11763]: { cmd: 'iam', Jan 22 22:17:38 homebridge homebridge[11763]: port: '9898', Jan 22 22:17:38 homebridge homebridge[11763]: sid: '04cf8c8fa58b', Jan 22 22:17:38 homebridge homebridge[11763]: model: 'gateway', Jan 22 22:17:38 homebridge homebridge[11763]: proto_version: '1.1.2', Jan 22 22:17:38 homebridge homebridge[11763]: ip: '192.168.5.127' } Jan 22 22:17:38 homebridge homebridge[11763]: now gateway motherfucker Jan 22 22:17:38 homebridge homebridge[11763]: add this gateway { sid: '04cf8c8fa58b', Jan 22 22:17:38 homebridge homebridge[11763]: passwd: 'xxxxxxxxxxxxxxxxxxx',

does the miio see your device? also maybe this message can help you https://github.com/aholstenson/miio/issues/92#issuecomment-453737136

studentIvan avatar Jan 25 '19 08:01 studentIvan

Hey guys i am a total noob got the xiaomi hub working with the homekit few months before , but not working now , the hub is working as security device using the other plugin , but not with this plugin the device dosent show up . can someone please post a step by step fix how to apply this fix

thanks

a1cellsolution avatar Mar 23 '19 15:03 a1cellsolution