Nuc System Monitoring Card

Hi guys, can anyone help me to adjust this card? I can not put the cpu temperature sensor, UPTIME and HA Version.

When I delete the variables the card works, when I put the variables the card does not work.



id: nuc_status
type: custom:config-template-card
variables: null
entities:
  - sensor.disk_use_percent
  - sensor.homeassistant_version
  - sensor.disk_total
  - sensor.disk_use
  - sensor.memory_use_percent
  - sensor.processor_use
  - sensor.processor_temperature
card:
  type: entities
  show_header_toggle: 'off'
  style: |
    .card-header {
      padding: 0px 0px 0px 0px !important;
    }
  entities:
    - type: section
      label: ${ 'Debian 11 --- HA Version ' + vars[1] }
    - type: custom:hui-element
      card_type: vertical-stack
      cards:
        - type: horizontal-stack
          cards:
            - type: picture
              style: |
                ha-card { 
                    --paper-card-background-color: 'rgba(0, 0, 0, 0.0)';
                    --ha-card-background: "rgba(0, 0, 0, 0.0)";
                    --ha-card-box-shadow: 'none';
                }
              image: /local/images/intel-nuc.png
            - type: custom:button-card
              layout: icon_name_state2nd
              show_icon: true
              show_state: true
              styles:
                grid:
                  - grid-template-columns: 50px auto
                icon:
                  - padding: 0px 0px
                  - height: 30px
                  - width: 30px
                card:
                  - '--ha-card-background': rgba(0, 0, 0, 0.0)
                  - '--ha-card-box-shadow': none
                state:
                  - padding: 0px 10px
                  - justify-self: start
                  - font-family: Roboto, sans-serif
                  - font-size: 15px
                name:
                  - padding: 0px 10px
                  - justify-self: start
                  - color: var(--secondary-text-color)
              entity: sensor.homeassistant_uptime
              name: Uptime
              icon: mdi:clock-outline
        - type: custom:bar-card
          show_icon: true
          align: split
          columns: 1
          max: 100
          positions:
            icon: inside
            indicator: inside
            name: inside
            value: inside
          unit_of_measurement: '%'
          severity:
            - from: 0
              to: 50
              color: '#018304'
            - from: 50
              to: 75
              color: '#f39c12'
            - from: 75
              to: 100
              color: '#e45e65'
          style: |
            ha-card { 
                --paper-card-background-color: 'rgba(0, 0, 0, 0.0)';
                --ha-card-background: "rgba(0, 0, 0, 0.0)";
                --paper-item-icon-color: 'var(--text-primary-color';
                --ha-card-box-shadow: 'none';
            }
          entities:
            - entity: sensor.disk_use_percent
          name: ${ 'Disk (' + vars[3] + 'Gb/' + vars[2] + 'Gb)' }
          entity_row: true
        - type: horizontal-stack
          cards:
            - type: custom:bar-card
              show_icon: true
              align: split
              columns: 1
              max: 100
              positions:
                icon: inside
                indicator: inside
                name: inside
                value: inside
              unit_of_measurement: '%'
              severity:
                - from: 0
                  to: 50
                  color: '#018304'
                - from: 50
                  to: 75
                  color: '#f39c12'
                - from: 75
                  to: 100
                  color: '#e45e65'
              style: |
                ha-card { 
                  --paper-card-background-color: 'rgba(0, 0, 0, 0.0)';
                  --ha-card-background: "rgba(0, 0, 0, 0.0)";
                  --paper-item-icon-color: 'var(--text-primary-color';
                  --ha-card-box-shadow: 'none';
                }
              entity: sensor.memory_use_percent
              name: RAM
              entity_row: true
            - type: custom:bar-card
              show_icon: true
              align: split
              columns: 1
              max: 100
              positions:
                icon: inside
                indicator: inside
                name: inside
                value: inside
              unit_of_measurement: '%'
              severity:
                - from: 0
                  to: 50
                  color: '#018304'
                - from: 50
                  to: 75
                  color: '#f39c12'
                - from: 75
                  to: 100
                  color: '#e45e65'
              style: |
                ha-card { 
                  --paper-card-background-color: 'rgba(0, 0, 0, 0.0)';
                  --ha-card-background: "rgba(0, 0, 0, 0.0)";
                  --paper-item-icon-color: 'var(--text-primary-color';
                  --ha-card-box-shadow: 'none';
                }
              entity: sensor.processor_use
              name: CPU
              entity_row: true
        - type: custom:mini-graph-card
          height: 30
          line_width: 2
          font_size: 70
          hours_to_show: 168
          points_per_hour: 1
          show:
            extrema: true
            fill: true
          style: |
            ha-card { 
              --ha-card-background: "rgba(0, 0, 0, 0.0)";
              --ha-card-box-shadow: 'none';
              border-radius: 5px;
            }
            .info.flex {
              font-size: 12px !important;
            }
          entities:
            - sensor.processor_temperature
          name: Temperature
          color_thresholds:
            - value: 30
              color: '#3498db'
            - value: 50
              color: '#f39c12'
            - value: 80
              color: '#ff0000'

