Help request: Passing value to a Shell Command

Hi, I’d appreciate if anyone can help.

I’m trying to pass a variable (light brightness value) to a Shell command. If I replace the variable in curly braces and just put a number then it works fine. However if I try to pass the variable in the code below, it produces an error after changing the light brightness level
(Note: there is a second version commented out below and this also failed when trying):

2023-10-02 12:51:40.900 ERROR (MainThread) [homeassistant.components.shell_command] Error running command: python /config/python_scripts/ {{states('input_number.virtual_light_brightness')}}, return code: 1

NoneType: None

# Loads default set of integrations. Do not remove.

# Load frontend themes from the themes folder
  themes: !include_dir_merge_named themes

# Set logger level
  default: info

# Enable Python Scripts

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

    name: Virtual Light Brightness
    min: 0
    max: 255
    step: 1

  light_control: "python /config/python_scripts/ {{states('input_number.virtual_light_brightness')}}"
#  light_control: 'python /config/python_scripts/ {{ states.input_number.virtual_light_brightnes.state>'

I think I answerd my own question.
using echo -e ‘{{ states(“input_number.virtual_light_brightness”) }}’ in Dev. Tools → Templates - Editor worked well. I noticed the numbers all had .0 at the end.
I tried to adjust the Shell command variable value as follows {{ states(“input_number.virtual_light_brightness”)|int }} and it worked!
So it’s just about the varibale being a float instead of an integer that causes this.