oogje / homebridge-i6-bigAssFans

A Homebridge plugin which allows you to control a Big Ass Fan.
MIT License
18 stars 3 forks source link

Homebridge cannot start w/plugin enabled. Support for regular Haiku? #9

Closed jF-X closed 2 years ago

jF-X commented 2 years ago

Describe Your Problem:

I was previously using homebridge-bigAssFans v1.1.5 plugin and that worked out well for the older fan firmware. After updating the fan firmware to use the new Big Ass Fans app, I discovered the old plugin no longer worked with the fan. I think this is to be expected. I found this plugin and it appears to have recently added support for the new firmware fans. I didn't see mention of the 'regular' Haiku, but was hoping this may work for me.

After installing and configuring this plugin, Homebridge does not come back up after reboot. If I disable the plugin, Homebridge runs ok. I am hoping to get this working again if possible, but realize my fan might not be supported. Happy to assist with collecting any info that you may need from the regular Haiku as well. Thanks!

Logs:

[5/15/2022, 1:12:55 PM] Loaded plugin: homebridge-i6-bigassfans@0.4.3
[5/15/2022, 1:12:55 PM] Registering platform 'homebridge-i6-bigassfans.BigAssFans-i6'
...
[5/15/2022, 1:12:56 PM] [BigAssFans-i6] Initializing BigAssFans-i6 platform...
[5/15/2022, 1:12:56 PM] [BigAssFans-i6] Finished initializing platform
...
[5/15/2022, 1:12:56 PM] [BigAssFans-i6] Executed didFinishLaunching callback
[5/15/2022, 1:12:56 PM] [BigAssFans-i6] Init - initializing devices
[5/15/2022, 1:12:56 PM] [BigAssFans-i6] Adding new accessory: Haiku
...
[5/15/2022, 1:12:56 PM] Publishing bridge accessory (name: Homebridge C1A5, publishInfo: {
  username: '**',
  port: **,
  pincode: '***-**-***',
  category: 2,
  bind: undefined,
  mdns: undefined,
  addIdentifyingMaterial: true,
  advertiser: undefined
}).
Setup Payload:
X-HM://**
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:

 ***-**-***

[5/15/2022, 1:12:56 PM] Homebridge v1.4.1 (HAP v0.10.2) (Homebridge C1A5) is running on port 52497.
[5/15/2022, 1:12:56 PM] [BigAssFans-i6] dblog progress(0/0) Haiku - model: Haiku H/I Series (0x48, 0x61, 0x69, 0x6b, 0x75, 0x20, 0x48, 0x2f, 0x49, 0x20, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73)
[5/15/2022, 1:12:56 PM] [BigAssFans-i6] dblog progress(0/0) Haiku - firmware: 3.0.1
[5/15/2022, 1:12:56 PM] TypeError: Cannot read properties of undefined (reading 'updateCharacteristic')
    at lightOnState (/homebridge/node_modules/homebridge-i6-bigassfans/src/platformAccessory.ts:1211:31)
    at onData (/homebridge/node_modules/homebridge-i6-bigassfans/src/platformAccessory.ts:696:7)
    at Socket.<anonymous> (/homebridge/node_modules/homebridge-i6-bigassfans/src/platformAccessory.ts:652:5)
    at Socket.emit (node:events:390:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at Socket.Readable.push (node:internal/streams/readable:228:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:199:23)
[5/15/2022, 1:12:56 PM] Got SIGTERM, shutting down Homebridge...
[5/15/2022, 1:12:56 PM] [BigAssFans-i6] Haiku - light detected
[5/15/2022, 1:12:56 PM] [BigAssFans-i6] Haiku - current relative humidity out of range: 1000, assuming no humidity sensor for model "Haiku H/I Series"

Plugin Config: Fan has a static IP and confirmed Mac address is correct as reported on my network. (redacted)

{
    "fans": [
        {
            "name": "Haiku",
            "ip": "10.x.x.x",
            "mac": "xx:xx:xx:xx:xx:xx",
            "fanModel": "other",
            "whoosh": false,
            "fanAuto": false,
            "lightAuto": false,
            "dimToWarm": false,
            "ecoMode": false
        }
    ],
    "platform": "BigAssFans-i6"
}

Screenshots:

Environment:

oogje commented 2 years ago

Hello. Thanks for the log output. I think I see what's happening. If I'm right you can work around this bug by setting the lightAuto configuration attribute to true. If that prevents the crash, then I''ll push out a new version and then you can set lightAuto back to false.

jF-X commented 2 years ago

That appears to have done the trick, thanks! I can work on testing some of the other features and report back if anything crops up if that helps.

oogje commented 2 years ago

Very good. thank you!

oogje commented 2 years ago

I've pushed out homebridge-i6-bigassfans@0.5.0-beta3 to fix this issue.