System Monitoring - How does yours look?

see [From avoidance to amazement (my Lovelace setup)]

=)

1 Like

From a year of observation of the pi GPU temp, it is always within 1 °C of the CPU temp. I’m going to remove the sensor.

how is coreos cpu load other than cpu load

can you please show us yor config for system-monitor.
how to get docker listing over here.
and one more and last thing how to get only 2 digit for cpu load as i am getting some 6 digit after decimal.

Nothing very original here but I thought I’d join in :slight_smile:

15 Likes

It is clean and informative. Would you mind sharing your config file.

Of course not :slight_smile:

The clock card is courtesy of Palm Springs Theme but it doesn’t always update on this view (which is the first one) although it does seem to on another test view. I posted the question but no one has replied.

#================================
#===
#=== SYSTEM
#===
#================================
title: System Information
icon: mdi:home-assistant
cards:

  - type: vertical-stack
    cards:
      
      - type: custom:compact-custom-header
        main_config: true
        background: var(--primary-background-color)
        active_tab_color: yellow
        tab_indicator_color: yellow
        notify_indicator_color: yellow
        notify_text_color: black
        menu: show
        notifications: show
        voice: clock
        options: show
        clock_format: 24
        clock_date: true
        date_locale: en-gb

        exceptions:
          - conditions:
              user_agent: Mobile
            config:
              notifications: show
              voice: hide

        conditional_styles:
          - entity: notifications
            condition:
              state: false
            button:
              notifications:
                hide: true

      - type: custom:clock-card

      #===========
      #=== System
      #===========
      - type: entities
        title: System
        show_header_toggle: false
        entities:
          - entity: sensor.installed_version
            name: Hassio Installed Version
            icon: mdi:home-assistant
          - entity: sensor.latest_available_version
            name: Hassio Current Version
            icon: mdi:home-assistant

          - type: divider

          - entity: sensor.tasmota_current_version
            name: Sonoff / Tasmota Current Version
            icon: mdi:alpha-s-box-outline

          - type: divider

          - entity: sensor.last_boot_date_time
            icon: mdi:calendar
          - entity: sensor.rpi_uptime
            icon: mdi:clock-start
          - entity: sensor.ha_uptime
            icon: mdi:home-assistant

          - type: custom:bar-card
            title: Processor Use
            entity: sensor.processor_use
            height: 30px
            animation: 'off'
            indicator: 'off'
            severity:
              - value: 60
                color: green
              - value: 85 
                color: orange
              - value: 100
                color: red

          - type: custom:bar-card
            title: CPU Temp
            entity: sensor.cpu_temp
            animation: 'off'
            indicator: 'off'
            height: 30px
            severity:
              - value: 60
                color: green
              - value: 70 
                color: orange
              - value: 100
                color: red

          - type: custom:bar-card
            title: Memory Use
            entity: sensor.memory_use_percent
            height: 30px
            animation: 'off'
            indicator: 'off'
            severity:
              - value: 60
                color: green
              - value: 85 
                color: orange
              - value: 100
                color: red

          - type: custom:bar-card
            title: Disk Use
            entity: sensor.disk_use_percent
            height: 30px
            animation: 'off'
            indicator: 'off'
            severity:
              - value: 60
                color: green
              - value: 85 
                color: orange
              - value: 100
                color: red

          - type: divider

          - entity: sensor.public_ip_address
            icon: mdi:ip-network

  #======================================
  #=== Have I Been Pwned and Component Counts
  #======================================
  - type: vertical-stack
    cards:

      #======================
      #=== Have I been pwned
      #======================
      - type: entities
        title: Have I been pwned
        show_header_toggle: false
        entities:
          - entity: sensor.breaches_xxx
            name:[email protected]
            icon: mdi:at
          - entity: sensor.breaches_xxx
            name: [email protected]
            icon: mdi:at
          - entity: sensor.breaches_xxx
            name: [email protected]
            icon: mdi:at
          - entity: sensor.breaches_xxx
            name: [email protected]
            icon: mdi:at


      #=============================
      #=== Component Counts
      #=============================
      - type: glance
        title: Component Count
        columns: 4
        entities:
          - entity: sensor.count_automations
            name: Automations
            icon: mdi:autorenew
          - entity: sensor.count_scripts
            name: Scripts
            icon: mdi:script-text-outline
          - entity: sensor.count_zones
            name: Zones
            icon: mdi:map-marker-radius
          - entity: sensor.count_device_trackers
            name: Device Trackers
            icon: mdi:map-marker
          - entity: sensor.count_switches
            name: Switches
            icon: mdi:light-switch
          - entity: sensor.count_sensors
            name: Sensors
            icon: mdi:resistor
          - entity: sensor.count_binary_sensors
            name: Binary Sensors
            icon: mdi:unfold-more-horizontal
          - entity: sensor.count_input_booleans
            name: Input Booleans
            icon: mdi:toggle-switch
          - entity: sensor.count_input_numbers
            name: Input Numbers
            icon: mdi:numeric
          - entity: sensor.count_input_texts
            name: Input Texts
            icon: mdi:alphabetical
          - entity: sensor.count_input_selects
            name: Input Select
            icon: mdi:view-list
          - entity: sensor.count_input_datetimes
            name: Input Date Times
            icon: mdi:calendar-clock
      

      #=============================
      #=== Custom Component Updates
      #=============================
  - type: vertical-stack
    cards:

      - type: custom:tracker-card
        title:
        trackers:
          - sensor.custom_card_tracker
          - sensor.custom_component_tracker

