Remote RPI system monitor

I’ve updated the script to use a yaml config file now.

Hi, can you share where is MQTT configuration for user/password ?
Also how to modify script i would like to get data for additional discs attached to my RPI, it has only default “disk_use” as far as i can see.

Hi,

oh I forgot to expose username/password as an environment variable since I don’t need it.
Basically the script is the same as in the original repo and it is in the folder “src”. Easiest way for you would be adjusting the script to your needs (include additional parameter and use env variables for user/pw) and then rebuild the docker image.

Hope that helps a bit? If you have questions go ahead :slight_smile:

LbDab, please tell me how you configured this custom component?
I did everything as indicated on GitHub, tried it through HACS and manually, added init.py, manifest.json, sensor.py to / custom_components / ssh /, but I did not have this sensor in Home Assistant.

sensor.yaml

- platform: ssh
  host: 172.16.1.30
  unit_of_measurement: "°C"
  name: CPU Motioneyeos
  username: admin
  password: 040676
  command: cat /sys/class/thermal/thermal_zone0/temp
  value_template: >-
    {%- set line = value.split("\r\n") -%}
    {{ (line[1]|int / 1000) | round(1) }}

Just installed from HACS and added this setting to config.

If you manually ssh to 172.16.1.30 and write “cat /sys/class/thermal/thermal_zone0/temp” is it working?

Yes, ssh is fine.
ssh

There is no sensor in HA.


HassOS 3.12
Home Assistant 0.106.5
Python version 3.7.6

Logs should report about a problem

Only problem I saw with ssh sensor is with old ssh keys, if you changed something on same ip, try deleting “.ssh” folder in home assistant

Very nice, but were can I find the settings.yaml your revering to. With ls -a its not showing it?

Nevermind need to go in to src/

Trying to get the CPU temperature from a remote RPi (192.168.2.25) I use below code in configuration.yaml:

sensor CPU-25:
  - platform: ssh
    host: 192.168.2.25
    unit_of_measurement: "°C"
    name: "CPU-25"
    username: pi
    password: raspberry
    command: cat /sys/class/thermal/thermal_zone0/temp
    value_template: >-
      {%- set line = value.split("\r\n") -%}
      {{ (line[1]|int / 1000) | round(1) }}

I must be doing something wrong because I even do not see the entity in HA. Any help is appreciated!

Are you using my python script because it looks like you are just using ssh sensor

Thanks for your comment. I like your solution and I have no reason to doubt its proper functioning. But for me as a newbie it is a bit too complex, so I have now opted for a different solution.

Oke I get that but this is a topic about my script so maybe ask your question in a different topic :slight_smile:

Hi everyone I’ve just updated the script to include 2 requests:

2 Likes

Is it possible to pull the uptime with this of the system, I’m interested as I want to know for my Ubuntu server

could you make a issue on github that’s easier to track for me

1 Like

Hello,
I found your script by chance and I found it very useful, so I used it on two of my Raspberry Pi’s which are complementing my HA installation on a third Pi. I went through your code and it came to my mind that maybe with some modification I can apply your nice script also on Macs. In fact modifying few lines of code (on temperature and wifi strength), removing the part on the updates (no python-apt on Macs) and the power_status (specific for the RPI), I have been able to run it on my mac and produce the sensor to be shown in HA. I only need to define the script as a service and run it automatically at every reboot. Will do it in next days…
If you are interested I can give you my modified code and maybe you can merge and create a new script which can run on both kind of machines adding tags to the settings… I think it is not worth to clone and create a new repository…

regards,
Edoardo

1 Like

You can always create Pull request :wink:

1 Like

Fantastic Work.I have managed to set it up on my raspberry pi sending values to my HA Machine. Do you mind sharing your Lovelace card config please…looks amazing.

1 Like

No experience with MQTT previously, but I managed to install this on two Rpi’s and get the sensor data visible on my third (Hassio) Rpi… brilliant stuff!

1 Like

Quick question. I got everything running, but for some reason, each time HA is restarted, all my pi’s show unknown, unless I manually go in to each pi and restart the service.

What am I doing wrong?

Thanks