Zacknetic / HomebridgeMagicHome-DynamicPlatform

Homebridge Plugin for MagicHome LED controllers and light bulbs
Apache License 2.0
61 stars 11 forks source link

Plugin crashes, restarts Homebridge #33

Closed andywaplinger closed 3 years ago

andywaplinger commented 3 years ago

Hello again! I just updated from 1.4.5 to 1.5.0, and now I'm having this error:

[10/23/2020, 3:16:17 AM] [homebridge-magichome-dynamic-platform] Get Characteristic Brightness -> 100 for device: 'Under Couch' [10/23/2020, 3:16:17 AM] [homebridge-magichome-dynamic-platform] Get Characteristic Brightness -> 100 for device: 'Under Couch' [10/23/2020, 3:16:18 AM] Error: This callback function has already been called by someone else; it can only be called one time. at /usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/once.ts:6:13 at RGBStrip.getBrightness (/usr/lib/node_modules/homebridge-magichome-dynamic-platform/src/PlatformAccessory.ts:234:5) at Characteristic.emit (events.js:327:22) at Characteristic.EventEmitter.emit (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/EventEmitter.ts:42:22) at Characteristic._this.getValue (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:489:12) at /usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1239:22 at Array.forEach () at Bridge.Accessory._this._handleGetCharacteristics (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1167:10) at HAPServer.emit (events.js:315:20) at HAPServer.EventEmitter.emit (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/EventEmitter.ts:42:22) at HAPServer._this._handleCharacteristics (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/HAPServer.ts:756:12) at IncomingMessage. (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/HAPServer.ts:280:24) at IncomingMessage.emit (events.js:315:20) at endReadableNT (_stream_readable.js:1220:12) at processTicksAndRejections (internal/process/task_queues.js:84:21) [10/23/2020, 3:16:18 AM] [Sonos] warning: heartbeat 46, drift 562 [10/23/2020, 3:16:18 AM] Got SIGTERM, shutting down Homebridge...

Let me know what other info I can provide!

Zacknetic commented 3 years ago

No need. This update is incompatible with previous versions so you'll need to prune your magichome accessories.

You'll need to check "prune all accessories next restart" > restart > and uncheck "prune all accessories next restart". It will remove the magichome accessories but improve stability.

Let me know if this helps.

andywaplinger commented 3 years ago

Pruning will remove the accessories from the scenes they're currently in, right?

Zacknetic commented 3 years ago

That is correct.

Zacknetic commented 3 years ago

Let me know if your issue is solved.

In the future, assume that medium updates are incompatible with previous versions. That being said, this plugin comes free. I will not be held responsible if it does not work or causes issues.

Losing scenes sucks. I get it. Communication would have prevented problems like this. Currently, I only have a chance to interact with users when they post an issue here. By then, there is already a problem. It would be nice if I could put a warning near the “update” button in config UI X. Rolling back to previous versions would be nice too.

The issue is time, inventive, and experience. I only devote so much time of my life to this plugin but when I put time to it, I like to make big changes. This is my first public repository, I just don’t have the experience managing code that effects people’s lives.

It looks like I will be getting some sponsorship for this plugin soon through GitHub sponsors. That will give me more time and incentive to create updates that don’t break current setups.

I estimate ~100 active users of this plugin. If a handful chip in through GitHub sponsors I could update a detailed change log page, devote more time to new features, and be more responsive overall.

But who knows. Anyways, sorry for the trouble. Keep me posted.

On Oct 23, 2020, at 1:08 AM, Andy Waplinger notifications@github.com wrote:

 Pruning will remove the accessories from the scenes they're currently in, right?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Zacknetic commented 3 years ago

@andywaplinger Hope everything is good. Again sorry for the trouble I've caused. I believe I have solved the issue so update when you find the time.

Please update your plugin to version 1.5.1 . Note: if you are updating from version 1.4.x you'll need to purge all your magichome devices first.

With help, I found a bug in the code that caused duplicate device to register if the user had multiple subnets. Thus the crash. I was trying to scan on more than one subnet but didn't account for devices showing up on more than one.

Let me know how it goes. Thank you.

Zacknetic commented 3 years ago

Closing this issue for now. Please reopen if the problem persists. Thank you.

andywaplinger commented 3 years ago

Hey @Zacknetic! Sorry, I forgot that I don't receive email notifications for responses to issues and have to remember to check Github.

I had rolled back to 1.4.5 and for now am planning to keep it there until an issue crops up that requires an update. With the number of devices and scenes I have setup, it doesn't make sense for me to purge and re-setup everything when it's currently working for me without issues.

I hear you on investing your time into this for free. I certainly have no expectations of you investing some minimum amount of time into this - I'm just extremely thankful that someone more skilled than me has created a much-improved Magichome plugin.

Thanks for all that you're doing with this. Hopefully you're enjoying it and finding it fulfilling!

Zacknetic commented 3 years ago

Happy to be of service. That's a wonderful idea. These recent updates are for solving issues for other users. So if you don't find them relevant, it makes sense to stick with 1.4.x.

I will use this solution in the future.

Enjoy and thank you.