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/light_control.py {{states('input_number.virtual_light_brightness')}}, return code: 1

NoneType: None

# Loads default set of integrations. Do not remove.
default_config:

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

# Set logger level
logger:
  default: info

# Enable Python Scripts
python_script:

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

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


shell_command:  
  light_control: "python /config/python_scripts/light_control.py {{states('input_number.virtual_light_brightness')}}"
#  light_control: 'python /config/python_scripts/light_control.py {{ 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.