System Monitoring - How does yours look?

Sure.
Will do when I reach a computer :slight_smile:

Hi 2019-10-10%2017_52_06-System%20Monitoring%20-%20How%20does%20your%20look_%20-%20Share%20your%20Projects!%20_%20Lovelace%20%26%20Fron Cerb
Docker container config example please!

1 Like

please use this. https://www.home-assistant.io/integrations/openhardwaremonitor/

1 Like
  # Docker containers
  - type: vertical-stack
    cards:
      - type: custom:vertical-stack-in-card
        cards:
          - type: horizontal-stack
            cards:
              - type: custom:button-card
                show_name: false
                show_icon: false
                color: var(--paper-item-icon-color)
                color_type: card
                styles:
                  card:
                    - height: 70px
                    - border-radius: 0px
              - type: custom:button-card
                name: docker
                show_name: false
                icon: mdi:docker
                color: var(--paper-item-icon-color)
                color_type: card
                size: 100%
                styles:
                  card:
                    - height: 70px
                    - border-radius: 0px
                  icon:
                    - margin-left: 10px
              - type: custom:button-card
                layout: name_state
                name: 'Active'
                entity: sensor.docker_active_containers
                show_name: true
                show_icon: false
                show_state: true
                color: var(--paper-item-icon-color)
                color_type: card
                styles:
                  card:
                    - height: 70px
                    - border-radius: 0px
                  name:
                    - margin-top: 40px
                    - margin-left: 3px
                  state:
                    - margin-top: 40px

      - type: horizontal-stack
        cards:
          - type: custom:button-card
            entity: switch.traefik
            name: Traefik
            icon: mdi:arrow-decision-outline
            lock: true
            confirmation: "Toggle Traefik container?"
            styles:
              card:
                - border-radius: 10px
                - margin-left: 2.5px
            color: var(--paper-item-icon-color)
            color_type: card
            state:
              - value: "on"
                styles:
                  icon:
                    - color: var(--paper-item-icon-active-color)
              - value: "off"
                color: var(--paper-item-icon-color)
                color_type: card
          - type: custom:button-card
            entity: switch.nextcloud
            name: Nextcloud
            icon: mdi:dropbox
            lock: true
            confirmation: "Toggle Nextcloud container?"
            styles:
              card:
                - border-radius: 10px
            color: var(--paper-item-icon-color)
            color_type: card
            state:
              - value: "on"
                styles:
                  icon:
                    - color: var(--paper-item-icon-active-color)
              - value: "off"
                color: var(--paper-item-icon-color)
                color_type: card
          - type: custom:button-card
            entity: switch.plex
            name: Plex
            icon: mdi:plex
            lock: true
            confirmation: "Toggle Plex container?"
            styles:
              card:
                - border-radius: 10px
                - margin-left: -2.5px
            color: var(--paper-item-icon-color)
            color_type: card
            state:
              - value: "on"
                styles:
                  icon:
                    - color: var(--paper-item-icon-active-color)
              - value: "off"
                color: var(--paper-item-icon-color)
                color_type: card

      - type: horizontal-stack
        cards:
          - type: custom:button-card
            entity: switch.unifi
            name: UniFi
            icon: mdi:wifi
            lock: true
            confirmation: "Toggle UniFi container?"
            styles:
              card:
                - border-radius: 10px
                - margin-left: 2.5px
            color: var(--paper-item-icon-color)
            color_type: card
            state:
              - value: "on"
                styles:
                  icon:
                    - color: var(--paper-item-icon-active-color)
              - value: "off"
                color: var(--paper-item-icon-color)
                color_type: card
          - type: custom:button-card
            entity: switch.apache
            name: Apache
            icon: mdi:web
            lock: true
            confirmation: "Toggle Apache container?"
            styles:
              card:
                - border-radius: 10px
            color: var(--paper-item-icon-color)
            color_type: card
            state:
              - value: "on"
                styles:
                  icon:
                    - color: var(--paper-item-icon-active-color)
              - value: "off"
                color: var(--paper-item-icon-color)
                color_type: card
          - type: custom:button-card
            entity: switch.mosquitto
            name: Mosquitto
            icon: mdi:transit-connection-variant
            lock: true
            confirmation: "Toggle Mosquitto container?"
            styles:
              card:
                - border-radius: 10px
                - margin-left: -2.5px
            color: var(--paper-item-icon-color)
            color_type: card
            state:
              - value: "on"
                styles:
                  icon:
                    - color: var(--paper-item-icon-active-color)
              - value: "off"
                color: var(--paper-item-icon-color)
                color_type: card

      - type: horizontal-stack
        cards:
          - type: custom:button-card
            entity: switch.owntracks
            name: Owntracks
            icon: mdi:crosshairs-gps
            lock: true
            confirmation: "Toggle Owntracks container?"
            styles:
              card:
                - border-radius: 10px
                - margin-left: 2.5px
            color: var(--paper-item-icon-color)
            color_type: card
            state:
              - value: "on"
                styles:
                  icon:
                    - color: var(--paper-item-icon-active-color)
              - value: "off"
                color: var(--paper-item-icon-color)
                color_type: card
          - type: custom:button-card
            entity: switch.hass_db
            name: Hass DB
            icon: mdi:database
            lock: true
            confirmation: "Toggle Home Assistant DB container?"
            styles:
              card:
                - border-radius: 10px
            color: var(--paper-item-icon-color)
            color_type: card
            state:
              - value: "on"
                styles:
                  icon:
                    - color: var(--paper-item-icon-active-color)
              - value: "off"
                color: var(--paper-item-icon-color)
                color_type: card
          - type: custom:button-card
            entity: switch.websites_db
            name: Websites DB
            icon: mdi:database
            lock: true
            confirmation: "Toggle websites DB container?"
            styles:
              card:
                - border-radius: 10px
                - margin-left: -2.5px
            color: var(--paper-item-icon-color)
            color_type: card
            state:
              - value: "on"
                styles:
                  icon:
                    - color: var(--paper-item-icon-active-color)
              - value: "off"
                color: var(--paper-item-icon-color)
                color_type: card
