System Monitoring - How does yours look?

Still work in progress

8 Likes

I’ve also got an unraid box and been trying to figure out how to get the total usage/free space across the array. Is that what the green unraid disk sensor is showing? If so, how did you get sensor?

Yes that’s it. In summary I am mounting usr/local/emhttp/state as a read only path. That folder has a bunch of config files that Unraid uses for its webui. Then I am parsing the disks.ini file to get disk info.
I started trying to make it into a custom component but haven’t had a lot of time and it’s pretty basic so far

Looks great!
how are you counting the sensors, cameras etc , can you please share the code?

Awesome, could you share the config for that?

edit could you also share the section of the yaml which does the headers above each of the sections? E.g. Unraid. Also the icons please :smile:

Oof, those counters are WAY too verbose. No need for a for loop. Here’s a shortened version of them all.

@klogg



#====================================
#=== Home Assistant Component counts
#====================================
sensor:
  - platform: template
    sensors:

    #----- Count Automations
      count_automations:
        entity_id: sensor.date
        value_template: "{{ states.automation | list | length }}"

    #----- Count Scripts
      count_scripts:
        entity_id: sensor.date
        value_template: "{{ states.script| list | length }}"

    #----- Count Device Trackers
      count_device_trackers:
        entity_id: sensor.date
        value_template: "{{ states.device_tracker | list | length }}"

    #----- Count Binary Sensors
      count_binary_sensors:
        entity_id: sensor.date
        value_template: "{{ states.binary_sensor| list | length }}"

    #----- Count Sensors
      count_sensors:
        entity_id: sensor.date
        value_template: "{{ states.sensor | list | length }}"

    #----- Count Switches
      count_switches:
        entity_id: sensor.date
        value_template: "{{ states.switch | list | length }}"

    #----- Count Zones
      count_zones:
        entity_id: sensor.date
        value_template: "{{ states.zone | list | length }}"

    #----- Input Booleans
      count_input_booleans:
        entity_id: sensor.date
        value_template: "{{ states.input_boolean | list | length }}"

    #----- Input Numbers
      count_input_numbers:
        entity_id: sensor.date
        value_template: "{{ states.input_number | list | length }}"

    #----- Input Texts
      count_input_texts:
        entity_id: sensor.date
        value_template: "{{ states.input_text | list | length }}"

    #----- Input Selects
      count_input_selects:
        entity_id: sensor.date
        value_template: "{{ states.input_select | list | length }}"

    #----- Input Date Times
      count_input_datetimes:
        entity_id: sensor.date
        value_template: "{{ states.input_datetime | list | length }}"
28 Likes

Why am I not surprised you saw a better way?! :slight_smile:

Thanks, as always.

I should add that it wasn’t my method, I filched it from someone else and had wanted to add an edit to my original post to that effect after it got a few likes, but because I can’t remember who I got it from to credit, never did.

just for educational purposes:

any reason not to use {{ states.automation | list | count }} ?

also, since ive just posted this as a solution to list and count domains, would you shorten that too with this |list|count: {{ states| groupby('domain') | list | count }} (since we need the for loop there anyway)

        value_template: >
          {%- for d in states | groupby('domain') %}
            {% if loop.first %}{{loop.length}} Domains:
            {% endif -%} {{d[0]}},
          {%- endfor %}

It was mine I’m ashamed to say I always find a way to make my templates as long winded as possible.

@petro you need to share your repo with me so I can learn anchors wait till you see my energy consumption template abortion, but hey it works its just really really really long.

3 Likes

Don’t be ashamed, I loved it.

Until @petro came along :stuck_out_tongue_winking_eye:

1 Like

I’ve been working the past 2 weeks to get my system into a cohesive setup. You don’t want to see my set up at the moment because it is very complicated where it doesn’t need to be, I haven’t updated sections since my initial startup (in 2016). I’m trying to streamline every page of my UI while removing stuff that doesn’t work / I don’t need anymore / is getting depreciated. I’m actually pretty close and I hope to have it posted within a week. I just have a bunch of appdaemon automations that I need to update, but I’ll do that after I post it.

EDIT: Here’s the repo, its a work in progress.

3 Likes

Just in case it helps, my post linked below has a simplified anchors example.

1 Like

Thanks man appreciate it, always learning this community is awesome for that.

