프로젝트 소개

Mini Graph Card는 Home Assistant용 사용자 정의 Lovelace 카드로, 센서 및 binary_sensor 엔터티의 현재 상태를 해당 기록의 선 또는 막대 그래프와 함께 표시합니다. HACS를 통해 설치하거나, 번들을 config/www에 수동으로 복사하거나, CLI 다운로드를 통해 설치한 다음 Lovelace에서 JavaScript 모듈 리소스로 참조합니다. 카드는 YAML로 구성됩니다. 필수 옵션은 type(custom:mini-graph-card)과 센서 엔터티 목록인 entities입니다. 각 엔터티는 단순한 엔터티 ID이거나 attribute, name, color, unit, aggregate_func, show_state, show_legend_state, show_indicator, show_graph, show_line, show_fill, show_points, show_legend, state_adaptive_color, y_axis, fixed_value, smoothing과 같은 옵션을 가진 객체일 수 있습니다. 카드 수준 옵션에는 icon, icon_image, name, unit, tap_action, group, hours_to_show, points_per_hour, aggregate_func, group_by, update_interval, cache, show, animate, height, bar_spacing, line_width, line_color, color_thresholds, color_thresholds_transition, decimals, hour24, font_size, font_size_header, align_header, align_icon, align_state, lower_bound, upper_bound, min_bound_range, secondary bounds, smoothing, state_map, value_factor, logarithmic이 포함됩니다. show 목록은 UI 요소를 제어합니다: name, icon, state, graph(line, bar 또는 false), fill, points, legend, average, extrema, labels, labels_secondary, name_adaptive_color, icon_adaptive_color, loading_indicator. 집계 함수에는 avg, median, min, max, first, last, sum, delta, diff가 포함됩니다. 데이터는 interval, date 또는 hour별로 그룹화할 수 있습니다. 색상 임계값은 부드럽거나 급격한 전환과 중간 정지 값의 보간을 지원합니다. 숫자가 아닌 상태는 state_map을 통해 레이블에 매핑할 수 있으며, 중첩된 딕셔너리나 리스트의 속성은 점 표기법 경로로 접근할 수 있습니다. 예제는 단일 엔터티 카드, 대체 스타일, 여러 엔터티, 막대 차트, 주간 기록, 그래프 전용 카드, 가로 스택, 동적 선 색상, 보조 y축, 날짜별 그룹화, 집계 함수, 바이너리 센서, 추가 상태 전용 엔터티 표시를 다룹니다. 테마 변수 mcg-title-letter-spacing과 mcg-title-font-weight를 통해 모양을 사용자 정의할 수 있습니다. 개발에는 nodejs와 npm이 필요하며, npm run build 및 npm run watch 스크립트가 있습니다.