Control a device with a variable value

I may not have explained myself clearly.

Using the trigger, as soon as an action is performed on the button:

1st step, I retrieve its value:

2nd step, I want to send the previous value to an MQTT device:


But the value must be numeric — it’s impossible to use the variable…

If that works, I can create a single scene regardless of the button’s value.
If I’m forced to enter a numeric value, I have to create one scene per value; for this example, that makes 3 scenes…
Each scene uses a specific number in the trigger and sends the same value to the device.