2 Likes

Some small changes have been made since I posted the screenshot.

# System monitoring
title: System
path: system
icon: mdi:server-network
cards:
  # Primary server
  - type: custom:vertical-stack-in-card
    cards:
      - type: custom:button-card
        color_type: label-card
        color: var(--paper-item-icon-color)
        name: Primary server
        styles:
          card:
            - border-radius: 0px
            - height: 10px
      - type: entities
        show_header_toggle: false
        entities:
          - entity: sensor.server_uptime
          - entity: sensor.cpu
            type: custom:multiple-entity-row
            hide_state: true
            name: Intel Core i7-8559U
            primary:
              entity: sensor.cpu_freq
              name: Frequency
            secondary:
              entity: sensor.cpu_temperature
              name: Temperature
            info:
              entity: sensor.cpu
              name: 'usage:'
          - entity: sensor.memory_percent
            type: custom:multiple-entity-row
            hide_state: true
            name: RAM
            primary:
              entity: sensor.memory_used
              name: Used
            secondary:
              entity: sensor.memory_total
              name: Total
            info:
              entity: sensor.memory_percent
              name: 'usage:'
          - entity: sensor.os_disk_percent
            type: custom:multiple-entity-row
            hide_state: true
            name: Disk
            primary:
              entity: sensor.os_disk_used
              name: Used
            secondary:
              entity: sensor.os_disk_total
              name: Total
            info:
              entity: sensor.os_disk_percent
              name: 'usage:'
          - type: divider
      - type: custom:mini-graph-card
        entities:
          - entity: sensor.cpu_temperature
        name: Temperature
        decimals: 0
        color_thresholds_transition: hard
        color_thresholds:
          - value: 0
            color: "#198c0f"
          - value: 50
            color: "#e0a211"
          - value: 70
            color: "#b52e13"
        hours_to_show: 72
        points_per_hour: 0.25
        icon: mdi:chip
        hour24: true
        show:
          extrema: true
  # Home Assistant
  - type: vertical-stack
    cards:
      - type: custom:vertical-stack-in-card
        cards:
          - type: custom:button-card
            color_type: label-card
            color: var(--paper-item-icon-color)
            name: Home Assistant
            styles:
              card:
                - border-radius: 0px
                - height: 10px
          - type: entities
            show_header_toggle: false
            entities:
              - entity: sensor.current_version
              - entity: sensor.uptime
              - entity: sensor.ha_startup_duration
              - entity: sensor.db_size
              - entity: sensor.hacs
                name: HA Community Store
      # Update
      - type: conditional
        conditions:
          - entity: binary_sensor.update_available
            state: "on"
        card:
          type: custom:button-card
          entity: sensor.latest_version
          show_state: true
          show_icon: true
          name: 'Latest version'
          icon: mdi:home-assistant
          layout: name_state
          size: 10%
          lock: true
          color: var(--paper-item-icon-color)
          color_type: card
          tap_action:
            action: call-service
            service: shell_command.upgrade_homeassistant
          confirmation: "Home Assistant will be upgraded in the next few minutes."
          styles:
            card:
              - border-radius: 10px
              - margin-left: 2.5px
              - margin-right: 2.5px
              - width: 98.7%
      # Count components
      - type: horizontal-stack
        cards:
          - type: custom:button-card
            entity: sensor.count_sensors
            name: Sensors
            icon: mdi:resistor
            styles:
              card:
                - border-radius: 10px
                - margin-left: 2.5px
            color: var(--paper-item-icon-color)
            color_type: card
            show_state: true
          - type: custom:button-card
            entity: sensor.count_switches
            name: Switches
            icon: mdi:toggle-switch-outline
            styles:
              card:
                - border-radius: 10px
            color: var(--paper-item-icon-color)
            color_type: card
            show_state: true
          - type: custom:button-card
            entity: sensor.count_lights
            name: Lights
            icon: mdi:lightbulb-outline
            styles:
              card:
                - border-radius: 10px
                - margin-left: -2.5px
            color: var(--paper-item-icon-color)
            color_type: card
            show_state: true

      - type: horizontal-stack
        cards:
          - type: custom:button-card
            entity: sensor.count_automations
            name: Automations
            icon: mdi:autorenew
            styles:
              card:
                - border-radius: 10px
                - margin-left: 2.5px
            color: var(--paper-item-icon-color)
            color_type: card
            show_state: true
          - type: custom:button-card
            entity: sensor.count_cameras
            name: Cameras
            icon: mdi:webcam
            styles:
              card:
                - border-radius: 10px
            color: var(--paper-item-icon-color)
            color_type: card
            show_state: true
          - type: custom:button-card
            entity: sensor.count_media_players
            name: Media players
            icon: mdi:play-circle-outline
            styles:
              card:
                - border-radius: 10px
                - margin-left: -2.5px
            color: var(--paper-item-icon-color)
            color_type: card
            show_state: true
  # Nextcloud
  - type: custom:vertical-stack-in-card
    cards:
      - type: custom:button-card
        color_type: label-card
        color: var(--paper-item-icon-color)
        name: Nextcloud
        styles:
          card:
            - border-radius: 0px
            - height: 10px
      - type: entities
        show_header_toggle: false
        entities:
          - entity: sensor.nextcloud_sync_alexandra
          - entity: sensor.nextcloud_sync_robert
          - type: custom:bar-card
            entity: sensor.storage_disk_usage
            animation: 'off'
            indicator: 'off'
            title_position: inside
            icon: mdi:harddisk
            show_icon: true
            align: split
            padding: 0px
          - type: divider
          - entity: sensor.nextcloud_backup_alexandra
          - entity: sensor.nextcloud_backup_robert
          - type: custom:bar-card
            entity: sensor.backup_disk_usage
            animation: 'off'
            indicator: 'off'
            title_position: inside
            icon: mdi:harddisk
            show_icon: true
            align: split
            padding: 0px
  # Docker containers
  - type: vertical-stack
    cards:
      - type: custom:vertical-stack-in-card
        cards:
          - type: horizontal-stack
            cards:
              - type: custom:button-card
                show_name: false
                show_icon: false
                color: var(--paper-item-icon-color)
                color_type: card
                styles:
                  card:
                    - height: 70px
                    - border-radius: 0px
              - type: custom:button-card
                name: docker
                show_name: false
                icon: mdi:docker
                color: var(--paper-item-icon-color)
                color_type: card
                size: 100%
                styles:
                  card:
                    - height: 70px
                    - border-radius: 0px
                  icon:
                    - margin-left: 10px
              - type: custom:button-card
                layout: name_state
                name: 'Active'
                entity: sensor.docker_active_containers
                show_name: true
                show_icon: false
                show_state: true
                color: var(--paper-item-icon-color)
                color_type: card
                styles:
                  card:
                    - height: 70px
                    - border-radius: 0px
                  name:
                    - margin-top: 40px
                    - margin-left: 3px
                  state:
                    - margin-top: 40px

      - type: horizontal-stack
        cards:
          - type: custom:button-card
            entity: switch.traefik
            name: Traefik
            icon: mdi:arrow-decision-outline
            lock: true
            confirmation: "Toggle Traefik container?"
            styles:
              card:
                - border-radius: 10px
                - margin-left: 2.5px
            color: var(--paper-item-icon-color)
            color_type: card
            state:
              - value: "on"
                styles:
                  icon:
                    - color: var(--paper-item-icon-active-color)
              - value: "off"
                color: var(--paper-item-icon-color)
                color_type: card
          - type: custom:button-card
            entity: switch.nextcloud
            name: Nextcloud
            icon: mdi:dropbox
            lock: true
            confirmation: "Toggle Nextcloud container?"
            styles:
              card:
                - border-radius: 10px
            color: var(--paper-item-icon-color)
            color_type: card
            state:
              - value: "on"
                styles:
                  icon:
                    - color: var(--paper-item-icon-active-color)
              - value: "off"
                color: var(--paper-item-icon-color)
                color_type: card
          - type: custom:button-card
            entity: switch.plex
            name: Plex
            icon: mdi:plex
            lock: true
            confirmation: "Toggle Plex container?"
            styles:
              card:
                - border-radius: 10px
                - margin-left: -2.5px
            color: var(--paper-item-icon-color)
            color_type: card
            state:
              - value: "on"
                styles:
                  icon:
                    - color: var(--paper-item-icon-active-color)
              - value: "off"
                color: var(--paper-item-icon-color)
                color_type: card

      - type: horizontal-stack
        cards:
          - type: custom:button-card
            entity: switch.unifi
            name: UniFi
            icon: mdi:wifi
            lock: true
            confirmation: "Toggle UniFi container?"
            styles:
              card:
                - border-radius: 10px
                - margin-left: 2.5px
            color: var(--paper-item-icon-color)
            color_type: card
            state:
              - value: "on"
                styles:
                  icon:
                    - color: var(--paper-item-icon-active-color)
              - value: "off"
                color: var(--paper-item-icon-color)
                color_type: card
          - type: custom:button-card
            entity: switch.apache
            name: Apache
            icon: mdi:web
            lock: true
            confirmation: "Toggle Apache container?"
            styles:
              card:
                - border-radius: 10px
            color: var(--paper-item-icon-color)
            color_type: card
            state:
              - value: "on"
                styles:
                  icon:
                    - color: var(--paper-item-icon-active-color)
              - value: "off"
                color: var(--paper-item-icon-color)
                color_type: card
          - type: custom:button-card
            entity: switch.mosquitto
            name: Mosquitto
            icon: mdi:transit-connection-variant
            lock: true
            confirmation: "Toggle Mosquitto container?"
            styles:
              card:
                - border-radius: 10px
                - margin-left: -2.5px
            color: var(--paper-item-icon-color)
            color_type: card
            state:
              - value: "on"
                styles:
                  icon:
                    - color: var(--paper-item-icon-active-color)
              - value: "off"
                color: var(--paper-item-icon-color)
                color_type: card

      - type: horizontal-stack
        cards:
          - type: custom:button-card
            entity: switch.owntracks
            name: Owntracks
            icon: mdi:crosshairs-gps
            lock: true
            confirmation: "Toggle Owntracks container?"
            styles:
              card:
                - border-radius: 10px
                - margin-left: 2.5px
            color: var(--paper-item-icon-color)
            color_type: card
            state:
              - value: "on"
                styles:
                  icon:
                    - color: var(--paper-item-icon-active-color)
              - value: "off"
                color: var(--paper-item-icon-color)
                color_type: card
          - type: custom:button-card
            entity: switch.hass_db
            name: Hass DB
            icon: mdi:database
            lock: true
            confirmation: "Toggle Home Assistant DB container?"
            styles:
              card:
                - border-radius: 10px
            color: var(--paper-item-icon-color)
            color_type: card
            state:
              - value: "on"
                styles:
                  icon:
                    - color: var(--paper-item-icon-active-color)
              - value: "off"
                color: var(--paper-item-icon-color)
                color_type: card
          - type: custom:button-card
            entity: switch.websites_db
            name: Websites DB
            icon: mdi:database
            lock: true
            confirmation: "Toggle websites DB container?"
            styles:
              card:
                - border-radius: 10px
                - margin-left: -2.5px
            color: var(--paper-item-icon-color)
            color_type: card
            state:
              - value: "on"
                styles:
                  icon:
                    - color: var(--paper-item-icon-active-color)
              - value: "off"
                color: var(--paper-item-icon-color)
                color_type: card
  #Secondary server
  - type: custom:vertical-stack-in-card
    cards:
      - type: custom:button-card
        color_type: label-card
        color: var(--paper-item-icon-color)
        name: Secondary server
        styles:
          card:
            - border-radius: 0px
            - height: 10px
      - type: entities
        show_header_toggle: false
        entities:
          - entity: sensor.mac_mini_uptime
          - entity: sensor.mac_mini_cpu_usage
            type: custom:multiple-entity-row
            hide_state: true
            name: Intel Core i5-4278U
            primary:
              entity: sensor.mac_mini_cpu_freq
              name: Frequency
            secondary:
              entity: sensor.mac_mini_cpu_temperature
              name: Temperature
            info:
              entity: sensor.mac_mini_cpu_usage
              name: 'usage:'
          - entity: sensor.mac_mini_memory_percent
            type: custom:multiple-entity-row
            hide_state: true
            name: RAM
            primary:
              entity: sensor.mac_mini_memory_used
              name: Used
            secondary:
              entity: sensor.mac_mini_memory_total
              name: Total
            info:
              entity: sensor.mac_mini_memory_percent
              name: 'usage:'
          - entity: sensor.mac_mini_os_disk_percent
            type: custom:multiple-entity-row
            hide_state: true
            name: Disk
            primary:
              entity: sensor.mac_mini_os_disk_used
              name: Used
            secondary:
              entity: sensor.mac_mini_os_disk_total
              name: Total
            info:
              entity: sensor.mac_mini_os_disk_percent
              name: 'usage:'
          - entity: sensor.mac_mini_docker_containers_online
            type: custom:multiple-entity-row
            hide_state: true
            name: Docker containers
            primary:
              entity: sensor.mac_mini_docker_containers_online
              name: Online
            secondary:
              entity: sensor.mac_mini_docker_containers_offline
              name: Offline
      - type: divider
      - type: custom:mini-graph-card
        entities:
          - entity: sensor.mac_mini_cpu_temperature
        name: Temperature
        decimals: 0
        color_thresholds_transition: hard
        color_thresholds:
          - value: 0
            color: "#198c0f"
          - value: 50
            color: "#e0a211"
          - value: 70
            color: "#b52e13"
        hours_to_show: 72
        points_per_hour: 0.25
        icon: mdi:chip
        hour24: true
        show:
          extrema: true
  # VPN
  - type: custom:vertical-stack-in-card
    cards:
      - type: custom:button-card
        color_type: label-card
        color: var(--paper-item-icon-color)
        name: VPN clients
        styles:
          card:
            - border-radius: 0px
            - height: 10px
      - type: custom:card-templater
        card:
          content_template: >-
            {{ "| User | IP address | Connected |\n" }} {{ "|-|-|-|\n" }} {%- for client in
            states.sensor.mac_mini_vpn_clients.attributes.clients -%} {{ " | " +
            states.sensor.mac_mini_vpn_clients.attributes.clients[client]['connected_as'] + " | " +
            states.sensor.mac_mini_vpn_clients.attributes.clients[client]['ip'] + " | " +
            states.sensor.mac_mini_vpn_clients.attributes.clients[client]['connected_since'] + " |\n" }} {%- endfor -%}
          type: markdown
          style: |
            ha-card {
              text-align: left;
            }
            th, td {
              padding-left: 10px;
              padding-right: 10px;
            }
            table {
              margin-left: auto;
              margin-right: auto;
            }
        entities:
          - sensor.mac_mini_vpn_clients


  # Network
  - type: custom:vertical-stack-in-card
    cards:
      - type: custom:button-card
        color_type: label-card
        color: var(--paper-item-icon-color)
        name: Network
        styles:
          card:
            - border-radius: 0px
            - height: 10px
      - type: glance
        entities:
          - entity: sensor.speedtest_ping
          - entity: sensor.speedtest_last_run
          - entity: sensor.update_speedtest
            tap_action:
              action: call-service
              service: speedtestdotnet.speedtest
      - type: divider
      - type: horizontal-stack
        cards:
          - type: custom:mini-graph-card
            entities:
              - entity: sensor.speedtest_download
            name: Download
            unit: Mbit/s
            decimals: 0
            line_color: blue
            hours_to_show: 96
            points_per_hour: 0.25
            icon: mdi:download-network
            hour24: true
            show:
              extrema: true
          - type: custom:mini-graph-card
            entities:
              - entity: sensor.speedtest_upload
            name: Upload
            unit: Mbit/s
            decimals: 0
            line_color: red
            hours_to_show: 96
            points_per_hour: 0.25
            icon: mdi:upload-network
            hour24: true
            show:
              extrema: true
  # Pi-Hole
  - type: custom:vertical-stack-in-card
    cards:
      - type: custom:button-card
        color_type: label-card
        color: var(--paper-item-icon-color)
        name: Pi-hole
        styles:
          card:
            - border-radius: 0px
            - height: 10px
      - type: entities
        entities:
          - entity: switch.pihole_primary
            name: Primary DNS
            icon: mdi:pi-hole
          - entity: sensor.pi_hole_dns_unique_clients
            name: Clients
            icon: mdi:account
          - entity: sensor.pi_hole_dns_queries_today
            name: Requests
          - entity: sensor.pi_hole_ads_percentage_blocked_today
            name: Blocked
      - type: divider
      - type: entities
        entities:
          - entity: switch.pihole_secondary
            name: Secondary DNS
            icon: mdi:pi-hole
          - entity: sensor.pi_hole_2_dns_unique_clients
            name: Clients
            icon: mdi:account
          - entity: sensor.pi_hole_2_dns_queries_today
            name: Requests
            icon: mdi:comment-question-outline
          - entity: sensor.pi_hole_2_ads_percentage_blocked_today
            name: Blocked
            icon: mdi:close-octagon-outline
  # Devices online
  - type: custom:vertical-stack-in-card
    cards:
      - type: custom:button-card
        color_type: label-card
        color: var(--paper-item-icon-color)
        name: Devices
        styles:
          card:
            - border-radius: 0px
            - height: 10px
      - type: entities
        show_header_toggle: false
        entities:
          - sensor.macos_server
          - sensor.alarm_system
          - sensor.keypad
          - sensor.rpi_3b
          - sensor.rpi_3b_plus
          - sensor.rpi_zero
          - sensor.computer
