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.