Shell command with entity state

I have a problem with a shell command
I have two shell commands in configuration.yaml:

shell_command:
  upload_warmteprod: 
    python3 /config/python_scripts/upload2.py {{ states.luxtronik.warmteprod.state | float }} > 
    /config/python_scripts/test_upload.json
  get_gateway_json: 
    python3 /config/python_scripts/gateway.py > 
    /config/python_scripts/gateway.json

The second shell command (get_gateway_json) works fine.
But the first shell command (upload_warmteprod) doesn’t work.
When i replace "{{ states.luxtronik.warmteprod.state | float }} " with a number (for instance 123.4) it works fine. So the problem resides in the template.
When I evaluates {{ states.luxtronik.warmteprod.state | float }} it also works fine.

What am I doing wrong?
Thanxs in advance.

Try this

shell_command:
  upload_warmteprod: |
    python3 /config/python_scripts/upload2.py {{ states('luxtronik.warmteprod') | float }} > 
    /config/python_scripts/test_upload.json

Thank you for your comment, but it didn’t work eather (I also tried that before).

I am talking about the colon after the command name

  upload_warmteprod: |