homebridge-lifx-plugin icon indicating copy to clipboard operation
homebridge-lifx-plugin copied to clipboard

Plugin enters crash loop when String light is auto discovered

Open ekinnear opened this issue 1 year ago • 6 comments

Describe The Bug: When a Lifx String Light is present on the network and auto discovery is turned on, the plugin (running in a child bridge) enters a crash loop.

When auto discovery is turned off, the crash loop stops.

Even once auto discovery is turned off, the plugin is now not able to control my existing bulbs that were working prior to adding the string lights. This happens even when removing the new lights from the accessory cache.

To Reproduce: Set up one of the new string lights on the network

Expected behavior: Even if not able to control the string light, it shouldn't crash

Logs:

[homebridge-lifx-plugin] This plugin generated a warning from the characteristic 'Manufacturer': characteristic value expected string and received undefined. See https://homebridge.io/w/JtMGR for more info.
[homebridge-lifx-plugin] This plugin generated a warning from the characteristic 'Model': characteristic value expected string and received undefined. See https://homebridge.io/w/JtMGR for more info.
TypeError: Cannot read properties of undefined (reading 'color')
    at Bulb.hasColors (/usr/lib/node_modules/homebridge-lifx-plugin/src/bulb.ts:60:47)
    at LifxPlatformAccessory.bindFunctions (/usr/lib/node_modules/homebridge-lifx-plugin/src/platformAccessory.ts:70:19)
    at /usr/lib/node_modules/homebridge-lifx-plugin/src/platformAccessory.ts:25:12
    at /usr/lib/node_modules/homebridge-lifx-plugin/src/bulb.ts:29:11
    at /usr/lib/node_modules/homebridge-lifx-plugin/src/bulb.ts:90:7
    at /usr/lib/node_modules/homebridge-lifx-plugin/src/bulb.ts:125:7
    at Client.<anonymous> (/usr/lib/node_modules/homebridge-lifx-plugin/node_modules/lifx-lan-client/src/lifx/light.js:218:5)
    at Client.<anonymous> (/usr/lib/node_modules/homebridge-lifx-plugin/node_modules/lifx-lan-client/src/lifx/client.js:428:26)
    at Array.forEach (<anonymous>)
    at Client.processMessageHandlers (/usr/lib/node_modules/homebridge-lifx-plugin/node_modules/lifx-lan-client/src/lifx/client.js:414:24)
[Lifx Plugin] Child bridge process ended
[Lifx Plugin] Process Ended. Code: 1, Signal: null

Plugin Config:

        {
            "name": "Lifx Plugin",
            "duration": 0,
            "brightnessDuration": 300,
            "colorDuration": 300,
            "default": "192.168.0.201",
            "broadcast": "192.168.0.255",
            "lightOfflineTolerance": 3,
            "messageHandlerTimeout": 45000,
            "resendPacketDelay": 150,
            "resendMaxTimes": 3,
            "updates": true,
            "debug": false,
            "autoDiscover": false,
            "_bridge": {
                "username": "...",
                "port": 37047
            },
            "platform": "LifxPlugin"
        },

Environment:

  • Plugin Version: v0.3.0
  • Homebridge Version: 1.7.0
  • Node.js Version: 18.6.0
  • NPM Version: 9.5.1
  • Operating System: Raspbian

ekinnear avatar Apr 14 '24 08:04 ekinnear

UPDATE: I managed to prevent the crash loop on my setup by excluding my 2x LIFX DL (downlight) bulbs. I also re-added my LIFX string light to the plugin and it continued to work.

ORIGINAL POST I am also experiencing the same bug, causing the plugin to enter a crash loop. But I am experiencing it regardless of whether auto-discover is on or off. I am also not sure if it is the String light that causes it, because I added my string light to the exclusion list and it still crashes.

Log