Hi guys,

Is it no longer possible to have uptime information in HA?? Are these the only resources available right now?

https://www.home-assistant.io/integrations/systemmonitor

# Example configuration.yaml entry with all entry types (delete/comment out as necessary)
sensor:
  - platform: systemmonitor
    resources:
      - type: disk_use_percent
        arg: /config
      - type: disk_use
      - type: disk_free
      - type: memory_use_percent
      - type: memory_use
      - type: memory_free
      - type: swap_use_percent
      - type: swap_use
      - type: swap_free
      - type: load_1m
      - type: load_5m
      - type: load_15m
      - type: network_in
        arg: eth0
      - type: network_out
        arg: eth0
      - type: throughput_network_in
        arg: eth0
      - type: throughput_network_out
        arg: eth0
      - type: packets_in
        arg: eth0
      - type: packets_out
        arg: eth0
      - type: ipv4_address
        arg: eth0
      - type: ipv6_address
        arg: eth0
      - type: processor_use
      - type: processor_temperature
      - type: last_boot

last_boot will give you the uptime of your system. The uptimes in this guide were manually created by me for the most part. They have since been made obsolete with the new timestamp device class as well as duration sensors.

1 Like

would you help me to get the information “Last Boot” and “HA Version undefined” right. Last boot information is coming out of the template.

is it possible to do decimal point rounding within the card?

The Synology integration now reports disk usage to 12 decimal points, wondering if I can round it down to 2 decimal points without creating another entity using a sensor or not

IF you are using the Synology integration go to:

Settings → integration-> Synology → Volume 1

Choose the entity you want to amend and go into the “cog” …it will allow you to amend the “Display precision” of the entity.

I’ve done that already, but it still shows 12 decimal points - I think the card is showing the sensor value rather than honouring the display precision

image

vs

image

not sure if it’s an undocumented feature in the integration or not…

I have same sensor and can confirm that through normal entity card it follows the Display Precision that you set.

I am about to set up a NUC and need an updated system monitor card. I am not sure I will use this one as it appears to be quite old. But I will take a look. Perhaps somebody else might comment.

Edit: I would read the very first post statement

Agree that it works with a regular HomeAssistant built-in card.

Not sure about your reference to first post statement

Hello there

can you please share your code i have the Intel NUC 13 Pro Kit RNUC13ANHI50002 Arena Canyon.
and use latest home assistant.
can you please tell me how you did it with that picture. i am kinda new to al this i tried changing a lot yaml and so on but could not figure it out.

Hi,

I’m trying to get a reading of my CPU temperature from NUC10 running proxmox and HA OS.

This code is not returning anything:

- platform: command_line
  name: CPU Temperature
  command: "cat /sys/class/thermal/cooling_device0/processor"
  scan_interval: 15
  unit_of_measurement: "°C"
  #unit_of_measurement: "°F"
  value_template: '{{ value | multiply(0.001) | round(1) }}'
  #value_template: " {{ (( value | multiply(0.0018)) + 32 ) | round (1) }}"

Anyone has a clue?

What does

cat /sys/class/thermal/cooling_device0/processor

return from the root using of your proxmox server and if you are able to do it from within your Home Assistant VM?

I made a typo somewhere

cat /sys/class/thermal/cooling_device0/type

returns processor

Different motherboards and manufactures have different directory structures for there hardware information access. For example for some Intel motherboards I use the following structures shown in code below. Good hunting!

    # get cpu temperature
    try :
        with open('/sys/class/hwmon/hwmon1/temp1_input', 'r') as f:
            cpu_temperature = str(int(f.read().strip()) / 1000)
    except :
            cpu_temperature = "-1.0"

    # get cpu critical temperature
    try :
        with open('/sys/class/hwmon/hwmon1/temp1_crit', 'r') as f:
            cpu_temperature_critical = str(int(f.read().strip()) / 1000)
    except :
            cpu_temperature_critical = "-1.0"

    # get cpu operating frequency info
    core_frequency = []
    try :
        with open('/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq', 'r') as f:
            core_frequency.append(str(f.read()).strip())
    except :
        core_frequency = ["-1"]

    # get memory info
    try :
        with open('/proc/meminfo', 'r') as f:
            mem_info = f.read().splitlines()
            total_memory = re.search(r'MemTotal:(.*?)kB', mem_info[0]).group(1).replace(' ', '')
            available_memory = re.search(r'MemFree:(.*?)kB', mem_info[1]).group(1).replace(' ', '')
    except :
        total_memory = "-1"
        available_memory = "-1"


