Allowing Multiple Alexa Devices to Allow Multiple Effects

There does seem to already be a post relating to this here, but it’s very confusing and seems to only include 50% of a conversation.

I hope that my suggestion makes it clear on what additions/changes I would like to be made to WLED. I have been able to do this already using espalexa, but it no longer seems to detect new devices whether I use a dot 1, 2 or app.

Basically, I would like to be able to define multiple names for the device and each one is linked to a specific effect so when you turn that device on it enables that mode. The initial setup would be something like this:

  espalexa.addDevice("Gutter", colorCallback);
  espalexa.addDevice("Rainbow Gutter", rainbowCallback);
  espalexa.addDevice("Rainbow Cycle Gutter", rainbowCycleCallback);
  espalexa.addDevice("Fire Gutter", fireCallback);

Then depending on whether it is a effect that allows colours or not, it may do this

void colorCallback(uint8_t brightness, uint32_t rgb) {
  Serial.print("Loading color preset with brightness ");
  Serial.print(brightness);
  Serial.print(" and colour ");
  Serial.println(rgb);
  loadPreset(color_preset, brightness, rgb);
}

or this

void rainbowCallback(uint8_t brightness) {
  Serial.print("Loading rainbow preset with brightness ");
  Serial.println(brightness);
  if (brightness == 0){
    ws2812fx.stop();
  } else {
    ws2812fx.setMode(FX_MODE_RAINBOW);
    ws2812fx.setSpeed(5000);
    ws2812fx.setBrightness(brightness);
    ws2812fx.start();
  }
}

Obviously this hard-coded method wouldn’t work for this project, but it shouldn’t be a huge addition to implement. In the settings, it could just have a load of tickboxes - one for each effect and you can tick maybe 5 of them. Each one would automatically add a new espalexa device with the name of the effect added before or after the device name and whether it supports colour or not.

What do you think?

Possible answer posted here: Call different presets from alexa - #16 by siggel