[5/19/2024, 11:13:06 AM] [homebridge-lifx-plugin] This plugin generated a warning from the characteristic 'Model': characteristic value expected string and received undefined. See https://homebridge.io/w/JtMGR for more info.
[5/19/2024, 11:13:07 AM] TypeError: Cannot read properties of undefined (reading 'color')
    at Bulb.hasColors (/homebridge/node_modules/homebridge-lifx-plugin/src/bulb.ts:60:47)
    at LifxPlatformAccessory.bindFunctions (/homebridge/node_modules/homebridge-lifx-plugin/src/platformAccessory.ts:70:19)
    at /homebridge/node_modules/homebridge-lifx-plugin/src/platformAccessory.ts:25:12
    at /homebridge/node_modules/homebridge-lifx-plugin/src/bulb.ts:29:11
    at /homebridge/node_modules/homebridge-lifx-plugin/src/bulb.ts:90:7
    at /homebridge/node_modules/homebridge-lifx-plugin/src/bulb.ts:125:7
    at Client.<anonymous> (/homebridge/node_modules/homebridge-lifx-plugin/node_modules/lifx-lan-client/src/lifx/light.js:218:5)
    at Client.<anonymous> (/homebridge/node_modules/homebridge-lifx-plugin/node_modules/lifx-lan-client/src/lifx/client.js:428:26)
    at Array.forEach (<anonymous>)
    at Client.processMessageHandlers (/homebridge/node_modules/homebridge-lifx-plugin/node_modules/lifx-lan-client/src/lifx/client.js:414:24)
[5/19/2024, 11:13:07 AM] [homebridge-lifx-plugin] This plugin generated a warning from the characteristic 'Manufacturer': characteristic value expected string and received undefined. See https://homebridge.io/w/JtMGR for more info.
[5/19/2024, 11:13:07 AM] [homebridge-lifx-plugin] This plugin generated a warning from the characteristic 'Model': characteristic value expected string and received undefined. See https://homebridge.io/w/JtMGR for more info.
[5/19/2024, 11:13:07 AM] TypeError: Cannot read properties of undefined (reading 'color')
    at Bulb.hasColors (/homebridge/node_modules/homebridge-lifx-plugin/src/bulb.ts:60:47)
    at LifxPlatformAccessory.bindFunctions (/homebridge/node_modules/homebridge-lifx-plugin/src/platformAccessory.ts:70:19)
    at /homebridge/node_modules/homebridge-lifx-plugin/src/platformAccessory.ts:25:12
    at /homebridge/node_modules/homebridge-lifx-plugin/src/bulb.ts:29:11
    at /homebridge/node_modules/homebridge-lifx-plugin/src/bulb.ts:90:7
    at /homebridge/node_modules/homebridge-lifx-plugin/src/bulb.ts:125:7
    at Client.<anonymous> (/homebridge/node_modules/homebridge-lifx-plugin/node_modules/lifx-lan-client/src/lifx/light.js:218:5)
    at Client.<anonymous> (/homebridge/node_modules/homebridge-lifx-plugin/node_modules/lifx-lan-client/src/lifx/client.js:428:26)
    at Array.forEach (<anonymous>)
    at Client.processMessageHandlers (/homebridge/node_modules/homebridge-lifx-plugin/node_modules/lifx-lan-client/src/lifx/client.js:414:24)
[5/19/2024, 11:13:07 AM] Got SIGTERM, shutting down Homebridge…

Plugin Config

    "name": "LIFX",
    "duration": 0,
    "brightnessDuration": 300,
    "colorDuration": 300,
    "default": "0.0.0.0",
    "broadcast": "255.255.255.255",
    "lightOfflineTolerance": 3,
    "messageHandlerTimeout": 45000,
    "resendPacketDelay": 150,
    "resendMaxTimes": 3,
    "updates": true,
    "debug": false,
    "autoDiscover": false,
    "bulbs": [
        {
            "name": "LIFX Mini Bed",
            "address": "xxx.xxx.xx.29"
        },
        {
            "name": "LIFX Mini 2 Bed",
            "address": "xxx.xxx.xx.38"
        },
        {
            "name": "Study North",
            "address": "xxx.xxx.xx.40"
        },
        {
            "name": "Study South",
            "address": "xxx.xxx.xx.47"
        },
        {
            "name": "Living Room LIFX",
            "address": "xxx.xxx.xx.21"
        }
    ],
    "excludes": [
        {
            "name": "LIFX Bedhead",
            "address": "xxx.xxx.xx.20",
            "id": "xxxREDACTEDxxx"
        }
    ],
    "platform": "LifxPlugin"
}

Environment: Plugin Version: v0.3.0 Homebridge Version: 1.8.2 Node.js Version: v20.12.2

greyham6 avatar May 19 '24 04:05 greyham6

I've experienced the same problem on a new A21 Bulb (with matter). I think these new lights have a different color setting which is causing the plugin to crash. It'll probably need updating to support the new lights.

