Coder Social home page Coder Social logo

Comments (7)

twangus avatar twangus commented on July 17, 2024

I should have mentioned that after restarting homebridge, the accessories seem to all show up in HomeKit, so I'm not sure if there is any long term adverse consequences aside from the crash itself.

from homebridge-alarmdecoder-platform.

aficustree avatar aficustree commented on July 17, 2024

Well that trace gives me something to go by. Just to confirm, you actually do have a zone 5 right? I’ll look into it tonight and see if that might get some clues as to the cause of the crash.

from homebridge-alarmdecoder-platform.

twangus avatar twangus commented on July 17, 2024

Yep, I've got a zone 5 - it's a contact sensor.

I tried again with a different installation to see if it was specific to that sensor or whether it was just crashing on whatever sensor is first getting the "identify" event. This homebridge installation is through HOOBS on a raspberry pi, whereas the trace above is from a vanilla home bridge installation on my Mac.

It still crashes when adding the hub to HomeKit after the plugin was install, but it is a different sensor (zone 6 - a motion sensor).

Interestingly, the trace looks a different this time -- the crash still relates to that callback function, but it isn't actually crashing in the plugin code:

5/7/2020, 9:16:49 AM [Alarm System] 6 Kitchen Motion Identify!!!
5/7/2020, 9:16:49 AM Error: This callback function has already been called by someone else; it can only be called one time.
	at /usr/local/lib/node_modules/@hoobs/hoobs/node_modules/hap-nodejs/dist/lib/util/once.js:11:19
	at Accessory.<anonymous> (/usr/local/lib/node_modules/@hoobs/hoobs/bridge/platform.js:57:13)
	at Accessory.emit (events.js:310:20)
	at Accessory.EventEmitter.emit (/usr/local/lib/node_modules/@hoobs/hoobs/node_modules/hap-nodejs/dist/lib/EventEmitter.js:59:38)
	at Accessory._this._identificationRequest (/usr/local/lib/node_modules/@hoobs/hoobs/node_modules/hap-nodejs/dist/lib/Accessory.js:148:23)
	at Identify.<anonymous> (/usr/local/lib/node_modules/@hoobs/hoobs/node_modules/hap-nodejs/dist/lib/Accessory.js:1081:23)
	at Identify.emit (events.js:310:20)
	at Identify.EventEmitter.emit (/usr/local/lib/node_modules/@hoobs/hoobs/node_modules/hap-nodejs/dist/lib/EventEmitter.js:59:38)
	at Identify.Characteristic._this.setValue (/usr/local/lib/node_modules/@hoobs/hoobs/node_modules/hap-nodejs/dist/lib/Characteristic.js:349:23)
	at /usr/local/lib/node_modules/@hoobs/hoobs/node_modules/hap-nodejs/dist/lib/Accessory.js:940:36
5/7/2020, 9:16:49 AM Got SIGTERM, shutting down Bridge...

It seems from this error that maybe the plugin is calling a callback function that it isn't supposed to?

I poked around the homebridge code and saw some references (e.g., PlatformAccessory.ts @ 85) that mention backwards compatibility regarding how the callback is handled, so maybe something in the underlying homebridge model changed since this plugin was first written?

from homebridge-alarmdecoder-platform.

twangus avatar twangus commented on July 17, 2024

Also, I confirmed the crash only seems to happen if the hub is added to HomeKit after this plugin has already been installed and configured. If install the plugin on a homebridge installation that has already been added to HomeKit, the accessories show up seemingly without issue.

It seems like the difference is that when you adding a hub that already has accessories set up, the Home app puts up a set of screens to walk through configuring each accessory, which triggers the "identify" event that causes the crash:

IMG_1191

If you install and configure the plugin after the hub has already been added, it doesn't show those setup screens and instead just dumps all of the accessories in the Default Room and so doesn't trigger the crash. Opening each accessory up manually to configure (e.g., assign to room, change name, etc.) doesn't seem to send out those identify events and so doesn't seem to trigger the crash.

from homebridge-alarmdecoder-platform.

twangus avatar twangus commented on July 17, 2024

One quick clarification -- it looks like those setup screens are not specific to the Home app. I tried adding the hub with the plugins using the Eve app, and it pulled up the same interface (and caused the same crash).

from homebridge-alarmdecoder-platform.

aficustree avatar aficustree commented on July 17, 2024

it seems identify isn't really even used anymore and the function signature is incorrect. Definitely broke during the push to 1.0 for HomeKit. I don't have a way to test anymore but can you clone the 'fix16' branch and see if that fixes things?

from homebridge-alarmdecoder-platform.

twangus avatar twangus commented on July 17, 2024

Yep, that seems to fix it, at least on my development installation. Now when adding the hub, it logs an "Identify!!!" message for each discovered accessory but no longer crashes.

Thanks!

from homebridge-alarmdecoder-platform.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.