Hi there,

I would like to share with you my card. It’s a simple one. Feel free to modify it.

card:

type: vertical-stack
cards:
  - type: custom:bubble-card
    card_type: separator
    icon: mdi:home-assistant
    name: HASSIO
  - type: custom:vertical-stack-in-card
    cards:
      - type: picture
        card_mod:
          style: |-
            ha-card img {
            display: block !important;
            width: 50% !important;
            margin: auto !important;
            margin-top: -60px !important;
            margin-bottom: -70px !important;
            }
        image: /local/lenovo.svg
        tap_action:
          action: none
        double_tap_action:
          action: none
        hold_action:
          action: none
      - type: custom:button-card
        template:
          - lenovo
        custom_fields:
          uptime: |
            [[[
              return `Ultima pornire, ${states['sensor.last_boot'].state}`;
            ]]]
      - type: custom:bar-card
        show_icon: true
        align: split
        columns: 1
        max: 100
        positions:
          icon: inside
          indicator: inside
          name: inside
          value: inside
        unit_of_measurement: '%'
        severity:
          - from: 0
            to: 50
            color: '#000'
          - from: 50
            to: 75
            color: '#000'
          - from: 75
            to: 100
            color: '#000'
        style: ''
        card_mod:
          style: |-
            ha-card {
            border-radius: 0px !important;
            border: 0px !important;
            pointer-events: none;
            }
        entities:
          - entity: sensor.system_monitor_disk_use_percent
        name: HDD
        entity_row: true
      - type: horizontal-stack
        cards:
          - type: custom:bar-card
            show_icon: true
            align: split
            columns: 1
            max: 100
            positions:
              icon: inside
              indicator: inside
              name: inside
              value: inside
            unit_of_measurement: '%'
            severity:
              - from: 0
                to: 50
                color: '#018304'
              - from: 50
                to: 75
                color: '#f39c12'
              - from: 75
                to: 100
                color: '#e45e65'
            style: ''
            card_mod:
              style: |-
                ha-card {
                border-radius: 0px !important;
                border: 0px !important;
                pointer-events: none;
                }
            name: RAM
            entity_row: true
            entities:
              - entity: sensor.system_monitor_memory_use
          - type: custom:bar-card
            show_icon: true
            align: split
            columns: 1
            max: 100
            positions:
              icon: inside
              indicator: inside
              name: inside
              value: inside
            unit_of_measurement: '%'
            severity:
              - from: 0
                to: 50
                color: '#018304'
              - from: 50
                to: 75
                color: '#f39c12'
              - from: 75
                to: 100
                color: '#e45e65'
            style: ''
            card_mod:
              style: |-
                ha-card {
                border-radius: 0px !important;
                border: 0px !important;
                pointer-events: none;
                }
            entity: sensor.system_monitor_processor_use
            name: CPU
            entity_row: true
      - type: custom:mini-graph-card
        font_size: 75
        font_size_header: 12
        card_mod:
          style: |
            ha-card .graph__legend__item {
            margin-top: 10px
            }
        show:
          points: false
          extrema: true
          icon: false
        tap_action:
          action: none
        align_icon: left
        align_header: left
        animate: true
        entities:
          - entity: sensor.system_monitor_processor_temperature
            name: Temperatura procesorului
          - color: gray
            entity: sensor.nightstate
            name: Night
            show_legend: false
            show_line: false
            show_points: false
            y_axis: secondary

and the template:

  lenovo:
    show_state: false
    show_icon: false
    show_name: false
    tap_action:
      action: none
    hold_action:
      action: none
    styles:
      card:
        - padding: 5%
        - color: gray
        - font-size: 10px
        - text-shadow: 0px 0px 0px black
        - justify-self: end
        - align-self: middle
      grid:
        - grid-template-areas: |
            "uptime uptime"
        - grid-template-rows: 1fr min-content min-content min-content min-content
        - align-items: start
      custom_fields:
        uptime:
          - justify-self: center
          - color: gray
          - font-size: 14px
          - font-family: CairoPlay
          - margin: '-6% 0 0 0'

Using: