smhex / homebridge-wled-ws

Homebridge Plugin for LED strips controlled by WLED
Apache License 2.0
7 stars 1 forks source link

If one controller is not available, presets don't load for subsequent controllers #124

Open DataFran opened 1 month ago

DataFran commented 1 month ago

Describe The Bug: I have four identical Athom mini USB-C controllers, each connected to the same 60-led strip. If one is unplugged, or unavailable on wifi, the next controller listed in the config doesn't show preset tiles.

To Reproduce: This seems to only be an issue when first setting up the controller, if I unplug the second-to-last controller after the last one is set up, it seems to load fine. Therefore, now that it's ostensibly solved, I cannot reproduce.

Expected behavior: If one controller is unavailable for whatever reason when adding a new one, it the new one should load properly.

Logs: N/A

Show the Homebridge logs here, remove any sensitive information.

Plugin Config:

{
    "name": "wled-ws platform",
    "controllers": [
        {
            "name": "WLED Bathroom",
            "address": "wledbath.local",
            "showRealTimeModeButton": false,
            "resetRealTimeModeAfterStream": true
        },
        {
            "name": "WLED Office",
            "address": "wledoffice.local",
            "presets": "Blends,Solid",
            "showRealTimeModeButton": false,
            "resetRealTimeModeAfterStream": true
        },
        {
            "name": "WLED TV",
            "address": "wledtv.local",
            "presets": "Blends,Normal",
            "showRealTimeModeButton": false,
            "resetRealTimeModeAfterStream": true
        },
        {
            "name": "WLED Homepod",
            "address": "wledhomepod.local",
            "presets": "Blends,Solid",
            "showRealTimeModeButton": false,
            "resetRealTimeModeAfterStream": true
        },
        {
            "name": "WLEDdan",
            "address": "wleddanning.local",
            "presets": "ColorLoop,White",
            "showRealTimeModeButton": false,
            "resetRealTimeModeAfterStream": true
        }
    ],
    "logging": false,
    "platform": "wled-ws"
}

Like I said this seems to be an initial setup problem only, and not critical, but left me baffled for a while last night as I setting up pair of new controllers one at a time, while sitting at my desk, before going to install them in their final locations.

smhex commented 1 month ago

Hi @DataFran ,

thanks for your report. I am not sure if I understood the issue right. Let's assume I start from scratch - what are the steps I need to reproduce it (even if the error does not come up)?

  1. Download the plugin
  2. Connect controller to network
  3. Configure first controller using plugin settings
  4. Save and restart plugin
  5. Disconnect first controller
  6. Connect second controller to network
  7. Configure second controller using plugin settings
  8. ....

Can you please edit/extend the list above? Maybe I am able to add a more detailed logging or make the code more robust. I own only one controller...

Thanks your very much

DataFran commented 1 month ago
1. Download the plugin
2. Connect controller to network
3. Configure first controller using plugin settings
4. Save and restart plugin
5. Disconnect first controller
6. Connect second controller to network
7. Configure second controller using plugin settings
8. Save and restart
9. At this point ONLY the light itself appears in Homebridge Accessories/Homekit, any presets configured in Step 7 do not appear.
10. If I reconnect the controller disconnected in Step 5, and re-save/reload the plugin, all seems well and the presets load and stay loaded even if I disconnect the Step 5 controller again and save/reload. So, in order to configure a new controller, ALL controllers configured in the plugin must be connected first.

Does that make sense?

I realize this is an edge case, and certainly not urgent, but I appreciate your help, and your plugin!

smhex commented 1 month ago

Okay, thank you. I will try to repeat the steps. The preset handling is different from the normal light functionality as the switches are created and removed dynamically by the plugin. Maybe there is something I missed when developing it. Before I start - what plugin version do you use and which firmware is your wled controller on?