HA에서 미니그래프 카드로 차트 표시하기

안녕하세요. 달소입니다.

이번에는 HAOS에서 그래프 형식으로 카드를 구성하는 방법입니다.

사용할 깃허브는 아래와같습니다.

GitHub - kalkih/mini-graph-card: Minimalistic graph card for Home Assistant Lovelace UIgithub.comMinimalistic graph card for Home Assistant Lovelace UI - GitHub - kalkih/mini-graph-card: Minimalistic graph card for Home Assistant Lovelace UI

목표는 아래처럼 ㅎ...

image.png.jpg

플러그인 설치하기

HACS -> 통합 -> 프론트엔드 -> 검색 mini-graph-card

image.png.jpg
image.png.jpg
image.png.jpg

설치되면 재시작이 필요없이 새로고침만 한번 해주시면됩니다.

사용방법

기본사용방법은 깃허브에 잘 나와있습니다.

GitHub - kalkih/mini-graph-card: Minimalistic graph card for Home Assistant Lovelace UIgithub.comMinimalistic graph card for Home Assistant Lovelace UI - GitHub - kalkih/mini-graph-card: Minimalistic graph card for Home Assistant Lovelace UI

저는 앞서 구축한 Proxmox 의 몇가지를 차트로 표현해보겠습니다.

기존

image.png.jpg

기존 코드

type: entities
entities:
 - entity: sensor.node_ds_proxmox_main_cpu_used
   name: CPU used
 - entity: sensor.node_ds_proxmox_main_disk_used_percentage
   name: Disk used percentage
 - entity: sensor.node_ds_proxmox_main_memory_free
   name: Memory free
 - entity: sensor.node_ds_proxmox_main_memory_used
   name: Memory used
 - entity: sensor.node_ds_proxmox_main_memory_used_percentage
   name: Memory used percentage
 - entity: binary_sensor.node_ds_proxmox_main_status
   name: Status
 - entity: sensor.node_ds_proxmox_main_uptime
   name: Uptime
title: Node DS-Proxmox-Main

변경 코드

일단 두가지 버전으로 공유드리겠습니다.

저도 알아가는 단계라...ㅎ

image.png.jpg

1번

type: custom:mini-graph-card
entities:
 - entity: sensor.node_ds_proxmox_main_cpu_used
title: Node DS-Proxmox-Main

2번

type: horizontal-stack
cards:
 - type: custom:mini-graph-card
   entities:
     - sensor.node_ds_proxmox_main_cpu_used
   line_color: blue
   line_width: 8
   font_size: 75
 - type: custom:mini-graph-card
   entities:
     - sensor.node_ds_proxmox_main_memory_free
   line_color: '#e74c3c'
   line_width: 8
   font_size: 75
 - type: custom:mini-graph-card
   entities:
     - sensor.node_ds_proxmox_main_memory_used
   line_color: var(--accent-color)
   line_width: 8
   font_size: 75

더 좋은 설정방법이 있으시다면 추천부탁드립니다~~