RGB lamp control works fine in developpers tool but not in UI

Hello,
I’m making an RGB control for an IKEA lamp (called ampoule_salle_de_jeux)
I first created 3 Input helpers called rgb_r, rgb_g and rgb_b
Then I created following dashoboard for the UI:



When I click the Lamp icon, it should Perform action Light_turn_on.
And lamp shoud glow according the settings of the three sliders

Instead, I get
image

In developpers tools - Actions

It works fine when I click Perfom Action
What’s wrong ?

Templates are not supported in UI Interactions.

The way you can do this is make a script with that turn on command, and then call that script from the action.

Templates are not supported by Home Assistant’s official set of Cards (the sole exception is the Markdown Card).

The standard workaround is to create a script containing your desired actions and templates. Then the Card’s “Tap behavior” is configured to call the script.

So what you tested in Developer Tools → Actions should be included in a script. Then for the Card’s “Perform Action”, set its target to the script.


… and while typing all of this, karwosts ninja’d me …

Great ! Thanks.

I had no idea about scripts. Here is what I did with minimal use of YAML code:
In settings - Automation & scenes I found scripts then clicked Create script

Then I create the script called rgb lamp in visual editor as follows:
Note the syntax used.

And finally in the UI Tile card configuration , added Interaction - Tap behaviour - Perform
and typed the script name (rgb lamp). I could have done do the same with a button