Getting started with Node Red, light to specified brightness

I tried YAML mode but same issue as before. The way I now sort of solved the issue, is that first comes call service turn_on, then 50ms delay and then call again service turn_on, but with the additional data for brightness.
And when turning off, first comes call service turn_ with additional data to dim the light to 1%, 50ms delay and the turn_off.

This was basically only way I got the light work as I want, without annoying flickering.
The issue has to have something to do with the fact that the light is controlled through cloud.

If anyone have other suggestion, I´m happy to test them.

I use JSON for all my light settings via Node-Red call service. See below:

In this case I am stepping the brightness up or down via inputs from a Sengled on/off/bright/dim switch.