Setting a dimmer device to the value of an input_number hjelper

I can’t figure out how to set my spotlight dimmer to the value of an input_number.

I’ve found out that I can use the input_number value in a notification like this:

{{ states('input_number.bad_kjeller_taklys_settpunkt_bevegelse') | int(0) }}

But I can’t get it to work when setting the device in an automation action.

Anybody who knows what I’m doing wrong here?

Well, I finally found a way to do it. Just had to call the light.turn_on service directly, and specify the input_number as the brightness_pct value. A bit cumbersome, but it worked.