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 with sensor motion #31

Open
fjlopezandreu opened this issue Oct 12, 2017 · 1 comment
Open

Error with sensor motion #31

fjlopezandreu opened this issue Oct 12, 2017 · 1 comment

Comments

@fjlopezandreu
Copy link

fjlopezandreu commented Oct 12, 2017

I have a raspberry pi 2 with the latest version of raspbian. I installed homebridge and I added the plugin homebridge-mijia.

Everything goes perfectly until the motion sensor is activated, the following error occurs:

/opt/node/lib/node_modules/homebridge-mijia/lib/MiJiaPlatform.js:254
this.factory.setMotion(gatewaySid, deviceSid, motionDetected, battery1, battery2);
^

ReferenceError: battery2 is not defined
at MotionParser.parse (/opt/node/lib/node_modules/homebridge-mijia/lib/MiJiaPlatform.js:254:75)
at MiJiaPlatform.parseMessage (/opt/node/lib/node_modules/homebridge-mijia/lib/MiJiaPlatform.js:186:27)
at emitTwo (events.js:106:13)
at Socket.emit (events.js:191:7)
at UDP.onMessage (dgram.js:550:8)

According to the application my gateway is lumi.gateway.v3.

@fjlopezandreu
Copy link
Author

I have debugged the MiJiaPlatform.js file and have noticed that the gateway only sends heartbeat messages. When a message of type read_ack is never sent, the variable battery2 is never initialized and therefore the error in the parsers of the accessories occurs.

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

1 participant