Temperature from another pi via ssh

i want to get the temperature from another pi. I found some information and a thread from 2017 https://community.home-assistant.io/t/read-data-from-another-pi/30655/2
I have installed the SSH Server addon and configured the ssh-key.
In the configuration i wrote

sensor pi_hole:
  - platform: command_line
    name: Pi-Hole Temperatur
    command: "ssh [email protected] echo $((`cat /sys/class/thermal/thermal_zone0/temp|cut -c1-2`)).$((`cat /sys/class/thermal/thermal_zone0/temp|cut -c3-4`))"
    unit_of_measurement: "°C"

But the temperature would not show.
If i type it in the terminal window they show me the temperature without asking the password.
Can anyone help me?

What’s in the logs?

Probably need to disable pseudo tty allocation

command: "ssh -T [email protected] ..."

How are you running Home Assistant? Docker, venv etc?

If you are running in a venv, did you activate the venv before configuring the ssh-keys?

If you’re running ssh from Hassio, then take a look at this:

There’s just a few steps to get ssh running smoothly in that context.

hi, i check it like that:

  - platform: command_line
    name: rpi3_cputemp_ssh
    command: "ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no  [email protected] -i /home/homeassistant/.keys/ssh2rpi3 'sudo cat /sys/class/thermal/thermal_zone0/temp' || echo Connection failed."
    unit_of_measurement: "°C"
    value_template: '{{ value | multiply(0.001) | round(1) }}'

HomeAssistant in a venv

Thank you all for your reply.
the log say this

Command failed: ssh [email protected] echo $((`cat /sys/class/thermal/thermal_zone0/temp|cut -c1-2`)).$((`cat /sys/class/thermal/thermal_zone0/temp|cut -c3-4`))

the command with -T also doesnt work

I downloaded the image from the homepage and installed it on an mircosd and run it on a raspberry pi 4

@Bit-River @void
i havent try it now. i will do this in the next time