15 Likes

Thank you. Much appreciated.

Nice to know, the GPU is an on-chip graphics processing unit (GPU) according to Wikipedia so temps are always going to be pretty much the same.

I’m using glances and HA dockermon.

- platform: glances
  host: localhost
  name: CoreOS
  version: 3
  resources:
    - 'disk_use'
    - 'disk_use_percent'
    - 'disk_free'
    - 'cpu_temp'
    - 'processor_load'
    - 'memory_use'
    - 'memory_use_percent'
    - 'memory_free'
    - 'docker_active'
    - 'docker_cpu_use'
    - 'docker_memory_use'
3 Likes

Relevant thread I found very helpful.

Edit. Just realized @klogg already posted in this thread!

I found glances to be very useful to monitor which addons were dogging the system on Hassio. It’s also the only way I’ve found to get the CPU temp with Hassio on an RPi. I don’t run it all the time though because I found it tended it be a bit of a resource hog itself.

configuration file: https://github.com/Limych/HomeAssistantConfiguration/blob/master/lovelace/30_system_info_view.yaml

5 Likes

I stand corrected thanks @klogg. This works with no muss, no fuss.

  - platform: command_line
    name: RPi CPU Temperature
    command: "cat /sys/class/thermal/thermal_zone0/temp"
    value_template: "{{ value | multiply(0.001) | round(2) }}"
2 Likes

@cwhits what is the yaml code for locking the service on the right side of your card?

@ghvader
Allow me…
It is the toggle-lock-entity-row - GitHub - thomasloven/lovelace-toggle-lock-entity-row
Look at some of @thomasloven other cards, they are all excellent.

It’s a pleasure, I wish I could say it was my idea… I forget now who I got that from.

1 Like

Can you share the sensors as well :slight_smile:?
Also, where do you save the Rpi and HA uptime?

1 Like

@Yoinkz