Does anyone know what would be the best way to obtain system stats such as CPU, temperature, disk usage, etc from a remote Ubuntu 18.x Linux server please?

1 Like

ahh, superb, thank you! @tom_l

Mine’s very simple by comparison to most of the dashboards shown here, but this is mine:

The only custom UI element in use here is the Compact Custom Header.
And in case anyone’s interested in how this is layed out and configured:

  - badges: []
    cards:
      - type: 'custom:compact-custom-header'
        voice: hide
      - cards:
          - entities: []
            show_header_toggle: false
            title: "\U0001F5A5 Debian System Status"
            type: entities
          - cards:
              - entity: sensor.processor_use
                name: CPU Usage
                severity:
                  green: 0
                  red: 90
                  yellow: 65
                title: Processor
                type: gauge
                unit_of_measurement: '%'
              - entity: sensor.memory_use_percent
                name: Memory Usage
                severity:
                  green: 0
                  red: 90
                  yellow: 65
                title: Memory
                type: gauge
                unit_of_measurement: '%'
            type: horizontal-stack
          - cards:
              - Name: Disk Usage
                entity: sensor.disk_use_percent
                name: Disk Usage
                severity:
                  green: 0
                  red: 90
                  yellow: 65
                title: Disk
                type: gauge
                unit_of_measurement: '%'
              - entity: sensor.cpu_temp
                max: 105
                name: CPU Temp
                severity:
                  green: 0
                  red: 90
                  yellow: 70
                title: CPU Temp
                type: gauge
                unit_of_measurement: °C
            type: horizontal-stack
        type: vertical-stack
      - cards:
          - entities: []
            show_header_toggle: false
            title: "\U0001F5A5 Synology Status"
            type: entities
          - cards:
              - entity: sensor.cpu_load_total
                name: CPU Usage
                severity:
                  green: 0
                  red: 90
                  yellow: 65
                title: Processor
                type: gauge
                unit_of_measurement: '%'
              - entity: sensor.memory_usage_real
                name: Memory Usage
                severity:
                  green: 0
                  red: 90
                  yellow: 65
                title: Memory
                type: gauge
                unit_of_measurement: '%'
            type: horizontal-stack
          - cards:
              - entity: sensor.volume_used_volume_1
                name: Volume Usage
                severity:
                  green: 0
                  red: 90
                  yellow: 65
                title: Disk
                type: gauge
                unit_of_measurement: '%'
              - entity: sensor.temperature_sda
                max: 105
                name: Disk Temp
                severity:
                  green: 0
                  red: 90
                  yellow: 65
                type: gauge
                unit_of_measurement: °C
            type: horizontal-stack
        type: vertical-stack
      - cards:
          - entities: []
            show_header_toggle: false
            title: "\U0001F5A5 USG Status"
            type: entities
          - cards:
              - entity: sensor.unifi_gateway_wan_cpu
                name: CPU Usage
                severity:
                  green: 0
                  red: 90
                  yellow: 65
                title: Processor
                type: gauge
                unit_of_measurement: '%'
              - entity: sensor.unifi_gateway_wan_mem
                name: Memory Usage
                severity:
                  green: 0
                  red: 90
                  yellow: 65
                title: Memory
                type: gauge
                unit_of_measurement: '%'
            type: horizontal-stack
          - cards:
              - entity: sensor.unifi_gateway_firmware_upgradable
                name: Updates
                type: sensor
              - entity: sensor.unifi_gateway_alerts
                name: Alerts
                type: sensor
                unit_of_measurement: °C
            type: horizontal-stack
        type: vertical-stack
      - entities:
          - entity: sensor.plex
          - entity: sensor.nginx_service_status
          - entity: sensor.plex_service_status
        show_name: true
        show_state: true
        type: glance
      - entities:
          - entity: sensor.ssl_certificate_expiry
        type: entities
      - entities:
          - entity: sensor.status_smart_sda
          - entity: sensor.status_smart_sdb
          - entity: sensor.status_smart_sdc
          - entity: sensor.status_smart_sdd
        show_header_toggle: false
        title: Disk Health
        type: entities
    icon: 'mdi:server-network'
    id: Settings
    title: Network and Monitoring

Simple is good. You can see what you need to at a glance.

How did you get the usg cpu , memory data and update data? Can you share? Thanks