michbeck100 / pimatic-hap

Pimatic homekit bridge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

v0.2.0 crash with contact

Yves911 opened this issue · comments

v0.2.0 issue with contact.
When a contact is triggered pimatic crash with the following error message.

08:29:08.759 [pimatic-hap] debug: contact sensor state changed. Notifying iOS devices.
08:29:09.422 [pimatic] error: A uncaught exception occured: ReferenceError: getHomekitState is not defined
08:29:09.422 [pimatic] error:>    at HomeduinoRFContactSensor.<anonymous> (/root/pimatic-git/node_modules/pimatic-hap/hap.coffee:264:65)
08:29:09.422 [pimatic] error:>    at HomeduinoRFContactSensor.EventEmitter.emit (events.js:117:20)
08:29:09.422 [pimatic] error:>    at HomeduinoRFContactSensor.ContactSensor._setContact (/root/pimatic-git/node_modules/pimatic/lib/devices.coffee:428:8)
08:29:09.422 [pimatic] error:>    at Board.<anonymous> (/root/pimatic-git/node_modules/pimatic-homeduino/homeduino.coffee:520:14)
08:29:09.422 [pimatic] error:>    at Board.EventEmitter.emit (events.js:117:20)
08:29:09.422 [pimatic] error:>    at Board._emitReceive (/root/pimatic-git/node_modules/pimatic-homeduino/node_modules/homeduino/lib/board.js:352:12)
08:29:09.422 [pimatic] error:>    at Board._handleRFControl (/root/pimatic-git/node_modules/pimatic-homeduino/node_modules/homeduino/lib/board.js:337:10)
08:29:09.422 [pimatic] error:>    at Board._onLine (/root/pimatic-git/node_modules/pimatic-homeduino/node_modules/homeduino/lib/board.js:142:21)
08:29:09.422 [pimatic] error:>    at SerialPortDriver.<anonymous> (/root/pimatic-git/node_modules/pimatic-homeduino/node_modules/homeduino/lib/board.js:83:22)
08:29:09.422 [pimatic] error:>    at SerialPortDriver.EventEmitter.emit (events.js:95:17)
08:29:09.422 [pimatic] error:>    at SerialPort.<anonymous> (/root/pimatic-git/node_modules/pimatic-homeduino/node_modules/homeduino/lib/driver/serialport.js:60:24)
08:29:09.422 [pimatic] error:>    at SerialPort.EventEmitter.emit (events.js:95:17)
08:29:09.422 [pimatic] error:>    at /root/pimatic-git/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/serialport/parsers.js:25:17
08:29:09.422 [pimatic] error:>    at Array.forEach (native)
08:29:09.422 [pimatic] error:>    at Object.parser (/root/pimatic-git/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/serialport/parsers.js:24:13)
08:29:09.422 [pimatic] error:>    at Object.SerialPort.options.dataCallback (/root/pimatic-git/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/serialport/serialport.js:168:15)
08:29:09.422 [pimatic] error:>    at SerialPortFactory.SerialPort._emitData (/root/pimatic-git/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/serialport/serialport.js:350:20)
08:29:09.422 [pimatic] error:>    at afterRead (/root/pimatic-git/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/serialport/serialport.js:326:20)
08:29:09.422 [pimatic] error:>    at /root/pimatic-git/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/serialport/serialport.js:342:9
08:29:09.422 [pimatic] error:>    at Object.wrapper [as oncomplete] (fs.js:454:17)
08:29:09.422 [pimatic] error:> This is most probably a bug in pimatic or in a module, please report it!
08:29:09.428 [pimatic] warn: Keeping pimatic alive, but could be in an undefined state, please restart pimatic so soon as possible!

a41030e should fix this

I confirm this issue is solved, no crash anymore.
Btw, when a contact is "closed" in pimatic, Eve reports "Yes"
when a contact is "opened" in pimatic, Eve reports "No"
i find this a bit strange...

I wasn't sure what the "default" state of a contact sensor might be. As I didn't have a device to test I couldn't test it with eve. I will switch the output if that makes more sense.

After testing the contact sensor, i would say if eve says the contact value is "yes" then this means the sensor has contact, which in turn means that it is closed. I would say this behavior is correct.

make sense, thanks