Macros and brightness option

Hi!

I found some strange behaviour of brightness option using macros and HTTP API.

I have rest command in HA calling macros #1 with the following url:
http://192.168.1.60/win&M=1

In WLED web UI I have macros #1 with the following options to call preset 1 and set brightness to 255:
PL=1&A=255

The issue is that brightness doesn’t change. Brightness saved in preset is also 255. If light is dimmed preset changes to 1 but brightness doesn’t switch to 255 and stays the same as before calling macros #1.

Is this a bug or feature? :slight_smile: I’m using WLED version 0.9.0-b2 (2 weeks ago compiled in Arduino IDE from the github’s source).

Thanks!

When using the web / mobile WLED interface, if you run macro #1, does it function correctly?
If you select something other than preset #1, then select preset #1, does it set according to that preset?
If your HA call were to do something like this, would that resolve the problem:
http://192.168.1.60/win&A=255&PL=1
I only ask because sometimes high WAF has nothing at all to doing it “the right way”, nor “understanding why it does not work”.

Huh, I need to look into that.
By default the brightness of the preset is not applied, but the A=255 part should work.

You can try A=255&PL=1&PA=1, that will apply the 255 brightness from the preset!

Hi @Apapra, the problem is that the PL=1 part of the marco is processed later that the A=255 part.
The position in the macro doesn’t matter. To solve this you need to

  1. load the preset 1
  2. set the brightness to 255
  3. save it as preset 1 again
  4. change the macro to load the preset only: PL=1

@Aircoookie: a “new feature” would be to interate through all commands in the order of apperance instead of only using indexOf() for knowing the existance of the command.

Thanks to all who answered!

the problem is that the PL=1 part of the marco is processed later that the A=255 part.

Thanks, now it’s clear why I can’t change the brightness in macros. It would be nice to override preset settings using API commands in macros.