I can't use a template to set brightness_pct

I have an automation that turns on a light. I want to also set the brightness based on a helper number input, but every way I tried makes the automation to break and not even load.

action:
  - type: turn_on
    device_id: eb5661910adc11eb9f4d7fc3524a3b2b
    entity_id: light.ikea_bulb_1
    domain: light
    brightness_pct: "{{ states('input_number.brillo_escalera') | float }}"

The error I get on the log says that it expects a float but None was found.
The helper is defined on the UI, so there is no way to set a default value, not sure if that matters

I use this and it works without issues.

- id: 'study lights on via motion'
  alias: Study Lights On via Motion
  description: Control Study Lights with Shelly Motion Detection
  trigger:
  - platform: state
    entity_id: binary_sensor.shellymotionsensor_60a423c66d96_motion
    to: 'on'
  condition:
    - condition: state
      entity_id: light.study_cans_current_value
      state: 'off'
  action:
  - service: light.turn_on
    target:
      entity_id: light.study_cans_current_value
    data:
      brightness_pct: "{{states('input_number.brightness') | float(0)}}"
  mode: single

Device Actions don’t support templates. It expected to find a numeric value (float) for brightness_pct but instead it got something it didn’t understand (namely a template which it doesn’t support).

You have to use a service call, like in the example AllHailJ posted.

that mostly makes sense, thanks. I find a bit confusing to understand what things support templates and which ones doesn’t. I’d there any rule of thumb that I can use?

Thanks, that did the trick