2025年1月30日星期四 下午12:56:21

How to Add System Monitoring to Home Assistant?(system monitor integration)]

2 年 前
#16528 引用
systemmonitor

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

About

The systemmonitor sensor platform allows you to monitor disk usage, memory usage, CPU usage, and running processes.

As my smart home continues to grow in complexity–and as my household becomes more used to its advantages–I’ll want to make sure I’m aware of any problems as soon as possible.

One way to help with this is to monitor the performance of the Raspberry Pi itself. Home Assistant has several system-monitor components that can help with this.

I’m using the System Monitor components.
0
2 年 前
#16529 引用
1


System Monitor: RAM, CPU, NETWORK and DISK usage

Mobile Device: Battery Level, Public IP address, Internal Storage

Batteries Percentages for different sensors

Battery Low Binary Sensors

Zones
Most Scripts
Some Automations
0
2 年 前
#16530 引用
How to use - This device can not be added from the UI

This device can not be added from the UI
You can add this device by adding it to your 'configuration.yaml'. See the documentation for more information. https://www.home-assistant.io/integrations/systemmonitor

I had to modify the existing sensor section of my configuration.yaml file .


Step 1:在HA的传感器(sensor)模组中,提供了监测cpu和内容使用率等的平台,如下:(添加至configuration.yaml中)

sensor:
  - platform: systemmonitor
    resources:
      - type: disk_use_percent
      - type: memory_use_percent
      - type: processor_use
      - type: last_boot



If you are adding multiple devices, then it would look like this:

sensor:
  - platform: xiaomi_miot
    name: server_plug # 自定义名称
    host: 192.168.101.44 # 插座IP
    token: 2408ba10c691feeb2e7cef627dc0683d  # 前面获取到的token
    max_properties: 10
    default_properties_getter: get_properties
    default_properties:
      - "{'did': 'power', 'piid': 1, 'siid': 2}"      
      - "{'did': 'temperature', 'piid': 6, 'siid': 2}"      
      - "{'did': 'indicator_light', 'piid': 1, 'siid': 3}"      
      - "{'did': 'on_duration', 'piid': 1, 'siid': 4}"      
      - "{'did': 'off_duration', 'piid': 2, 'siid': 4}"      
      - "{'did': 'countdown', 'piid': 3, 'siid': 4}"      
      - "{'did': 'task_switch', 'piid': 4, 'siid': 4}"      
      - "{'did': 'countdown_info', 'piid': 5, 'siid': 4}"      
      - "{'did': 'power_consumption', 'piid': 1, 'siid': 5}"      
      - "{'did': 'electric_current', 'piid': 2, 'siid': 5}"      
      - "{'did': 'voltage', 'piid': 3, 'siid': 5}"      
      - "{'did': 'electric_power', 'piid': 6, 'siid': 5}"
  - platform: template
    sensors:
      phil_status:
        value_template: '{{ states.input_select.phil_status_dropdown.state }}'
        friendly_name: 'Phil'
      helen_status:
        value_template: '{{ states.input_select.helen_status_dropdown.state }}'
        friendly_name: 'Helen'

  - platform: systemmonitor
    resources:
      - type: disk_use_percent
      - type: memory_use_percent
      - type: processor_use
      - type: last_boot



full



# Example configuration.yaml entry with all entry types (delete/comment out as necessary)
sensor:
  - platform: systemmonitor
    resources:
      - type: disk_use_percent
      - 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

0
2 年 前
#16531 引用
Step 2:管理页面元素(Web UI)  add card -- - type: entities


  


有了数据,接下来添加到管理界面来显示相关数据信息。




我采用了card type:entities 的自定义卡片来显示


type: entities
entities:
  - entity: input_boolean.input_boolean_wife
  - entity: input_boolean.input_boolean_husband
  - entity: sensor.cpu_speed
  - entity: sensor.disk_use_percent
  - entity: sensor.memory_use_percent
show_header_toggle: true
state_color: true

0
2 年 前
#18982 引用
How to use - This device can be added from the UI

This device can be added from the UI
0
7 个月 前
#39277 引用
202405

step 1. add system monitor integration
step 2. enabled entity id
step 3. add ui


Note
传感器的名字变了

sensor.system_monitor_disk_use
0