derek-miller / homebridge-unifi-smartpower

Homebridge UniFi SmartPower Plugin
Apache License 2.0
7 stars 1 forks source link

Plugin fails to start. #39

Closed ericsmith66 closed 3 months ago

ericsmith66 commented 3 months ago

after configuring the plugin it fails to start with the the following error:

Describe Your Problem: usr/local/lib/node_modules/homebridge-unifi-smartpower/node_modules/lru-cache/src/index.ts:1454 throw new TypeError( ^ TypeError: At least one of max, maxSize, or ttl is required

[6/30/2024, 11:54:00 AM] [UniFi SmartPower] Restarting Process... [6/30/2024, 11:54:00 AM] [UniFi SmartPower] Launched child bridge with PID 739 [6/30/2024, 11:54:00 AM] Registering platform 'homebridge-unifi-smartpower.UniFiSmartPower' [6/30/2024, 11:54:00 AM] [UniFi SmartPower] Loaded homebridge-unifi-smartpower v2.1.1 child bridge successfully [6/30/2024, 11:54:00 AM] Homebridge v1.8.3 (HAP v0.12.2) (UniFi SmartPower) is running on port 56652. /usr/local/lib/node_modules/homebridge-unifi-smartpower/node_modules/lru-cache/src/index.ts:1454 throw new TypeError( ^ TypeError: At least one of max, maxSize, or ttl is required at new LRUCache (/usr/local/lib/node_modules/homebridge-unifi-smartpower/node_modules/lru-cache/src/index.ts:1454:13) at memoryStore (/usr/local/lib/node_modules/homebridge-unifi-smartpower/node_modules/cache-manager/dist/stores/memory.js:27:22) at caching (/usr/local/lib/node_modules/homebridge-unifi-smartpower/node_modules/cache-manager/dist/caching.js:15:50) at new UniFiSmartPower (/usr/local/lib/node_modules/homebridge-unifi-smartpower/src/uniFiSmartPower.ts:117:25) at new UniFiSmartPowerHomebridgePlatform (/usr/local/lib/node_modules/homebridge-unifi-smartpower/src/platform.ts:74:28) at ChildBridgeFork.startBridge (/usr/local/lib/node_modules/homebridge/src/childBridgeFork.ts:155:42)

Show the Homebridge logs here, remove any sensitive information.
[6/30/2024, 11:54:15 AM] [UniFi SmartPower] Loaded homebridge-unifi-smartpower v2.1.1 child bridge successfully
[6/30/2024, 11:54:15 AM] Homebridge v1.8.3 (HAP v0.12.2) (UniFi SmartPower) is running on port 56652.

/usr/local/lib/node_modules/homebridge-unifi-smartpower/node_modules/lru-cache/src/index.ts:1454
      throw new TypeError(
            ^
TypeError: At least one of max, maxSize, or ttl is required
    at new LRUCache (/usr/local/lib/node_modules/homebridge-unifi-smartpower/node_modules/lru-cache/src/index.ts:1454:13)
    at memoryStore (/usr/local/lib/node_modules/homebridge-unifi-smartpower/node_modules/cache-manager/dist/stores/memory.js:27:22)
    at caching (/usr/local/lib/node_modules/homebridge-unifi-smartpower/node_modules/cache-manager/dist/caching.js:15:50)
    at new UniFiSmartPower (/usr/local/lib/node_modules/homebridge-unifi-smartpower/src/uniFiSmartPower.ts:117:25)
    at new UniFiSmartPowerHomebridgePlatform (/usr/local/lib/node_modules/homebridge-unifi-smartpower/src/platform.ts:74:28)
    at ChildBridgeFork.startBridge (/usr/local/lib/node_modules/homebridge/src/childBridgeFork.ts:155:42)
[6/30/2024, 11:54:15 AM] [UniFi SmartPower] Child bridge process ended
[6/30/2024, 11:54:15 AM] [UniFi SmartPower] Process Ended. Code: 1, Signal: null
[6/30/2024, 11:54:22 AM] [UniFi SmartPower] Restarting Process...
[6/30/2024, 11:54:22 AM] [UniFi SmartPower] Launched child bridge with PID 774
[6/30/2024, 11:54:22 AM] Registering platform 'homebridge-unifi-smartpower.UniFiSmartPower'
[6/30/2024, 11:54:23 AM] [UniFi SmartPower] Loaded homebridge-unifi-smartpower v2.1.1 child bridge successfully
[6/30/2024, 11:54:23 AM] Homebridge v1.8.3 (HAP v0.12.2) (UniFi SmartPower) is running on port 56652.

/usr/local/lib/node_modules/homebridge-unifi-smartpower/node_modules/lru-cache/src/index.ts:1454
      throw new TypeError(
            ^
TypeError: At least one of max, maxSize, or ttl is required
    at new LRUCache (/usr/local/lib/node_modules/homebridge-unifi-smartpower/node_modules/lru-cache/src/index.ts:1454:13)
    at memoryStore (/usr/local/lib/node_modules/homebridge-unifi-smartpower/node_modules/cache-manager/dist/stores/memory.js:27:22)
    at caching (/usr/local/lib/node_modules/homebridge-unifi-smartpower/node_modules/cache-manager/dist/caching.js:15:50)
    at new UniFiSmartPower (/usr/local/lib/node_modules/homebridge-unifi-smartpower/src/uniFiSmartPower.ts:117:25)
    at new UniFiSmartPowerHomebridgePlatform (/usr/local/lib/node_modules/homebridge-unifi-smartpower/src/platform.ts:74:28)
    at ChildBridgeFork.startBridge (/usr/local/lib/node_modules/homebridge/src/childBridgeFork.ts:155:42)
[6/30/2024, 11:54:23 AM] [UniFi SmartPower] Child bridge process ended
[6/30/2024, 11:54:23 AM] [UniFi SmartPower] Process Ended. Code: 1, Signal: null
[6/30/2024, 11:54:30 AM] [UniFi SmartPower] Restarting Process...
[6/30/2024, 11:54:30 AM] [UniFi SmartPower] Launched child bridge with PID 782
[6/30/2024, 11:54:30 AM] Registering platform 'homebridge-unifi-smartpower.UniFiSmartPower'
[6/30/2024, 11:54:30 AM] [UniFi SmartPower] Loaded homebridge-unifi-smartpower v2.1.1 child bridge successfully
[6/30/2024, 11:54:30 AM] Homebridge v1.8.3 (HAP v0.12.2) (UniFi SmartPower) is running on port 56652.

Plugin Config:

{
    "name": "UniFi SmartPower",
    "host": "192.168.4.1",
    "port": 443,
    "username": "ericsmith67",
    "password": "xxxxxxxx",
    "controlSwitch": {
        "create": false,
        "name": "UniFi Control Enabled",
        "timeout": 60,
        "guardOutlets": true,
        "guardSwitchPorts": true
    },
    "includeInactivePorts": false,
    "refreshDevicesPollInterval": 600,
    "outletStatusCacheTtl": 15,
    "outletStatusPollInterval": 15,
    "logApiResponses": false,
    "platform": "UniFiSmartPower",
    "_bridge": {
        "username": "0E:7C:B2:AE:13:A8",
        "port": 56652
    }
}

Screenshots:

Environment:

derek-miller commented 3 months ago

What version of node and homebridge are you running?

ericsmith66 commented 3 months ago
Sorry , I thought I posted it : here it is : Homebridge is 1.8.3 OS macOS Sonoma

192.168.4.10 fe80::1c3d:63c6:258c:bc86 waverly.local ericsmith Node v20.15.0 /usr/local/bin /Users/ericsmith/.homebridge /Users/ericsmith/.homebridge/config.json /usr/local/lib/node_modules GMT-0500

derek-miller commented 3 months ago

Im not able to reproduce this issue with those versions. Try uninstalling and reinstalling. It seems like a corrupted install.

ericsmith66 commented 3 months ago

I tried it several times . No Joy.

derek-miller commented 3 months ago

What devices are you attempting to sync from UniFi? Im wondering if it is device specific. I am able to sync a UDM-SE, USW Enterprise 48, PDU Pro, a power strip, and a plug.

derek-miller commented 3 months ago

It may also just be a macOS specific issue. Do you have another computer (e.g. raspberry pi) you could temporarily try it on?

derek-miller commented 3 months ago

v2.1.2 should fix this issue. Re-open if it still fails.

derek-miller commented 3 months ago

Actually, v2.1.2 is broken too. Will publish a patch in a few minutes

derek-miller commented 3 months ago

Try v2.1.3