-Teme-

Electricity_consumption_and_price_history

Oct 21st, 2025
1,004
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 4.93 KB | None | 0 0
  1. type: vertical-stack
  2. cards:
  3.   - type: custom:config-template-card
  4.     entities:
  5.      - input_select.apex_span
  6.     variables:
  7.       span: states['input_select.apex_span'].state
  8.     card:
  9.       type: custom:apexcharts-card
  10.       header:
  11.         title: Electricity consumption and price history
  12.         show: true
  13.         show_states: true
  14.       update_interval: 10min
  15.       graph_span: ${span}
  16.       apex_config:
  17.         grid:
  18.           show: true
  19.         legend:
  20.           show: false
  21.         chart:
  22.           height: 300px
  23.           toolbar:
  24.             show: true
  25.         xaxis:
  26.           axisBorder:
  27.             show: false
  28.           axisTicks:
  29.             show: true
  30.           tooltip:
  31.             enabled: false
  32.           tickPlacement: between
  33.           crosshairs:
  34.             show: true
  35.           labels:
  36.             style:
  37.               fontSize: 11px
  38.               fontWeight: 1400
  39.             offsetX: -1
  40.       experimental:
  41.         color_threshold: true
  42.       yaxis:
  43.         - id: price_chart
  44.           min: ~0
  45.           apex_config:
  46.             tickAmount: 10
  47.             forceNiceScale: true
  48.             title:
  49.               text: Price (ยข/kWh)
  50.             labels:
  51.               formatter: |
  52.                EVAL:v => `ยข ${v.toFixed(2)}`
  53.         - id: consumption
  54.           min: 0
  55.           opposite: true
  56.           apex_config:
  57.             tickAmount: 10
  58.             forceNiceScale: true
  59.             title:
  60.               text: Consumption (kW)
  61.             labels:
  62.               formatter: |
  63.                EVAL:v => `${v.toFixed(0)} kW`
  64.       series:
  65.         - entity: sensor.nordpool
  66.           name: Price now
  67.           show:
  68.             in_header: false
  69.           group_by:
  70.             fill: last
  71.           yaxis_id: price_chart
  72.           type: area
  73.           extend_to: now
  74.           float_precision: 3
  75.           stroke_width: 0.2
  76.           opacity: 0.6
  77.           fill_raw: "null"
  78.           unit: ยข/kWh
  79.           color: gold
  80.           color_threshold:
  81.             - value: -10
  82.               color: dodgerblue
  83.             - value: 0
  84.               color: darkgreen
  85.             - value: 5
  86.               color: green
  87.             - value: 10
  88.               color: orange
  89.             - value: 15
  90.               color: red
  91.             - value: 20
  92.               color: darkred
  93.             - value: 50
  94.               color: black
  95.         - entity: sensor.pro3em_total_active_power
  96.           show:
  97.             in_header: false
  98.           name: Consumption now
  99.           yaxis_id: consumption
  100.           type: line
  101.           stroke_width: 3
  102.           opacity: 0.8
  103.           curve: smooth
  104.           group_by:
  105.             func: median
  106.             duration: 10min
  107.           color: lightgrey
  108.           extend_to: false
  109.       show:
  110.         last_updated: true
  111.       view_layout:
  112.         position: main
  113.       card_mod:
  114.         style: |
  115.          ha-card {
  116.             --ha-card-background: #101010;
  117.             color: var(--primary-color);
  118.           }
  119.   - type: horizontal-stack
  120.     cards:
  121.       - type: entities
  122.         entities:
  123.          - input_select.apex_span
  124.         card_mod:
  125.           style: |
  126.            ha-card {
  127.               --ha-card-background: #101010;
  128.               color: var(--primary-color);
  129.             }
  130.       - type: gauge
  131.         entity: sensor.pro3em_phase_a_active_power
  132.         unit: W
  133.         min: 50
  134.         needle: true
  135.         severity:
  136.           green: 0
  137.           yellow: 2300
  138.           red: 4600
  139.         name: L1 Power
  140.         max: 5750
  141.         card_mod:
  142.           style: |
  143.            ha-card {
  144.               --ha-card-background: #101010;
  145.               color: var(--primary-color);
  146.             }
  147.       - type: gauge
  148.         entity: sensor.pro3em_phase_b_active_power
  149.         unit: W
  150.         min: 50
  151.         needle: true
  152.         severity:
  153.           green: 0
  154.           yellow: 2300
  155.           red: 4600
  156.         name: L2 Power
  157.         max: 5750
  158.         card_mod:
  159.           style: |
  160.            ha-card {
  161.               --ha-card-background: #101010;
  162.               color: var(--primary-color);
  163.             }
  164.       - type: gauge
  165.         entity: sensor.pro3em_phase_c_active_power
  166.         unit: W
  167.         min: 50
  168.         needle: true
  169.         severity:
  170.           green: 0
  171.           yellow: 2300
  172.           red: 4600
  173.         name: L3 Power
  174.         max: 5750
  175.         card_mod:
  176.           style: |
  177.            ha-card {
  178.               --ha-card-background: #101010;
  179.               color: var(--primary-color);
  180.             }
  181.       - type: gauge
  182.         entity: sensor.pro3em_total_active_power
  183.         needle: true
  184.         unit: W
  185.         min: 200
  186.         max: 17250
  187.         severity:
  188.           green: 0
  189.           yellow: 6900
  190.           red: 13800
  191.         name: Power Total
  192.         card_mod:
  193.           style: |
  194.            ha-card {
  195.               --ha-card-background: #101010;
  196.               color: var(--primary-color);
  197.             }
  198.  
Advertisement
Add Comment
Please, Sign In to add comment