4 Likes

Ok Cerb, now I’m very interested in your sensors.yaml. Any chance you can share that as well? I love your setup!

Love this setup, gonna copy a lot of it!

Mine isn’t much yet, but I’m just pretty excited that I got my system monitoring setup last night with OpenHardwareMonitor. It was pretty easy since there is already a HA component for this program.

1 Like

Where are you getting your active container count sensor. The switches I am assuming come from HADockermon, but I can’t seem to find anything that gives you a count.

A simple command: docker ps | wc -l
will give you running count.

docker ps -a | wc -l Will give you the total count.

thanks, will try this when I get home

1 Like

is this better than system monitor?

but how are you getting the data into home assistant? File Sensor and a cron job to update the file on a regular basis with the current running count? seems this would not keep the active count very current unless you set the cron job to run very often and that just seems like a bad idea. lol

1 Like

Is setup to send data to HA through mqtt.
(Python script)

Python is not my forte. I don’t suppose you would be willing to share your script? :slight_smile:

hi,
what do you use for online/offline monitoring?
thanks

If you don’t mind sharing, how are you calculating startup duration?

If you refering to the devices, I just ping them.

1 Like

As I use docker I have a entrypoint script which writes a timestamp at container start.
I then use the home assistant startup event and calculate the time difference.

thanks! how do you count number of sensors, switches, etc?

There’s also this:

1 Like