Light Transition speed for addressable LEDs

I am trying to write an addressable LED device handler for WS2812B strips (using a particle photon).
The one existing project I found worked… sort of. But didn’t do close to the amount of things that I wanted.

I am struggling to find a way to make a device handler that can let me adjust brightness as well as speed.

My ideal device handler looks something like this:

__________________________________________________________
|      ON      |          Rainbow   |    3 color fade    |
|     OFF      |                    |    (Choose colors) |
__________________________________________________________
| Brightness   |   Pattern X        |   Pattern Y        |
| (Slider)     |                    |                    |
__________________________________________________________
| Speed        |
| (Slider)     |

I can’t seem to find out how to include two silders that reference different variables.
Anyone able to lend a hand?

Bonus question,
I am using a particle photon to run the lights, and will be having to push the commands via the API. How would you pass the brightness variable to the API?

For example, I know I can do this:

 standardTile("rainbow", "device.rainbow") {
		
    state "rainbow", label: '${name}', action: "rainbow", icon: "st.Lighting.light13", backgroundColor: "#d3ffd3",  iconColor: "#ffffff"
}

Assuming I had a “rainbow” function, obviously, but I dont know how to get the variable out to the function.