Using input_text in card

Hi
Hoping someone can help with this one. Spent hours on this confusing myself

I’m using a picture-element to display a feed from a camera, and that works well.
I’ve placed an icon on the camera so that when the user presses the icon, a pyscript is called that makes a REST call to the camera to get it to move where it is pointing at. This all works well, but my card passes the cameras a user id and and password to the pyscript, and i’m trying to hide that using input_text.

code is as follows

type: picture-elements
entity: camera.patio
camera_image: camera.patio
camera_view: live
elements:
  - type: icon
    icon: mdi:arrow-up
    tap_action:
      action: call-service
      service: pyscript.cam_move
      service_data:
        host: input_text.hostname

however instead of the value of input_text.hostname being sent to my pyscript, i actually get “input_text.hostname” being sent to the script.
How do i pass the value instead of the input_text name ?
Thanks

I don’t think it knows you are suppling it with a variable. I am not the most proficient at jinja formatting but try {input_text.hostname}

No, that won’t work. At the very least it would be {{ states('input_text.hostname') }}, but that requires the card to support templates there. Since you’re passing it to pyscript, can’t you retrieve the value of the entity from there based on the entity_id?

Having searched the forum for hours, i think i’ll follow your suggestion and pass a trigger to the pyscript and from there, reference the hostname and password in a way that keeps it hidden from the user.
Still reading up on how pyscript works

Thanks for the hint