#============
#=== Sensors
#============
sensor:

  #===========================================
  #=== Latest Sonoff Tasmota firmware version
  #===========================================
  - platform: command_line
    name: Tasmota Current Version
    command: "curl -s https://github.com/arendst/Sonoff-Tasmota/releases/latest | cut -d'\"' -f2 | rev | cut -d'/' -f1 | rev"
    scan_interval: 86400

  #==============================
  #=== Installed hass.io version
  #==============================
  - platform: version
    name: Installed Version
    source: local


  #================================
  #=== Latest Available HA Version
  #================================
  - platform: version
    name: Latest Available Version
    beta: false
    image: raspberrypi3
    source: hassio


  #=======================
  #=== Raspberry Pi Power
  #=======================
  - platform: rpi_power
    text_state: True


  #=============================================
  #=== Last boot time, Disk, memory & CPU usage
  #=============================================
  - platform: systemmonitor
    resources:
      - type: last_boot
      - type: disk_use_percent
        arg: /
      - type: memory_use_percent
      - type: processor_use

  
  #====================
  #=== CPU Temperature
  #====================
  - platform: command_line
    name: CPU Temp
    command: "cat /sys/class/thermal/thermal_zone0/temp"
    unit_of_measurement: "°C"
    value_template: '{{ value | multiply(0.001) | round(0) }}'


  #===================
  #=== System Up Time
  #===================
  - platform: uptime


  - platform: template
    sensors:

      #==========================
      #=== Home Assistant uptime
      #==========================
      ha_uptime:
        friendly_name: HA Uptime
        value_template: >
          {% if states('sensor.uptime') == '0.0' %} 
            Just restarted...
          {% else %}
            {% macro phrase(value, name) %}
            {%- set value = value | int %}
            {%- set end = 's' if value > 1 else '' %}
            {{- '{} {}{}'.format(value, name, end) if value | int > 0 else '' }}
            {%- endmacro %}
            
            {% set weeks = (states('sensor.uptime') | int / 7) | int %}
            {% set days = (states('sensor.uptime') | int) - (weeks * 7) %}
            {% set hours = (states('sensor.uptime') | float - states('sensor.uptime') | int) * 24 %}
            {% set minutes = (hours - hours | int) * 60 %}

            {{ [ phrase(weeks, 'week'), phrase(days, 'day'), phrase(hours, 'hr'), phrase(minutes, 'min') ] | select('!=','') | list | join(', ') }}
          {% endif %}


      #=========================================
      #=== Raspberry Pi last boot date and time
      #=========================================
      last_boot_date_time:
        friendly_name: Last Boot
        value_template: >
          {% set date = as_timestamp(states('sensor.last_boot')) | timestamp_custom('%d') %}
          {% set date = '{:01}'.format(date | int) %}
          {% if date in ('1', '21', '31') %}
            {% set date = date ~ 'st' %}
          {% elif date in ('2', '22') %}
            {% set date = date ~ 'nd' %}
          {% elif date in ('3', '23') %}
            {% set date = date ~ 'rd' %}
          {% else %}
            {% set date = date ~ 'th' %}
          {% endif %}

          {{ as_timestamp(states('sensor.last_boot')) | timestamp_custom('%H:%M on %a') }} {{ date }} {{ as_timestamp(states('sensor.last_boot')) | timestamp_custom('%b %Y') }}


      #=========================
      #=== Raspberry Pi Up Time
      #=========================
      rpi_uptime:
        friendly_name: RPi Uptime
        entity_id: sensor.time
        value_template: >
          {% set up_time = as_timestamp(now()) - as_timestamp(states('sensor.last_boot')) %}

          {% set minutes = (up_time // 60) | int %}
          {% set hours = (minutes // 60) %}
          {% set days = (hours // 24) %}
          {% set weeks = (days // 7) %}

          {% set minutes = (minutes % 60) %}
          {% set hours =  (hours % 24) %}
          {% set days = (days % 7) %}

          {% macro phrase(value, name) %}
                    {%- set value = value %}
                    {%- set end = 's' if value > 1 else '' %}
                    {{- '{} {}{}'.format(value, name, end) if value | int > 0 else '' }}
          {%- endmacro %}
                    
          {% set text = [ phrase(weeks, 'week'), phrase(days, 'day'), phrase(hours, 'hr'), phrase(minutes, 'min') ] | select('!=','') | list | join(', ') %}
          {% set last_comma = text.rfind(',') %}
          {% if last_comma != -1 %}
            {% set text = text[:last_comma] + ' and' + text[last_comma + 1:] %}
          {% endif %}
          
          {{ text }}
18 Likes

How did you do your component count? Thats a great idea

EDIT: A much better way, courtesy of @petro is further down this thread.
Here --> System Monitoring - How does your look?


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

    #----- Count Automations
      count_automations:
        entity_id: sensor.date
        value_template: >
          {%- set domains = ['automation'] -%}
          {%- for domain in domains -%}
            {%- for item in states[domain] -%}
              {% if loop.first %}
                {{loop.length}}
              {% endif %}
            {%- endfor -%}
          {%- endfor -%}

    #----- Count Scripts
      count_scripts:
        entity_id: sensor.date
        value_template: >
          {%- set domains = ['script'] -%}
          {%- for domain in domains -%}
            {%- for item in states[domain] -%}
              {% if loop.first %}
                {{loop.length}}
              {% endif %}
            {%- endfor -%}
          {%- endfor -%}

    #----- Count Device Trackers
      count_device_trackers:
        entity_id: sensor.date
        value_template: >
          {%- set domains = ['device_tracker'] -%}
          {%- for domain in domains -%}
            {%- for item in states[domain] -%}
              {% if loop.first %}
                {{loop.length}}
              {% endif %}
            {%- endfor -%}
          {%- endfor -%}        

    #----- Count Binary Sensors
      count_binary_sensors:
        entity_id: sensor.date
        value_template: >
          {%- set domains = ['binary_sensor'] -%}
          {%- for domain in domains -%}
            {%- for item in states[domain] -%}
              {% if loop.first %}
                {{loop.length}}
              {% endif %}
            {%- endfor -%}
          {%- endfor -%}

    #----- Count Sensors
      count_sensors:
        entity_id: sensor.date
        value_template: >
          {%- set domains = ['sensor'] -%}
          {%- for domain in domains -%}
            {%- for item in states[domain] -%}
              {% if loop.first %}
                {{loop.length}}
              {% endif %}
            {%- endfor -%}
          {%- endfor -%}

    #----- Count Switches
      count_switches:
        entity_id: sensor.date
        value_template: >
          {%- set domains = ['switch'] -%}
          {%- for domain in domains -%}
            {%- for item in states[domain] -%}
              {% if loop.first %}
                {{loop.length}}
              {% endif %}
            {%- endfor -%}
          {%- endfor -%}

    #----- Count Zones
      count_zones:
        entity_id: sensor.date
        value_template: >
          {%- set domains = ['zone'] -%}
          {%- for domain in domains -%}
            {%- for item in states[domain] -%}
              {% if loop.first %}
                {{loop.length}}
              {% endif %}
            {%- endfor -%}
          {%- endfor -%}

    #----- Input Booleans
      count_input_booleans:
        entity_id: sensor.date
        value_template: >
          {%- set domains = ['input_boolean'] -%}
          {%- for domain in domains -%}
            {%- for item in states[domain] -%}
              {% if loop.first %}
                {{loop.length}}
              {% endif %}
            {%- endfor -%}
          {%- endfor -%}

    #----- Input Numbers
      count_input_numbers:
        entity_id: sensor.date
        value_template: >
          {%- set domains = ['input_number'] -%}
          {%- for domain in domains -%}
            {%- for item in states[domain] -%}
              {% if loop.first %}
                {{loop.length}}
              {% endif %}
            {%- endfor -%}
          {%- endfor -%}

    #----- Input Texts
      count_input_texts:
        entity_id: sensor.date
        value_template: >
          {%- set domains = ['input_text'] -%}
          {%- for domain in domains -%}
            {%- for item in states[domain] -%}
              {% if loop.first %}
                {{loop.length}}
              {% endif %}
            {%- endfor -%}
          {%- endfor -%}

    #----- Input Selects
      count_input_selects:
        entity_id: sensor.date
        value_template: >
          {%- set domains = ['input_select'] -%}
          {%- for domain in domains -%}
            {%- for item in states[domain] -%}
              {% if loop.first %}
                {{loop.length}}
              {% endif %}
            {%- endfor -%}
          {%- endfor -%}

    #----- Input Date Times
      count_input_datetimes:
        entity_id: sensor.date
        value_template: >
          {%- set domains = ['input_datetime'] -%}
          {%- for domain in domains -%}
            {%- for item in states[domain] -%}
              {% if loop.first %}
                {{loop.length}}
              {% endif %}
            {%- endfor -%}
          {%- endfor -%}
17 Likes

Your memory usage if quite low compared to mine, are you using the free command to get memory usage or some other way?