Advertisement
dykandDK

HA - YAML - Apex chart with today’s energy consumption

Jan 2nd, 2023
3,453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.69 KB | None | 0 0
  1. type: custom:apexcharts-card
  2. apex_config:
  3.   chart:
  4.     height: 300px
  5.   xaxis:
  6.     tickAmount: 24
  7.     labels:
  8.       format: HH
  9.   plotOptions:
  10.     bar:
  11.       dataLabels:
  12.         position: bottom
  13.         maxItems: 100
  14.         hideOverflowingLabels: true
  15.         orientation: vertical
  16.       columnWidth: 90%
  17.   dataLabels:
  18.     enabled: true
  19.     style:
  20.       colors:
  21.        - '#fff'
  22.       fontSize: 10px
  23.     distributed: true
  24.     background:
  25.       enabled: false
  26. graph_span: 1day
  27. yaxis:
  28.   - id: kwh
  29.     min: 0
  30.     max: '|+0.5|'
  31.     decimals: 1
  32.     apex_config:
  33.       tickAmount: 6
  34.       title:
  35.         text: Forbrug i kWh
  36.         rotate: '-90'
  37.       axisBorder:
  38.         show: true
  39.         color: '#fff'
  40.   - id: hidden
  41.     opposite: true
  42.     show: false
  43. span:
  44.   start: day
  45. show:
  46.   last_updated: false
  47. header:
  48.   show: true
  49.   title: Dagens elforbrug
  50.   standard_format: true
  51.   show_states: true
  52.   colorize_states: true
  53. experimental:
  54.   color_threshold: true
  55. series:
  56.   - entity: sensor.kamstrup_total_import_filter
  57.     name: Forbrug
  58.     type: column
  59.     unit: kWh
  60.     float_precision: 2
  61.     yaxis_id: kwh
  62.     group_by:
  63.       func: diff
  64.       duration: 1hour
  65.     extend_to: now
  66.     color_threshold:
  67.       - value: 0
  68.         color: green
  69.       - value: 0.5
  70.         color: orange
  71.       - value: 1
  72.         color: red
  73.       - value: 1.5
  74.         color: darkred
  75.     show:
  76.       datalabels: true
  77.       legend_value: true
  78.       in_header: false
  79.       extremas: time
  80.   - entity: sensor.kamstrup_total_import_filter
  81.     name: Total
  82.     type: column
  83.     yaxis_id: hidden
  84.     unit: kWh
  85.     group_by:
  86.       func: diff
  87.       duration: 1day
  88.     show:
  89.       in_chart: false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement