Netdata
The netdata
sensor integration集成将 Home Assistant 与您的设备、服务等连接和集成。 [Learn more] allows you to display information collected by Netdata
Prerequisites
A running Netdata instance, accessible from your Home Assistant instance. For more information on setting up Netdata, check out their documentation
Setup
Getting the details to configure the sensors is a bit tricky as Netdata uses different name for the element:
value that is required. To get the value for the data_group:
use Netdata’s web interface. 1.
marks the name for the data_group:
. 2.
are the names for the element to show in Home Assistant. The name that is shown can be different than the name under which the metrics are available.
To check if the element:
name matches the name in the Netdata frontend, use curl
with the IP address of your Netdata instance, its port and the data_group
:
$ curl -X GET "http://[Netdata_Instance]:19999/api/v1/data?chart=[data_group]&points=2&options=jsonwrap"
{
"api": 1,
"id": "system.ipv4",
"name": "system.ipv4",
[...]
"dimension_names": ["received", "sent"],
"dimension_ids": ["InOctets", "OutOctets"],
[...]
-
dimension_names
: Names shown in the frontend. -
dimension_ids
: Names to use forelement
.
Alternatively you can browse to the built in Netdata API in your browser http://[Netdata_Instance]:19999/api/v1/allmetrics?format=json
and search for the data_group
identified in the Netdata frontend. In the example JSON below the data group is “system.load”.
"system.load": {
"name":"system.load",
"context":"system.load",
"units":"load",
"last_updated": 1558446920,
"dimensions": {
"load1": {
"name": "load1",
"value": 0.1250000
},
"load5": {
"name": "load5",
"value": 0.1290000
},
"load15": {
"name": "load15",
"value": 0.1430000
}
}
},
Once the data_group
“system.load” and the element
“load15” have been identified from the JSON it can be configured in your configuration.yaml
configuration.yaml 文件是 Home Assistant 的主要配置文件。它列出了要加载的集成及其特定配置。在某些情况下,需要直接在 configuration.yaml 文件中手动编辑配置。大多数集成可以在 UI 中配置。 [Learn more] file.
在更改了configuration.yaml
configuration.yaml 文件是 Home Assistant 的主要配置文件。它列出了要加载的集成及其特定配置。在某些情况下,需要直接在 configuration.yaml 文件中手动编辑配置。大多数集成可以在 UI 中配置。 [Learn more] 文件后,重启 Home Assistant 以应用更改。 该集成现在显示在集成页面的 设置 > 设备与服务 下。其实体在集成卡片上以及实体标签上列出。
Configuration
Add the following to your configuration.yaml
configuration.yaml 文件是 Home Assistant 的主要配置文件。它列出了要加载的集成及其特定配置。在某些情况下,需要直接在 configuration.yaml 文件中手动编辑配置。大多数集成可以在 UI 中配置。 [Learn more].
# Example configuration.yaml entry
sensor:
- platform: netdata
resources:
load:
data_group: system.load
element: load15
Configuration Variables
List of details to monitor.
Name to use for the sensor in the frontend.
Icon to use for the sensor.
Full example
# Example configuration.yaml entry
sensor:
- platform: netdata
host: "192.168.1.2"
port: "19999"
name: SomeHostName
resources:
system_load:
data_group: system.load
element: load15
core0_freq:
data_group: "cpu.cpufreq"
element: "cpu0"
icon: mdi:chip