Get UniFi switch temperature?

Anyone played with this?
As I understand it:

  1. have to ssh into the switch
  2. once connected, telnet localhost
  3. show env
    this returns the temperatures.
    Having BIG issues with ssh!

You really expect help with so little info?

Thank you for your observation.
Do you think it unacceptable to ask if anyone is playing with UniFi switch temperatures?
I could have stopped at that request. I did, however include some further information.

The question remains - has anyone done any work on this subject?

What have you tried so far? What is the difficulty you have with ssh? Why would you ssh in and then run telnet?

AFAIK not all Unifi switches have a temperature sensor, but if they do it should be in the device info that you can pull out via the controller software.

There is a useful browser tool that lets you check what info is available from the device, demo here:

https://api-browser-demo.artofwifi.net/?action=list_devices

So adapting the Unifi device tracker to grab this info should be possible.

Why SSH then Telnet
Because that’s the way the switches work. There is very little exposed to an ssh session; the full cli is only available when telnet connected - no you can’t directly telnet into the switch.

SSH is username & password.

I didn’t want to have to import big SSH libraries, trying to keep this simple; unfortunately, Python’s SSH is not brilliant without importing external libraries.

would be nice if it had api calls, so no need to start searching for and re-formatting data

I think the info available is very device dependent. As are default access methods (http, ssh, telnet etc).