System Monitoring - How does yours look?

Hi @tom_l! I’m monitoring the ERX using a custom_component created by @bar

Here’s the link to the github page. Also here is the link to the HA forum page.

1 Like


That image inspires me!

I’m generally not a big fan of image backgrounds, but it would be totally cool to get some imagery of old-time monitors, oscilloscopes, tvs, radios, airplane instruments, or auto instruments and use them to as frames for HASS graphs etc.

I don’t have the time to do it, but I am inspired to suggest it.

Cheers, Richard

2 Likes

Hasn’t been updated in 4 years. I wouldn’t count on this.

Can you share your configuration? Thank you……可以分享下你的配置么?谢谢……

brazil-terminal

1 Like

what part would you be interested in?

Here is mine… Lot of system monitor things :smiley:

Hey…

How far are you with this new cockpit view?

I am quite interested on using it, maybe slightly modified to show the battery level of my Xiaomi devices. I have tons of them but no easy way to show all the battery levels at once.

curous how you are pulling data from another computer? ssh server, and mqtt server?
care to post up your config for that?

thanks

Im using a script on every server:

Install below on every server: (my situation Debian Stretch)

sudo apt-get install build-essential python-dev python-pip
sudo pip install paho-mqtt
sudo pip install psutil
sudo reboot
cd /home/USER-DIR/
nano systemdata.py

Change in your script your MQTT SERVER INFO
script:

#References: Thanks to these resoruces!
#http://www.isendev.com/app/entry/39
#https://pythonhosted.org/psutil/

import sys, psutil, datetime, paho.mqtt.client as mqtt, json
from time import gmtime, strftime
import os

def getVoltage():
        try:
                res1 = os.popen('vcgencmd measure_volts core').readline()
                tmp2 = res1.replace("volt=","")
                tmp2 = tmp2.replace("V","")
                tmp2 = tmp2.replace("\n","")
                return tmp2
        except:
                return 0

def getCPUtemperature():
        try:
                res = os.popen('vcgencmd measure_temp').readline()
                tmp1 = res.replace("temp=","")
                tmp1 = tmp1.replace("'","")
                tmp1 = tmp1.replace("C","")
                #print tmp1
                return tmp1
        except:
                return 0

def bytes2human(n):
# http://code.activestate.com/recipes/577972-disk-usage/
    symbols = ('K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y')
    prefix = {}
    for i, s in enumerate(symbols):
        prefix[s] = 1 << (i+1)*10
    for s in reversed(symbols):
        if n >= prefix[s]:
            value = float(n) / prefix[s]
            return '%.1f%s' % (value, s)
    return "%sB" % n


temp1 = int(float(getCPUtemperature()))
cputemp=temp1
#cputemp = 9.0/5.0*temp1+32

voltage = getVoltage()

currtime = strftime("%H:%M:%S - %d-%m-%Y")

boottime = datetime.datetime.fromtimestamp(psutil.boot_time()).strftime("%H:%M:%S - %d-%m-%Y")

topic = "homeassistant/ssh_server/systemstatus"

cpupercent = psutil.cpu_percent(interval=1)
vmem = psutil.virtual_memory().percent
diskusage =  psutil.disk_usage('/').percent
disktotal = bytes2human( psutil.disk_usage('/').total )

payload = { 'datetimedatacollected': currtime,
 'cpuusage': cpupercent, 'boottime': boottime,
 'virtualmem': vmem, 'diskusage': diskusage,
 'volt': voltage, 'cputemp': cputemp, 'disktotal': disktotal }

mqtthost = "MQTT SERVER IP"
mqttuser = "MQTT SERVER USERNAME"
mqttpwd = "MQTT SERVER PASSWORD"

client = mqtt.Client()
client.username_pw_set(mqttuser, mqttpwd)
client.connect(mqtthost, 1883, 60)

payload_json = json.dumps(payload)

print (payload_json)

persistant_data = True

client.publish(topic, payload_json, 0, persistant_data)
client.disconnect()

sys.exit()
sudo crontab -e
*/5 * * * * python /home/pi/systemdata.py

In HA I have some MQTT Sensors:

---
platform: mqtt
state_topic: "homeassistant/mqtt_server/systemstatus"
name: "MQTT Boot Time"
value_template: "{{ value_json.boottime }}"

create for every below status a sensor mqtt and change the line:

value_template: “{{ value_json.XXXXX }}”

XXXXX is value below

currtime
cpupercent
boottime
vmem
diskusage
voltage
cputemp
disktotal

3 Likes

thanks, got it all installed, but when i restart my (working) mosquitto server i get a subscribe from the paho client but nothing is sent or =updated.

not even sure how to debug that,. lol

ok got it somewhat working, didn’t realize this is for a RPI. sop the voltage and temp wont work, because of the vcgencmd command specific to the rpis. anyone know how to implement those two commands to work in this python script? i know this:

- platform: command_line
  name: CPU Temp
  command: "cat /sys/devices/platform/coretemp.0/hwmon/hwmon1/temp2_input"
  unit_of_measurement: "°C"
  value_template: '{{ (value | multiply(0.001)) | round(0) }}'

works on linux, just dont know how to modify that script with it, or if its possble,.

anyway thanks, i may still use the other bits that work,

Would you mind sharing the writing of lights and switches? It’s beautiful!

These are made with button-card. Take a look over there, the possibilities are near endless… :wink:

How are you styling the things status entities? I want to display all networked devices as red/green as per your set up. Do you mind sharing your lovelace yaml please?

Hi @officialmatt!

I’m using the device tracker to ping my devices:

device_tracker:
  - platform: ping
    hosts:
      eagle_gateway: 10.0.20.207

Then I convert the device_tracker state of not home or home to a numeric value:

      eagle_gateway_state:
        friendly_name: 'Eagle Gateway'
        entity_id: device_tracker.eagle_gateway
        value_template: >-
          {% if is_state('device_tracker.eagle_gateway', 'home') %}
            100
          {% elif is_state('device_tracker.eagle_gateway', 'not_home') %}
            0
          {% endif %}

here is the lovelace yaml I’m using for the section of the entity’s status

            - type: entities
              show_header_toggle: off
              entities:
              - type: section
                label: THINGS STATUS
              - type: custom:bar-card 
                title_position: inside
                align: center
                padding: 4px
                card_style: 
                  border-radius: 5px
                columns: 1
                entities:
                  - entity: sensor.eagle_gateway_state
                    show_value: false
                    (removed the long list of entities)
                severity:
                  - value: 0
                    color: '#bf4040'
                  - value: 100
                    color: '#1db954'
1 Like

why would you do that? not necessary for the buttons is it?

nevermind, I was mistakenly assuming you used button card. sorry.

you can try a template like this though (and you shouldn’t need the entity_id to have the template follow the state):

  value_template: >-
    {% set state = states('device_tracker.eagle_gateway') %}
    {{100 if state == 'home' else 0}}
1 Like

Thankyou! I thought the solution might be something like this, with template sensors. I am using Binary Sensor/Ping on these devices https://www.home-assistant.io/integrations/ping/ and was hoping to not have to create another sensor just for my UI!

show us your code, and we can help building something like that. The above setup really relies on my own entities (difference types of lights and switches) and is fairly tailor-made…
So, show us what you’ve got so far, and continue from there.