kmahelona avatar Jun 01 '24 19:06 kmahelona

Same issue here, first time trying to use the plugin (after 90% of my lights stopped working natively with HomeKit). We have around 50 DL plus a couple Clean bulb and 8 switches. Each of these don’t appear to have native support at this stage. Any help on this would be appreciated, keen to get Home back working again, also with Adaptive Lighting ;-) Probably also the DLs being the culprit, I excluded the switches but didn’t solve that.. with 50 DLs probably too time consuming to exclude them all to also rule out the Clean bulbs. the switches actually state device registered for all 4 in each switch according to logs though. Without Child Bridge gave unable to start error for Homebridge. Log attached, let me know if there’s anything I can do to help with these specific devices. homebridge-lifx-plugin-2.log.txt

Plugin v0.3.0 Homebridge v1.8.3 NodeJS v20.9.0

Further I’ve turned off auto discovery, and specified just one Clean bulb to include. In the logs it refers to loading the 70+ cached accessories and doesn’t reboot loop. Added to home app and it managed to add one A19 Clean, one Downlight and one Switch component to assign to a room and rename - and all the rest into Default Room. Both DL annd Clean lights only appear as an on/off switch and the Switches say Not Supported.

nashw83 avatar Jun 21 '24 22:06 nashw83

In the meantime, got the crashing to stop by turning off auto-discover. Then, got the rest of the bulbs working by manually adding them one by one by IP address. That hadn't worked previously, but a full reset and re-add of the bulbs seems to have fixed the older bulbs.

Will likely take a plugin update to stop crashing with the new color options for the new bulbs, though.

ekinnear avatar Jun 24 '24 16:06 ekinnear

I have 8 A19s and just today bought an A21. Confirming that, after I set up the A21, I'm experiencing what was described in this bug -- a crash loop which prevents control of any of my bulbs.

Adding the A21 as an exclusion, as mentioned above, fixed the crash loop but now prevents control of the A21 from this plugin.

[1/10/2025, 2:59:56 PM] [homebridge-lifx-plugin] This plugin generated a warning from the characteristic 'Model': characteristic value expected string and received undefined. See https://homebridge.io/w/JtMGR for more info.
TypeError: Cannot read properties of undefined (reading 'color')
    at Bulb.hasColors (/var/lib/homebridge/node_modules/homebridge-lifx-plugin/src/bulb.ts:60:47)
    at LifxPlatformAccessory.bindFunctions (/var/lib/homebridge/node_modules/homebridge-lifx-plugin/src/platformAccessory.ts:70:19)
    at /var/lib/homebridge/node_modules/homebridge-lifx-plugin/src/platformAccessory.ts:25:12
    at /var/lib/homebridge/node_modules/homebridge-lifx-plugin/src/bulb.ts:29:11
    at /var/lib/homebridge/node_modules/homebridge-lifx-plugin/src/bulb.ts:90:7
    at /var/lib/homebridge/node_modules/homebridge-lifx-plugin/src/bulb.ts:125:7
    at Client.<anonymous> (/var/lib/homebridge/node_modules/homebridge-lifx-plugin/node_modules/lifx-lan-client/src/lifx/light.js:218:5)
    at Client.<anonymous> (/var/lib/homebridge/node_modules/homebridge-lifx-plugin/node_modules/lifx-lan-client/src/lifx/client.js:428:26)
    at Array.forEach (<anonymous>)
    at Client.processMessageHandlers (/var/lib/homebridge/node_modules/homebridge-lifx-plugin/node_modules/lifx-lan-client/src/lifx/client.js:414:24)

seeARMS avatar Jan 11 '25 01:01 seeARMS

I'm experiencing this same issue with my new SuperColor ceiling lights. Here's my log:

