Shell command with entity state

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

    python3 /config/python_scripts/ {{ states.luxtronik.warmteprod.state | float }} > 
    python3 /config/python_scripts/ > 

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

  upload_warmteprod: |
    python3 /config/python_scripts/ {{ states('luxtronik.warmteprod') | float }} > 

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: |