Ssh command_line (to read asus router cpu temperature) worked and now no more! why?

Hi,

I made a command_line template to read, using ssh, the cpu temperature of mine asus RT-AX88U
It worked fine for some days, either from the terminal than from the configuration.yaml

After the core update from 2021.6.2 to 2021.6.3, but I don’t think this is the main issue, it works only from the terminal and I get the error when called from the configuration.yaml file

Restored the core 2021.6.2, nothing change and issue still…What I made wrong?

This is the configuration:

>   - platform: command_line
>     name: RT-AX88U CPU Temp
>     command: ssh -i /config/.ssh/ssh_openSSH [email protected] -p 22xx cat /sys/class/thermal/thermal_zone0/temp
>     scan_interval: 300
>     unit_of_measurement: "°C"
>     value_template: '{{ value | float / 1000 | round(1) }}'

This is the error in the logs:

Command failed: command: ssh -i /config/.ssh/ssh_openSSH [email protected] -p 22xx cat /sys/class/thermal/thermal_zone0/temp

Thanks in advance for your kind help!!
Giorgio

You said it’s working in the terminal - is that in your HA terminal, or are you running it locally?

If the latter, try running the command via the HA terminal with minimal arguments (so just the ssh -i /config/.ssh/ssh_openSSH [email protected] part). I often get more informative error messages that way.

EKC Thanks for your reply

It works properly from the HA Terminal, without any issue
The same command inside configuration.yaml doesn’t work and display the command fail error

Regards

I don’t know why, but adding an option that I found here in the community, not needed somedays ago, I got it working again

-o StrictHostKeyChecking=no

ssh -i /config/.ssh/ssh_openSSH -o StrictHostKeyChecking=no [email protected] -p 22xx cat /sys/class/thermal/thermal_zone0/temp

1 Like

Glad you got it working. I am interested in doing something like this with my asus routers. Is this better than snmp?

I don’t know if it is better, but it works very simple