opctim / homebridge-espresense

Homebridge implementation for using ESPresense node data as occupancy sensors in HomeKit. This plugin is an alternative to using HomeAssistant, as ESPresense is primarily built for HA.
Apache License 2.0
8 stars 1 forks source link

Keep getting this error message in my log, any suggestions? FIXED #4

Open ShaunRoberts543 opened 1 year ago

ShaunRoberts543 commented 1 year ago

TypeError: Cannot read properties of undefined (reading 'url') at new EspresenseHomebridgePlatform (/var/lib/homebridge/node_modules/homebridge-espresense/src/platform.ts:34:24)

ShaunRoberts543 commented 1 year ago

Some more error messages:

[ESPresense] Initializing ESPresense platform... [20/06/2023, 17:38:11] TypeError: Cannot read properties of undefined (reading 'url') at new EspresenseHomebridgePlatform (/var/lib/homebridge/node_modules/homebridge-espresense/src/platform.ts:34:24) at /var/lib/homebridge/node_modules/homebridge/src/server.ts:474:40 at Array.forEach () at Server.loadPlatforms (/var/lib/homebridge/node_modules/homebridge/src/server.ts:401:27) at Server.start (/var/lib/homebridge/node_modules/homebridge/src/server.ts:176:29) [20/06/2023, 17:38:11] Got SIGTERM, shutting down Homebridge... [20/06/2023, 17:38:11] AssertionError [ERR_ASSERTION]: Cannot generate setupURI on an accessory that isn't published yet! at Bridge.Accessory.setupURI (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:994:11) at Server.setServerStatus (/var/lib/homebridge/node_modules/homebridge/src/server.ts:155:45) at Server.teardown (/var/lib/homebridge/node_modules/homebridge/src/server.ts:199:10) at signalHandler (/var/lib/homebridge/node_modules/homebridge/src/cli.ts:93:12) at process.emit (node:events:513:28) at process.emit (/var/lib/homebridge/node_modules/homebridge/node_modules/source-map-support/source-map-suppor

ShaunRoberts543 commented 1 year ago

My current config: { "platforms": [ { "name": "homebridge-espresense", "platform": "ESPresense", "mqtt": { "url": "mqtt://192.168.X.XX:1883", "options": { "username": "XXXXXX", "password": "XXXXXXX" } }, "roomSettings": [ { "name": "Office", "maxDistance": 2, "absorption": 3.5, "activeScan": true, "timeout": 6000, "devices": [ "apple:1005:9-8" ] } ] } ], "plugins": [ "homebridge-espresense" ], "platform": "ESPresense" }

ShaunRoberts543 commented 1 year ago

I think I had too much I copied over from the sample config.json. I cleaned it up and removed the duplicated platforms and whatnot and it started to show up in HK. Issue now is it is not correctly reporting status and also my logs are showing it is shutting off auto-scan, but I have it set to "true".

WFL-Niek commented 1 day ago

Hey @ShaunRoberts543, I'm running into the same error. Did you just remove the entire 'bridge' section of the config? Setup docs are severely lacking.

I have the following config but the error persists:

{
    "platforms": [
        {
            "name": "homebridge-espresense",
            "platform": "ESPresense",
            "mqtt": {
                "url": "mqtt://192.168.XXX.XXX:1883",
                "options": {}
            },
            "roomSettings": [
                {
                    "name": "Living Room",
                    "maxDistance": 2,
                    "absorption": 3.5,
                    "activeScan": true,
                    "timeout": 6000,
                    "devices": [
                        "apple:1007:xx-xx"
                    ]
                }
            ]
        }
    ],
    "plugins": [
        "homebridge-espresense"
    ],
    "platform": "ESPresense"
}