[3/8/2025, 3:37:52 AM] [Lifx Plugin] Restarting Process...
[3/8/2025, 3:37:53 AM] [Lifx Plugin] Launched child bridge with PID 170294
[3/8/2025, 3:37:53 AM] Registering platform 'homebridge-lifx-plugin.LifxPlugin'
[3/8/2025, 3:37:53 AM] [Lifx Plugin] Loaded homebridge-lifx-plugin v0.3.0 child bridge successfully
[3/8/2025, 3:37:53 AM] Loaded 8 cached accessories from cachedAccessories.0EDC4D674916.
[3/8/2025, 3:37:53 AM] [homebridge-lifx-plugin] This plugin generated a warning from the characteristic 'Firmware Revision': Characteristic not in required or optional characteristic section for service AccessoryInformation. Adding anyway.. See https://homebridge.io/w/JtMGR for more info.
[3/8/2025, 3:37:53 AM] [homebridge-lifx-plugin] This plugin generated a warning from the characteristic 'Firmware Revision': Characteristic not in required or optional characteristic section for service AccessoryInformation. Adding anyway.. See https://homebridge.io/w/JtMGR for more info.
[3/8/2025, 3:37:53 AM] [homebridge-lifx-plugin] This plugin generated a warning from the characteristic 'Firmware Revision': Characteristic not in required or optional characteristic section for service AccessoryInformation. Adding anyway.. See https://homebridge.io/w/JtMGR for more info.
[3/8/2025, 3:37:53 AM] [homebridge-lifx-plugin] This plugin generated a warning from the characteristic 'Firmware Revision': Characteristic not in required or optional characteristic section for service AccessoryInformation. Adding anyway.. See https://homebridge.io/w/JtMGR for more info.
[3/8/2025, 3:37:53 AM] [homebridge-lifx-plugin] This plugin generated a warning from the characteristic 'Firmware Revision': Characteristic not in required or optional characteristic section for service AccessoryInformation. Adding anyway.. See https://homebridge.io/w/JtMGR for more info.
[3/8/2025, 3:37:53 AM] [homebridge-lifx-plugin] This plugin generated a warning from the characteristic 'Firmware Revision': Characteristic not in required or optional characteristic section for service AccessoryInformation. Adding anyway.. See https://homebridge.io/w/JtMGR for more info.
[3/8/2025, 3:37:53 AM] Homebridge v1.9.0 (HAP v0.12.3) (Lifx Plugin) is running on port 49131.
[3/8/2025, 3:37:53 AM] 

NOTICE TO USERS AND PLUGIN DEVELOPERS
> Homebridge 2.0 is on the way and brings some breaking changes to existing plugins.
> Please visit the following link to learn more about the changes and how to prepare:
> https://github.com/homebridge/homebridge/wiki/Updating-To-Homebridge-v2.0

[3/8/2025, 3:37:54 AM] [homebridge-lifx-plugin] This plugin generated a warning from the characteristic 'Manufacturer': characteristic value expected string and received undefined. See https://homebridge.io/w/JtMGR for more info.
[3/8/2025, 3:37:54 AM] [homebridge-lifx-plugin] This plugin generated a warning from the characteristic 'Model': characteristic value expected string and received undefined. See https://homebridge.io/w/JtMGR for more info.
TypeError: Cannot read properties of undefined (reading 'color')
    at Bulb.hasColors (/homebridge/node_modules/homebridge-lifx-plugin/src/bulb.ts:60:47)
    at LifxPlatformAccessory.bindFunctions (/homebridge/node_modules/homebridge-lifx-plugin/src/platformAccessory.ts:70:19)
    at /homebridge/node_modules/homebridge-lifx-plugin/src/platformAccessory.ts:25:12
    at /homebridge/node_modules/homebridge-lifx-plugin/src/bulb.ts:29:11
    at /homebridge/node_modules/homebridge-lifx-plugin/src/bulb.ts:90:7
    at /homebridge/node_modules/homebridge-lifx-plugin/src/bulb.ts:125:7
    at Client.<anonymous> (/homebridge/node_modules/homebridge-lifx-plugin/node_modules/lifx-lan-client/src/lifx/light.js:218:5)
    at Client.<anonymous> (/homebridge/node_modules/homebridge-lifx-plugin/node_modules/lifx-lan-client/src/lifx/client.js:428:26)
    at Array.forEach (<anonymous>)
    at Client.processMessageHandlers (/homebridge/node_modules/homebridge-lifx-plugin/node_modules/lifx-lan-client/src/lifx/client.js:414:24)
[3/8/2025, 3:37:54 AM] [Lifx Plugin] Child bridge process ended
[3/8/2025, 3:37:54 AM] [Lifx Plugin] Process Ended. Code: 1, Signal: null
[3/8/2025, 3:38:01 AM] [Lifx Plugin] Restarting Process...

pickanothername avatar Mar 08 '25 11:03 pickanothername