snowdd1 / homebridge-knx

KNX platform shim for homebridge
https://github.com/nfarina/homebridge
GNU General Public License v2.0
97 stars 56 forks source link

Homebridge 1.0.0 compatibility #163

Closed risen closed 4 years ago

risen commented 4 years ago

I've noticed a couple of issues with the just released homebridge 1.0.0.

First, while the plugin was detected, I had to add:

    "platforms": [
        …
        {
            "name": "KNX",
            "platform": "KNX"
        },
        …
    ]

… to homebridge's config.json before it got actually used. I saw the following in the 1.0.0 release notes:

Platforms will no longer load unless they have been explicitly configured in the config.json

Second:

[4/27/2020, 1:14:20 PM] [KNX] Initializing KNX platform...
---
>>> knxd groupsocketlisten starting <<<
Plugin - Configure Accessory: Basement Cellar Light --> Added to restoredAccessories[]
[4/27/2020, 1:14:23 PM] Error: Cannot update reachability on non-bridged accessory!
    at Accessory._this.updateReachability (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:399:13)
    at PlatformAccessory.updateReachability (/usr/local/lib/node_modules/homebridge/src/platformAccessory.ts:124:34)
    at KNXPlatform.configureAccessory (/usr/local/lib/node_modules/homebridge-knx/index.js:163:12)
    at /usr/local/lib/node_modules/homebridge/src/server.ts:284:28
    at Array.filter (<anonymous>)
    at Server.restoreCachedPlatformAccessories (/usr/local/lib/node_modules/homebridge/src/server.ts:268:69)
    at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:156:10)
    at cli (/usr/local/lib/node_modules/homebridge/src/cli.ts:74:10)
    at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
    at Module._compile (internal/modules/cjs/loader.js:1156:30)
[4/27/2020, 1:14:23 PM] Got SIGTERM, shutting down Homebridge...

Guess homebridge's API had some breaking changes which homebridge-knx has to adapt to…

Luigi01W commented 4 years ago

Hi, I could temporarily resolve the "Error: Cannot update reachability on non-bridged accessory!" error by checking "Clear Cached Accessories" on the Settings page of the Homebridge Config UI X but unfortunately the errors comes back every them when you restart Homebridge.

tosate commented 4 years ago

The reason for this error is the call accessory.updateReachability(false); on line 161 in index.js. According to this, updateReachability has been deprecated and is not required.

Just remove the line and it works fine. Hopefully this will be fixed in a release very soon.

snowdd1 commented 4 years ago

Hi @tosate , did you try it with homebridge 1.0.4? There seems to be a fix for that.

snowdd1 commented 4 years ago

I just updated homebridge-knx (to v.23) and it works now with homebridge 1.0.4

tosate commented 4 years ago

Hi @snowdd1 I am running homebridge in docker. The image has been updated recently to homebridge 1.0.4. I have just updated the container and now everything works fine.

risen commented 4 years ago

Updated homebridge to 1.0.4 and homebridge-knx to 0.3.24, and everything seems to work. Thanks!