Guest User

HA BMS dashboard

a guest
Nov 12th, 2026
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 197.34 KB | None | 0 0
  1. title: Batterij Monitor
  2. views:
  3.   - type: sections
  4.     max_columns: 3
  5.     title: BMS Overzicht
  6.     path: bms-overzicht
  7.     icon: mdi:battery-charging
  8.     dense_section_placement: false
  9.     sections:
  10.       - type: grid
  11.         column_span: 3
  12.         visibility:
  13.           - condition: screen
  14.             media_query: '(min-width: 1280px)'
  15.         cards:
  16.           - type: custom:mushroom-template-card
  17.             primary: Batterijsysteem
  18.             secondary: >-
  19.               {% set soc = states('sensor.inverter_battery') %}{% set cc =
  20.               states('sensor.coulomb_soc_totaal') %}{% set ns = namespace(n=0)
  21.               %}{% for i in range(1, 7) %}{% if
  22.               is_number(states('sensor.pace_bms_bms' ~ i ~ '_soc')) %}{% set
  23.               ns.n = ns.n + 1 %}{% endif %}{% endfor %}Deye {{ (soc | float |
  24.              round(0) | int) if is_number(soc) else '–' }}% · Coulomb {{ (cc |
  25.               float | round(0) | int) if is_number(cc) else '–' }}% · {{ ns.n
  26.               }}/6 online
  27.             icon: >-
  28.               {% set s = states('sensor.inverter_battery') | float(0) %}{% if s
  29.               > 80 %}mdi:battery{% elif s > 60 %}mdi:battery-80{% elif s > 40
  30.               %}mdi:battery-60{% elif s > 20 %}mdi:battery-40{% else
  31.               %}mdi:battery-alert{% endif %}
  32.             badge_icon: |-
  33.               {% set ns = namespace(f=false) %}
  34.               {% for i in range(1, 7) %}
  35.                 {% if states('sensor.pace_bms_bms' ~ i ~ '_fault_status') not in ['', 'unavailable', 'unknown', 'none'] %}{% set ns.f = true %}{% endif %}
  36.               {% endfor %}
  37.               {% if ns.f %}mdi:alert-circle{% endif %}
  38.             badge_color: red
  39.             color: >-
  40.               {% set s = states('sensor.inverter_battery') | float(0) %}{% if s
  41.               >= 74.9 %}green{% elif s >= 50 %}amber{% elif s >= 30 %}orange{%
  42.               else %}red{% endif %}
  43.             features_position: bottom
  44.             grid_options:
  45.               columns: 18
  46.               rows: 1
  47.           - type: custom:mushroom-template-card
  48.             primary: Totaal vermogen
  49.             secondary: |-
  50.               {% set ns = namespace(p=0) %}
  51.               {% for i in range(1, 7) %}
  52.                 {% set ns.p = ns.p + states('sensor.pace_bms_bms' ~ i ~ '_power') | float(0) %}
  53.               {% endfor %}
  54.               {{ ns.p | round(0) }} W
  55.             icon: mdi:lightning-bolt
  56.             icon_color: >-
  57.               {% set ns = namespace(p=0) %}
  58.  
  59.               {% for i in range(1, 7) %}
  60.                 {% set ns.p = ns.p + states('sensor.pace_bms_bms' ~ i ~ '_power') | float(0) %}
  61.               {% endfor %}
  62.  
  63.               {% if ns.p > 0 %}green{% elif ns.p < 0 %}orange{% else %}grey{%
  64.               endif %}
  65.             grid_options:
  66.               columns: 18
  67.               rows: 1
  68.       - type: grid
  69.         visibility:
  70.           - condition: screen
  71.             media_query: '(min-width: 0px) and (max-width: 1279px)'
  72.         cards:
  73.           - type: custom:mushroom-template-card
  74.             primary: Batterijsysteem
  75.             secondary: >-
  76.               {% set soc = states('sensor.inverter_battery') %}{% set cc =
  77.               states('sensor.coulomb_soc_totaal') %}{% set ns = namespace(n=0)
  78.               %}{% for i in range(1, 7) %}{% if
  79.               is_number(states('sensor.pace_bms_bms' ~ i ~ '_soc')) %}{% set
  80.               ns.n = ns.n + 1 %}{% endif %}{% endfor %}Deye {{ (soc | float |
  81.              round(0) | int) if is_number(soc) else '–' }}% · Coulomb {{ (cc |
  82.               float | round(0) | int) if is_number(cc) else '–' }}% · {{ ns.n
  83.               }}/6 online
  84.             icon: >-
  85.               {% set s = states('sensor.inverter_battery') | float(0) %}{% if s
  86.               > 80 %}mdi:battery{% elif s > 60 %}mdi:battery-80{% elif s > 40
  87.               %}mdi:battery-60{% elif s > 20 %}mdi:battery-40{% else
  88.               %}mdi:battery-alert{% endif %}
  89.             badge_icon: |-
  90.               {% set ns = namespace(f=false) %}
  91.               {% for i in range(1, 7) %}
  92.                 {% if states('sensor.pace_bms_bms' ~ i ~ '_fault_status') not in ['', 'unavailable', 'unknown', 'none'] %}{% set ns.f = true %}{% endif %}
  93.               {% endfor %}
  94.               {% if ns.f %}mdi:alert-circle{% endif %}
  95.             badge_color: red
  96.             color: >-
  97.               {% set s = states('sensor.inverter_battery') | float(0) %}{% if s
  98.               >= 74.9 %}green{% elif s >= 50 %}amber{% elif s >= 30 %}orange{%
  99.               else %}red{% endif %}
  100.             features_position: bottom
  101.             grid_options:
  102.               columns: 12
  103.               rows: 1
  104.           - type: custom:mushroom-template-card
  105.             primary: Totaal vermogen
  106.             secondary: |-
  107.               {% set ns = namespace(p=0) %}
  108.               {% for i in range(1, 7) %}
  109.                 {% set ns.p = ns.p + states('sensor.pace_bms_bms' ~ i ~ '_power') | float(0) %}
  110.               {% endfor %}
  111.               {{ ns.p | round(0) }} W
  112.             icon: mdi:lightning-bolt
  113.             icon_color: >-
  114.               {% set ns = namespace(p=0) %}
  115.  
  116.               {% for i in range(1, 7) %}
  117.                 {% set ns.p = ns.p + states('sensor.pace_bms_bms' ~ i ~ '_power') | float(0) %}
  118.               {% endfor %}
  119.  
  120.               {% if ns.p > 0 %}green{% elif ns.p < 0 %}orange{% else %}grey{%
  121.               endif %}
  122.             grid_options:
  123.               columns: 12
  124.               rows: 1
  125.       - type: grid
  126.         column_span: 3
  127.         cards:
  128.           - type: custom:mushroom-template-card
  129.             primary: ACCU 1 (master)
  130.             secondary: >-
  131.               Coulomb {% set c = states('sensor.coulomb_bms1_soc') %}{{ (c |
  132.              float | round(1)) if is_number(c) else '–' }}% (BMS {{
  133.               states('sensor.pace_bms_bms1_soc') | float(0) | round(1) }}%) · {{
  134.               states('sensor.pace_bms_bms1_environment_temperature') | float(0)
  135.               | round(1) }}°C · {{ states('sensor.pace_bms_bms1_system_status')
  136.               }}
  137.             icon: >-
  138.               {% set c = states('sensor.coulomb_bms1_soc') %}{% set soc = (c |
  139.              float) if is_number(c) else states('sensor.pace_bms_bms1_soc') |
  140.               float(0) %}
  141.  
  142.               {% if soc >= 95 %}mdi:battery
  143.  
  144.               {% elif soc >= 85 %}mdi:battery-90
  145.  
  146.               {% elif soc >= 75 %}mdi:battery-80
  147.  
  148.               {% elif soc >= 65 %}mdi:battery-70
  149.  
  150.               {% elif soc >= 55 %}mdi:battery-60
  151.  
  152.               {% elif soc >= 45 %}mdi:battery-50
  153.  
  154.               {% elif soc >= 35 %}mdi:battery-40
  155.  
  156.               {% elif soc >= 25 %}mdi:battery-30
  157.  
  158.               {% elif soc >= 15 %}mdi:battery-20
  159.  
  160.               {% elif soc >= 5 %}mdi:battery-10
  161.  
  162.               {% else %}mdi:battery-alert
  163.  
  164.               {% endif %}
  165.             badge_icon: >-
  166.               {% if states('sensor.pace_bms_bms1_fault_status') not in ['',
  167.               'unavailable', 'unknown', 'none'] %}mdi:alert{% endif %}
  168.             badge_color: red
  169.             color: >-
  170.               {% set c = states('sensor.coulomb_bms1_soc') %}{% set soc = (c |
  171.              float) if is_number(c) else states('sensor.pace_bms_bms1_soc') |
  172.               float(0) %}
  173.  
  174.               {% if soc >= 75 %}green{% elif soc >= 50 %}amber{% elif soc >= 30
  175.               %}orange{% else %}red{% endif %}
  176.             features_position: bottom
  177.             grid_options:
  178.               columns: 12
  179.               rows: 1
  180.             tap_action:
  181.               action: navigate
  182.               navigation_path: bms1
  183.           - type: custom:mushroom-template-card
  184.             primary: ACCU 2
  185.             secondary: >-
  186.               Coulomb {% set c = states('sensor.coulomb_bms2_soc') %}{{ (c |
  187.              float | round(1)) if is_number(c) else '–' }}% (BMS {{
  188.               states('sensor.pace_bms_bms2_soc') | float(0) | round(1) }}%) · {{
  189.               states('sensor.pace_bms_bms2_environment_temperature') | float(0)
  190.               | round(1) }}°C · {{ states('sensor.pace_bms_bms2_system_status')
  191.               }}
  192.             icon: >-
  193.               {% set c = states('sensor.coulomb_bms2_soc') %}{% set soc = (c |
  194.              float) if is_number(c) else states('sensor.pace_bms_bms2_soc') |
  195.               float(0) %}
  196.  
  197.               {% if soc >= 95 %}mdi:battery
  198.  
  199.               {% elif soc >= 85 %}mdi:battery-90
  200.  
  201.               {% elif soc >= 75 %}mdi:battery-80
  202.  
  203.               {% elif soc >= 65 %}mdi:battery-70
  204.  
  205.               {% elif soc >= 55 %}mdi:battery-60
  206.  
  207.               {% elif soc >= 45 %}mdi:battery-50
  208.  
  209.               {% elif soc >= 35 %}mdi:battery-40
  210.  
  211.               {% elif soc >= 25 %}mdi:battery-30
  212.  
  213.               {% elif soc >= 15 %}mdi:battery-20
  214.  
  215.               {% elif soc >= 5 %}mdi:battery-10
  216.  
  217.               {% else %}mdi:battery-alert
  218.  
  219.               {% endif %}
  220.             badge_icon: >-
  221.               {% if states('sensor.pace_bms_bms2_fault_status') not in ['',
  222.               'unavailable', 'unknown', 'none'] %}mdi:alert{% endif %}
  223.             badge_color: red
  224.             color: >-
  225.               {% set c = states('sensor.coulomb_bms2_soc') %}{% set soc = (c |
  226.              float) if is_number(c) else states('sensor.pace_bms_bms2_soc') |
  227.               float(0) %}
  228.  
  229.               {% if soc >= 75 %}green{% elif soc >= 50 %}amber{% elif soc >= 30
  230.               %}orange{% else %}red{% endif %}
  231.             features_position: bottom
  232.             grid_options:
  233.               columns: 12
  234.               rows: 1
  235.             tap_action:
  236.               action: navigate
  237.               navigation_path: bms2
  238.           - type: custom:mushroom-template-card
  239.             primary: ACCU 3
  240.             secondary: >-
  241.               Coulomb {% set c = states('sensor.coulomb_bms3_soc') %}{{ (c |
  242.              float | round(1)) if is_number(c) else '–' }}% (BMS {{
  243.               states('sensor.pace_bms_bms3_soc') | float(0) | round(1) }}%) · {{
  244.               states('sensor.pace_bms_bms3_environment_temperature') | float(0)
  245.               | round(1) }}°C · {{ states('sensor.pace_bms_bms3_system_status')
  246.               }}
  247.             icon: >-
  248.               {% set c = states('sensor.coulomb_bms3_soc') %}{% set soc = (c |
  249.              float) if is_number(c) else states('sensor.pace_bms_bms3_soc') |
  250.               float(0) %}
  251.  
  252.               {% if soc >= 95 %}mdi:battery
  253.  
  254.               {% elif soc >= 85 %}mdi:battery-90
  255.  
  256.               {% elif soc >= 75 %}mdi:battery-80
  257.  
  258.               {% elif soc >= 65 %}mdi:battery-70
  259.  
  260.               {% elif soc >= 55 %}mdi:battery-60
  261.  
  262.               {% elif soc >= 45 %}mdi:battery-50
  263.  
  264.               {% elif soc >= 35 %}mdi:battery-40
  265.  
  266.               {% elif soc >= 25 %}mdi:battery-30
  267.  
  268.               {% elif soc >= 15 %}mdi:battery-20
  269.  
  270.               {% elif soc >= 5 %}mdi:battery-10
  271.  
  272.               {% else %}mdi:battery-alert
  273.  
  274.               {% endif %}
  275.             badge_icon: >-
  276.               {% if states('sensor.pace_bms_bms3_fault_status') not in ['',
  277.               'unavailable', 'unknown', 'none'] %}mdi:alert{% endif %}
  278.             badge_color: red
  279.             color: >-
  280.               {% set c = states('sensor.coulomb_bms3_soc') %}{% set soc = (c |
  281.              float) if is_number(c) else states('sensor.pace_bms_bms3_soc') |
  282.               float(0) %}
  283.  
  284.               {% if soc >= 75 %}green{% elif soc >= 50 %}amber{% elif soc >= 30
  285.               %}orange{% else %}red{% endif %}
  286.             features_position: bottom
  287.             grid_options:
  288.               columns: 12
  289.               rows: 1
  290.             tap_action:
  291.               action: navigate
  292.               navigation_path: bms3
  293.           - type: custom:mushroom-template-card
  294.             primary: ACCU 4
  295.             secondary: >-
  296.               Coulomb {% set c = states('sensor.coulomb_bms4_soc') %}{{ (c |
  297.              float | round(1)) if is_number(c) else '–' }}% (BMS {{
  298.               states('sensor.pace_bms_bms4_soc') | float(0) | round(1) }}%) · {{
  299.               states('sensor.pace_bms_bms4_environment_temperature') | float(0)
  300.               | round(1) }}°C · {{ states('sensor.pace_bms_bms4_system_status')
  301.               }}
  302.             icon: >-
  303.               {% set c = states('sensor.coulomb_bms4_soc') %}{% set soc = (c |
  304.              float) if is_number(c) else states('sensor.pace_bms_bms4_soc') |
  305.               float(0) %}
  306.  
  307.               {% if soc >= 95 %}mdi:battery
  308.  
  309.               {% elif soc >= 85 %}mdi:battery-90
  310.  
  311.               {% elif soc >= 75 %}mdi:battery-80
  312.  
  313.               {% elif soc >= 65 %}mdi:battery-70
  314.  
  315.               {% elif soc >= 55 %}mdi:battery-60
  316.  
  317.               {% elif soc >= 45 %}mdi:battery-50
  318.  
  319.               {% elif soc >= 35 %}mdi:battery-40
  320.  
  321.               {% elif soc >= 25 %}mdi:battery-30
  322.  
  323.               {% elif soc >= 15 %}mdi:battery-20
  324.  
  325.               {% elif soc >= 5 %}mdi:battery-10
  326.  
  327.               {% else %}mdi:battery-alert
  328.  
  329.               {% endif %}
  330.             badge_icon: >-
  331.               {% if states('sensor.pace_bms_bms4_fault_status') not in ['',
  332.               'unavailable', 'unknown', 'none'] %}mdi:alert{% endif %}
  333.             badge_color: red
  334.             color: >-
  335.               {% set c = states('sensor.coulomb_bms4_soc') %}{% set soc = (c |
  336.              float) if is_number(c) else states('sensor.pace_bms_bms4_soc') |
  337.               float(0) %}
  338.  
  339.               {% if soc >= 75 %}green{% elif soc >= 50 %}amber{% elif soc >= 30
  340.               %}orange{% else %}red{% endif %}
  341.             features_position: bottom
  342.             grid_options:
  343.               columns: 12
  344.               rows: 1
  345.             tap_action:
  346.               action: navigate
  347.               navigation_path: bms4
  348.           - type: custom:mushroom-template-card
  349.             primary: ACCU 5
  350.             secondary: >-
  351.               Coulomb {% set c = states('sensor.coulomb_bms5_soc') %}{{ (c |
  352.              float | round(1)) if is_number(c) else '–' }}% (BMS {{
  353.               states('sensor.pace_bms_bms5_soc') | float(0) | round(1) }}%) · {{
  354.               states('sensor.pace_bms_bms5_environment_temperature') | float(0)
  355.               | round(1) }}°C · {{ states('sensor.pace_bms_bms5_system_status')
  356.               }}
  357.             icon: >-
  358.               {% set c = states('sensor.coulomb_bms5_soc') %}{% set soc = (c |
  359.              float) if is_number(c) else states('sensor.pace_bms_bms5_soc') |
  360.               float(0) %}
  361.  
  362.               {% if soc >= 95 %}mdi:battery
  363.  
  364.               {% elif soc >= 85 %}mdi:battery-90
  365.  
  366.               {% elif soc >= 75 %}mdi:battery-80
  367.  
  368.               {% elif soc >= 65 %}mdi:battery-70
  369.  
  370.               {% elif soc >= 55 %}mdi:battery-60
  371.  
  372.               {% elif soc >= 45 %}mdi:battery-50
  373.  
  374.               {% elif soc >= 35 %}mdi:battery-40
  375.  
  376.               {% elif soc >= 25 %}mdi:battery-30
  377.  
  378.               {% elif soc >= 15 %}mdi:battery-20
  379.  
  380.               {% elif soc >= 5 %}mdi:battery-10
  381.  
  382.               {% else %}mdi:battery-alert
  383.  
  384.               {% endif %}
  385.             badge_icon: >-
  386.               {% if states('sensor.pace_bms_bms5_fault_status') not in ['',
  387.               'unavailable', 'unknown', 'none'] %}mdi:alert{% endif %}
  388.             badge_color: red
  389.             color: >-
  390.               {% set c = states('sensor.coulomb_bms5_soc') %}{% set soc = (c |
  391.              float) if is_number(c) else states('sensor.pace_bms_bms5_soc') |
  392.               float(0) %}
  393.  
  394.               {% if soc >= 75 %}green{% elif soc >= 50 %}amber{% elif soc >= 30
  395.               %}orange{% else %}red{% endif %}
  396.             features_position: bottom
  397.             grid_options:
  398.               columns: 12
  399.               rows: 1
  400.             tap_action:
  401.               action: navigate
  402.               navigation_path: bms5
  403.           - type: custom:mushroom-template-card
  404.             primary: ACCU 6
  405.             secondary: >-
  406.               Coulomb {% set c = states('sensor.coulomb_bms6_soc') %}{{ (c |
  407.              float | round(1)) if is_number(c) else '–' }}% (BMS {{
  408.               states('sensor.pace_bms_bms6_soc') | float(0) | round(1) }}%) · {{
  409.               states('sensor.pace_bms_bms6_environment_temperature') | float(0)
  410.               | round(1) }}°C · {{ states('sensor.pace_bms_bms6_system_status')
  411.               }}
  412.             icon: >-
  413.               {% set c = states('sensor.coulomb_bms6_soc') %}{% set soc = (c |
  414.              float) if is_number(c) else states('sensor.pace_bms_bms6_soc') |
  415.               float(0) %}
  416.  
  417.               {% if soc >= 95 %}mdi:battery
  418.  
  419.               {% elif soc >= 85 %}mdi:battery-90
  420.  
  421.               {% elif soc >= 75 %}mdi:battery-80
  422.  
  423.               {% elif soc >= 65 %}mdi:battery-70
  424.  
  425.               {% elif soc >= 55 %}mdi:battery-60
  426.  
  427.               {% elif soc >= 45 %}mdi:battery-50
  428.  
  429.               {% elif soc >= 35 %}mdi:battery-40
  430.  
  431.               {% elif soc >= 25 %}mdi:battery-30
  432.  
  433.               {% elif soc >= 15 %}mdi:battery-20
  434.  
  435.               {% elif soc >= 5 %}mdi:battery-10
  436.  
  437.               {% else %}mdi:battery-alert
  438.  
  439.               {% endif %}
  440.             badge_icon: >-
  441.               {% if states('sensor.pace_bms_bms6_fault_status') not in ['',
  442.               'unavailable', 'unknown', 'none'] %}mdi:alert{% endif %}
  443.             badge_color: red
  444.             color: >-
  445.               {% set c = states('sensor.coulomb_bms6_soc') %}{% set soc = (c |
  446.              float) if is_number(c) else states('sensor.pace_bms_bms6_soc') |
  447.               float(0) %}
  448.  
  449.               {% if soc >= 75 %}green{% elif soc >= 50 %}amber{% elif soc >= 30
  450.               %}orange{% else %}red{% endif %}
  451.             features_position: bottom
  452.             grid_options:
  453.               columns: 12
  454.               rows: 1
  455.             tap_action:
  456.               action: navigate
  457.               navigation_path: bms6
  458.       - type: grid
  459.         column_span: 3
  460.         cards:
  461.           - type: custom:apexcharts-card
  462.             grid_options:
  463.               columns: full
  464.             header:
  465.               show: true
  466.               title: SOC Coulomb stack vs Deye
  467.               show_states: false
  468.             graph_span: 24h
  469.             apex_config:
  470.               chart:
  471.                 height: 380
  472.                 toolbar:
  473.                   show: false
  474.               yaxis:
  475.                 forceNiceScale: true
  476.               legend:
  477.                 show: true
  478.                 position: bottom
  479.                 onItemClick:
  480.                   toggleDataSeries: true
  481.               tooltip:
  482.                 shared: true
  483.                 intersect: false
  484.                 'true':
  485.                   formatter: function(value) { return value.toFixed(1) + ' %'; }
  486.               xaxis:
  487.                 tooltip:
  488.                   enabled: false
  489.             series:
  490.               - entity: sensor.inverter_battery
  491.                 name: Deye
  492.                 color: '#9e9e9e'
  493.                 float_precision: 0
  494.                 stroke_width: 2
  495.                 stroke_dash: 4
  496.                 curve: smooth
  497.                 show:
  498.                   in_header: false
  499.                 group_by:
  500.                   func: avg
  501.                   duration: 1min
  502.                   fill: last
  503.               - entity: sensor.coulomb_soc_totaal
  504.                 name: Coulomb stack
  505.                 color: '#FFD600'
  506.                 float_precision: 1
  507.                 stroke_width: 3
  508.                 curve: smooth
  509.                 show:
  510.                   in_header: false
  511.                 group_by:
  512.                   func: avg
  513.                   duration: 1min
  514.                   fill: last
  515.       - type: grid
  516.         cards:
  517.           - type: custom:apexcharts-card
  518.             header:
  519.               show: true
  520.               title: SOC
  521.               show_states: true
  522.               colorize_states: true
  523.             graph_span: 2h
  524.             apex_config:
  525.               chart:
  526.                 height: 260
  527.                 toolbar:
  528.                   show: false
  529.               yaxis:
  530.                 forceNiceScale: true
  531.               legend:
  532.                 show: false
  533.               tooltip:
  534.                 shared: true
  535.                 intersect: false
  536.                 'true':
  537.                   formatter: function(value) { return value.toFixed(1) + ' %'; }
  538.               xaxis:
  539.                 tooltip:
  540.                   enabled: false
  541.             series:
  542.               - entity: sensor.pace_bms_bms1_soc
  543.                 name: BMS 1
  544.                 color: '#4CAF50'
  545.                 float_precision: 1
  546.                 stroke_width: 0
  547.                 show:
  548.                   in_chart: false
  549.                   in_header: true
  550.                   name_in_header: true
  551.               - entity: sensor.pace_bms_bms1_soc
  552.                 name: BMS 1
  553.                 color: '#4CAF50'
  554.                 float_precision: 1
  555.                 stroke_width: 1
  556.                 curve: smooth
  557.                 show:
  558.                   in_header: false
  559.                 group_by:
  560.                   func: avg
  561.                   duration: 1min
  562.                   fill: last
  563.               - entity: sensor.pace_bms_bms2_soc
  564.                 name: BMS 2
  565.                 color: '#2196F3'
  566.                 float_precision: 1
  567.                 stroke_width: 0
  568.                 show:
  569.                   in_chart: false
  570.                   in_header: true
  571.                   name_in_header: true
  572.               - entity: sensor.pace_bms_bms2_soc
  573.                 name: BMS 2
  574.                 color: '#2196F3'
  575.                 float_precision: 1
  576.                 stroke_width: 1
  577.                 curve: smooth
  578.                 show:
  579.                   in_header: false
  580.                 group_by:
  581.                   func: avg
  582.                   duration: 1min
  583.                   fill: last
  584.               - entity: sensor.pace_bms_bms3_soc
  585.                 name: BMS 3
  586.                 color: '#FF9800'
  587.                 float_precision: 1
  588.                 stroke_width: 0
  589.                 show:
  590.                   in_chart: false
  591.                   in_header: true
  592.                   name_in_header: true
  593.               - entity: sensor.pace_bms_bms3_soc
  594.                 name: BMS 3
  595.                 color: '#FF9800'
  596.                 float_precision: 1
  597.                 stroke_width: 1
  598.                 curve: smooth
  599.                 show:
  600.                   in_header: false
  601.                 group_by:
  602.                   func: avg
  603.                   duration: 1min
  604.                   fill: last
  605.               - entity: sensor.pace_bms_bms4_soc
  606.                 name: BMS 4
  607.                 color: '#E91E63'
  608.                 float_precision: 1
  609.                 stroke_width: 0
  610.                 show:
  611.                   in_chart: false
  612.                   in_header: true
  613.                   name_in_header: true
  614.               - entity: sensor.pace_bms_bms4_soc
  615.                 name: BMS 4
  616.                 color: '#E91E63'
  617.                 float_precision: 1
  618.                 stroke_width: 1
  619.                 curve: smooth
  620.                 show:
  621.                   in_header: false
  622.                 group_by:
  623.                   func: avg
  624.                   duration: 1min
  625.                   fill: last
  626.               - entity: sensor.pace_bms_bms5_soc
  627.                 name: BMS 5
  628.                 color: '#9C27B0'
  629.                 float_precision: 1
  630.                 stroke_width: 0
  631.                 show:
  632.                   in_chart: false
  633.                   in_header: true
  634.                   name_in_header: true
  635.               - entity: sensor.pace_bms_bms5_soc
  636.                 name: BMS 5
  637.                 color: '#9C27B0'
  638.                 float_precision: 1
  639.                 stroke_width: 1
  640.                 curve: smooth
  641.                 show:
  642.                   in_header: false
  643.                 group_by:
  644.                   func: avg
  645.                   duration: 1min
  646.                   fill: last
  647.               - entity: sensor.pace_bms_bms6_soc
  648.                 name: BMS 6
  649.                 color: '#00BCD4'
  650.                 float_precision: 1
  651.                 stroke_width: 0
  652.                 show:
  653.                   in_chart: false
  654.                   in_header: true
  655.                   name_in_header: true
  656.               - entity: sensor.pace_bms_bms6_soc
  657.                 name: BMS 6
  658.                 color: '#00BCD4'
  659.                 float_precision: 1
  660.                 stroke_width: 1
  661.                 curve: smooth
  662.                 show:
  663.                   in_header: false
  664.                 group_by:
  665.                   func: avg
  666.                   duration: 1min
  667.                   fill: last
  668.       - type: grid
  669.         cards:
  670.           - type: custom:apexcharts-card
  671.             header:
  672.               show: true
  673.               title: SOC Coulomb per BMS
  674.               show_states: true
  675.               colorize_states: true
  676.             graph_span: 2h
  677.             apex_config:
  678.               chart:
  679.                 height: 260
  680.                 toolbar:
  681.                   show: false
  682.               yaxis:
  683.                 forceNiceScale: true
  684.               legend:
  685.                 show: false
  686.               tooltip:
  687.                 shared: true
  688.                 intersect: false
  689.                 'true':
  690.                   formatter: function(value) { return value.toFixed(1) + ' %'; }
  691.               xaxis:
  692.                 tooltip:
  693.                   enabled: false
  694.             series:
  695.               - entity: sensor.coulomb_bms1_soc
  696.                 name: BMS 1
  697.                 color: '#4CAF50'
  698.                 float_precision: 1
  699.                 stroke_width: 0
  700.                 show:
  701.                   in_chart: false
  702.                   in_header: true
  703.                   name_in_header: true
  704.               - entity: sensor.coulomb_bms1_soc
  705.                 name: BMS 1
  706.                 color: '#4CAF50'
  707.                 float_precision: 1
  708.                 stroke_width: 1
  709.                 curve: smooth
  710.                 show:
  711.                   in_header: false
  712.                 group_by:
  713.                   func: avg
  714.                   duration: 1min
  715.                   fill: last
  716.               - entity: sensor.coulomb_bms2_soc
  717.                 name: BMS 2
  718.                 color: '#2196F3'
  719.                 float_precision: 1
  720.                 stroke_width: 0
  721.                 show:
  722.                   in_chart: false
  723.                   in_header: true
  724.                   name_in_header: true
  725.               - entity: sensor.coulomb_bms2_soc
  726.                 name: BMS 2
  727.                 color: '#2196F3'
  728.                 float_precision: 1
  729.                 stroke_width: 1
  730.                 curve: smooth
  731.                 show:
  732.                   in_header: false
  733.                 group_by:
  734.                   func: avg
  735.                   duration: 1min
  736.                   fill: last
  737.               - entity: sensor.coulomb_bms3_soc
  738.                 name: BMS 3
  739.                 color: '#FF9800'
  740.                 float_precision: 1
  741.                 stroke_width: 0
  742.                 show:
  743.                   in_chart: false
  744.                   in_header: true
  745.                   name_in_header: true
  746.               - entity: sensor.coulomb_bms3_soc
  747.                 name: BMS 3
  748.                 color: '#FF9800'
  749.                 float_precision: 1
  750.                 stroke_width: 1
  751.                 curve: smooth
  752.                 show:
  753.                   in_header: false
  754.                 group_by:
  755.                   func: avg
  756.                   duration: 1min
  757.                   fill: last
  758.               - entity: sensor.coulomb_bms4_soc
  759.                 name: BMS 4
  760.                 color: '#E91E63'
  761.                 float_precision: 1
  762.                 stroke_width: 0
  763.                 show:
  764.                   in_chart: false
  765.                   in_header: true
  766.                   name_in_header: true
  767.               - entity: sensor.coulomb_bms4_soc
  768.                 name: BMS 4
  769.                 color: '#E91E63'
  770.                 float_precision: 1
  771.                 stroke_width: 1
  772.                 curve: smooth
  773.                 show:
  774.                   in_header: false
  775.                 group_by:
  776.                   func: avg
  777.                   duration: 1min
  778.                   fill: last
  779.               - entity: sensor.coulomb_bms5_soc
  780.                 name: BMS 5
  781.                 color: '#9C27B0'
  782.                 float_precision: 1
  783.                 stroke_width: 0
  784.                 show:
  785.                   in_chart: false
  786.                   in_header: true
  787.                   name_in_header: true
  788.               - entity: sensor.coulomb_bms5_soc
  789.                 name: BMS 5
  790.                 color: '#9C27B0'
  791.                 float_precision: 1
  792.                 stroke_width: 1
  793.                 curve: smooth
  794.                 show:
  795.                   in_header: false
  796.                 group_by:
  797.                   func: avg
  798.                   duration: 1min
  799.                   fill: last
  800.               - entity: sensor.coulomb_bms6_soc
  801.                 name: BMS 6
  802.                 color: '#00BCD4'
  803.                 float_precision: 1
  804.                 stroke_width: 0
  805.                 show:
  806.                   in_chart: false
  807.                   in_header: true
  808.                   name_in_header: true
  809.               - entity: sensor.coulomb_bms6_soc
  810.                 name: BMS 6
  811.                 color: '#00BCD4'
  812.                 float_precision: 1
  813.                 stroke_width: 1
  814.                 curve: smooth
  815.                 show:
  816.                   in_header: false
  817.                 group_by:
  818.                   func: avg
  819.                   duration: 1min
  820.                   fill: last
  821.       - type: grid
  822.         cards:
  823.           - type: custom:apexcharts-card
  824.             header:
  825.               show: true
  826.               title: Stroom
  827.               show_states: true
  828.               colorize_states: true
  829.             graph_span: 2h
  830.             apex_config:
  831.               chart:
  832.                 height: 260
  833.                 toolbar:
  834.                   show: false
  835.               yaxis:
  836.                 forceNiceScale: true
  837.               legend:
  838.                 show: false
  839.               tooltip:
  840.                 shared: true
  841.                 intersect: false
  842.                 'true':
  843.                   formatter: function(value) { return value.toFixed(1) + ' A'; }
  844.               xaxis:
  845.                 tooltip:
  846.                   enabled: false
  847.             series:
  848.               - entity: sensor.pace_bms_bms1_current
  849.                 name: BMS 1
  850.                 color: '#4CAF50'
  851.                 float_precision: 1
  852.                 stroke_width: 0
  853.                 show:
  854.                   in_chart: false
  855.                   in_header: true
  856.                   name_in_header: true
  857.               - entity: sensor.pace_bms_bms1_current
  858.                 name: BMS 1
  859.                 color: '#4CAF50'
  860.                 float_precision: 1
  861.                 stroke_width: 1
  862.                 curve: smooth
  863.                 show:
  864.                   in_header: false
  865.                 group_by:
  866.                   func: avg
  867.                   duration: 30sec
  868.                   fill: last
  869.               - entity: sensor.pace_bms_bms2_current
  870.                 name: BMS 2
  871.                 color: '#2196F3'
  872.                 float_precision: 1
  873.                 stroke_width: 0
  874.                 show:
  875.                   in_chart: false
  876.                   in_header: true
  877.                   name_in_header: true
  878.               - entity: sensor.pace_bms_bms2_current
  879.                 name: BMS 2
  880.                 color: '#2196F3'
  881.                 float_precision: 1
  882.                 stroke_width: 1
  883.                 curve: smooth
  884.                 show:
  885.                   in_header: false
  886.                 group_by:
  887.                   func: avg
  888.                   duration: 30sec
  889.                   fill: last
  890.               - entity: sensor.pace_bms_bms3_current
  891.                 name: BMS 3
  892.                 color: '#FF9800'
  893.                 float_precision: 1
  894.                 stroke_width: 0
  895.                 show:
  896.                   in_chart: false
  897.                   in_header: true
  898.                   name_in_header: true
  899.               - entity: sensor.pace_bms_bms3_current
  900.                 name: BMS 3
  901.                 color: '#FF9800'
  902.                 float_precision: 1
  903.                 stroke_width: 1
  904.                 curve: smooth
  905.                 show:
  906.                   in_header: false
  907.                 group_by:
  908.                   func: avg
  909.                   duration: 30sec
  910.                   fill: last
  911.               - entity: sensor.pace_bms_bms4_current
  912.                 name: BMS 4
  913.                 color: '#E91E63'
  914.                 float_precision: 1
  915.                 stroke_width: 0
  916.                 show:
  917.                   in_chart: false
  918.                   in_header: true
  919.                   name_in_header: true
  920.               - entity: sensor.pace_bms_bms4_current
  921.                 name: BMS 4
  922.                 color: '#E91E63'
  923.                 float_precision: 1
  924.                 stroke_width: 1
  925.                 curve: smooth
  926.                 show:
  927.                   in_header: false
  928.                 group_by:
  929.                   func: avg
  930.                   duration: 30sec
  931.                   fill: last
  932.               - entity: sensor.pace_bms_bms5_current
  933.                 name: BMS 5
  934.                 color: '#9C27B0'
  935.                 float_precision: 1
  936.                 stroke_width: 0
  937.                 show:
  938.                   in_chart: false
  939.                   in_header: true
  940.                   name_in_header: true
  941.               - entity: sensor.pace_bms_bms5_current
  942.                 name: BMS 5
  943.                 color: '#9C27B0'
  944.                 float_precision: 1
  945.                 stroke_width: 1
  946.                 curve: smooth
  947.                 show:
  948.                   in_header: false
  949.                 group_by:
  950.                   func: avg
  951.                   duration: 30sec
  952.                   fill: last
  953.               - entity: sensor.pace_bms_bms6_current
  954.                 name: BMS 6
  955.                 color: '#00BCD4'
  956.                 float_precision: 1
  957.                 stroke_width: 0
  958.                 show:
  959.                   in_chart: false
  960.                   in_header: true
  961.                   name_in_header: true
  962.               - entity: sensor.pace_bms_bms6_current
  963.                 name: BMS 6
  964.                 color: '#00BCD4'
  965.                 float_precision: 1
  966.                 stroke_width: 1
  967.                 curve: smooth
  968.                 show:
  969.                   in_header: false
  970.                 group_by:
  971.                   func: avg
  972.                   duration: 30sec
  973.                   fill: last
  974.       - type: grid
  975.         cards:
  976.           - type: custom:apexcharts-card
  977.             header:
  978.               show: true
  979.               title: Spanning
  980.               show_states: true
  981.               colorize_states: true
  982.             graph_span: 2h
  983.             apex_config:
  984.               chart:
  985.                 height: 260
  986.                 toolbar:
  987.                   show: false
  988.               yaxis:
  989.                 forceNiceScale: true
  990.               legend:
  991.                 show: false
  992.               tooltip:
  993.                 shared: true
  994.                 intersect: false
  995.                 'true':
  996.                   formatter: function(value) { return value.toFixed(2) + ' V'; }
  997.               xaxis:
  998.                 tooltip:
  999.                   enabled: false
  1000.             series:
  1001.               - entity: sensor.pace_bms_bms1_total_voltage
  1002.                 name: BMS 1
  1003.                 color: '#4CAF50'
  1004.                 float_precision: 1
  1005.                 stroke_width: 0
  1006.                 show:
  1007.                   in_chart: false
  1008.                   in_header: true
  1009.                   name_in_header: true
  1010.               - entity: sensor.pace_bms_bms1_total_voltage
  1011.                 name: BMS 1
  1012.                 color: '#4CAF50'
  1013.                 float_precision: 2
  1014.                 stroke_width: 1
  1015.                 curve: smooth
  1016.                 show:
  1017.                   in_header: false
  1018.                 group_by:
  1019.                   func: avg
  1020.                   duration: 1min
  1021.                   fill: last
  1022.               - entity: sensor.pace_bms_bms2_total_voltage
  1023.                 name: BMS 2
  1024.                 color: '#2196F3'
  1025.                 float_precision: 1
  1026.                 stroke_width: 0
  1027.                 show:
  1028.                   in_chart: false
  1029.                   in_header: true
  1030.                   name_in_header: true
  1031.               - entity: sensor.pace_bms_bms2_total_voltage
  1032.                 name: BMS 2
  1033.                 color: '#2196F3'
  1034.                 float_precision: 2
  1035.                 stroke_width: 1
  1036.                 curve: smooth
  1037.                 show:
  1038.                   in_header: false
  1039.                 group_by:
  1040.                   func: avg
  1041.                   duration: 1min
  1042.                   fill: last
  1043.               - entity: sensor.pace_bms_bms3_total_voltage
  1044.                 name: BMS 3
  1045.                 color: '#FF9800'
  1046.                 float_precision: 1
  1047.                 stroke_width: 0
  1048.                 show:
  1049.                   in_chart: false
  1050.                   in_header: true
  1051.                   name_in_header: true
  1052.               - entity: sensor.pace_bms_bms3_total_voltage
  1053.                 name: BMS 3
  1054.                 color: '#FF9800'
  1055.                 float_precision: 2
  1056.                 stroke_width: 1
  1057.                 curve: smooth
  1058.                 show:
  1059.                   in_header: false
  1060.                 group_by:
  1061.                   func: avg
  1062.                   duration: 1min
  1063.                   fill: last
  1064.               - entity: sensor.pace_bms_bms4_total_voltage
  1065.                 name: BMS 4
  1066.                 color: '#E91E63'
  1067.                 float_precision: 1
  1068.                 stroke_width: 0
  1069.                 show:
  1070.                   in_chart: false
  1071.                   in_header: true
  1072.                   name_in_header: true
  1073.               - entity: sensor.pace_bms_bms4_total_voltage
  1074.                 name: BMS 4
  1075.                 color: '#E91E63'
  1076.                 float_precision: 2
  1077.                 stroke_width: 1
  1078.                 curve: smooth
  1079.                 show:
  1080.                   in_header: false
  1081.                 group_by:
  1082.                   func: avg
  1083.                   duration: 1min
  1084.                   fill: last
  1085.               - entity: sensor.pace_bms_bms5_total_voltage
  1086.                 name: BMS 5
  1087.                 color: '#9C27B0'
  1088.                 float_precision: 1
  1089.                 stroke_width: 0
  1090.                 show:
  1091.                   in_chart: false
  1092.                   in_header: true
  1093.                   name_in_header: true
  1094.               - entity: sensor.pace_bms_bms5_total_voltage
  1095.                 name: BMS 5
  1096.                 color: '#9C27B0'
  1097.                 float_precision: 2
  1098.                 stroke_width: 1
  1099.                 curve: smooth
  1100.                 show:
  1101.                   in_header: false
  1102.                 group_by:
  1103.                   func: avg
  1104.                   duration: 1min
  1105.                   fill: last
  1106.               - entity: sensor.pace_bms_bms6_total_voltage
  1107.                 name: BMS 6
  1108.                 color: '#00BCD4'
  1109.                 float_precision: 1
  1110.                 stroke_width: 0
  1111.                 show:
  1112.                   in_chart: false
  1113.                   in_header: true
  1114.                   name_in_header: true
  1115.               - entity: sensor.pace_bms_bms6_total_voltage
  1116.                 name: BMS 6
  1117.                 color: '#00BCD4'
  1118.                 float_precision: 2
  1119.                 stroke_width: 1
  1120.                 curve: smooth
  1121.                 show:
  1122.                   in_header: false
  1123.                 group_by:
  1124.                   func: avg
  1125.                   duration: 1min
  1126.                   fill: last
  1127.       - type: grid
  1128.         cards:
  1129.           - type: custom:apexcharts-card
  1130.             header:
  1131.               show: true
  1132.               title: Celverschil
  1133.               show_states: true
  1134.               colorize_states: true
  1135.             graph_span: 24h
  1136.             apex_config:
  1137.               chart:
  1138.                 height: 260
  1139.                 toolbar:
  1140.                   show: false
  1141.               yaxis:
  1142.                 forceNiceScale: true
  1143.               legend:
  1144.                 show: false
  1145.               tooltip:
  1146.                 shared: true
  1147.                 intersect: false
  1148.                 'true':
  1149.                   formatter: function(value) { return value.toFixed(0) + ' mV'; }
  1150.               xaxis:
  1151.                 tooltip:
  1152.                   enabled: false
  1153.             series:
  1154.               - entity: sensor.pace_bms_bms1_max_cell_differential
  1155.                 name: BMS 1
  1156.                 color: '#4CAF50'
  1157.                 float_precision: 0
  1158.                 transform: return x * 1000;
  1159.                 unit: mV
  1160.                 stroke_width: 0
  1161.                 show:
  1162.                   in_chart: false
  1163.                   in_header: true
  1164.                   name_in_header: true
  1165.               - entity: sensor.pace_bms_bms1_max_cell_differential
  1166.                 name: BMS 1
  1167.                 color: '#4CAF50'
  1168.                 float_precision: 0
  1169.                 transform: return x * 1000;
  1170.                 unit: mV
  1171.                 stroke_width: 1
  1172.                 curve: smooth
  1173.                 show:
  1174.                   in_header: false
  1175.                 group_by:
  1176.                   func: avg
  1177.                   duration: 5min
  1178.                   fill: last
  1179.               - entity: sensor.pace_bms_bms2_max_cell_differential
  1180.                 name: BMS 2
  1181.                 color: '#2196F3'
  1182.                 float_precision: 0
  1183.                 transform: return x * 1000;
  1184.                 unit: mV
  1185.                 stroke_width: 0
  1186.                 show:
  1187.                   in_chart: false
  1188.                   in_header: true
  1189.                   name_in_header: true
  1190.               - entity: sensor.pace_bms_bms2_max_cell_differential
  1191.                 name: BMS 2
  1192.                 color: '#2196F3'
  1193.                 float_precision: 0
  1194.                 transform: return x * 1000;
  1195.                 unit: mV
  1196.                 stroke_width: 1
  1197.                 curve: smooth
  1198.                 show:
  1199.                   in_header: false
  1200.                 group_by:
  1201.                   func: avg
  1202.                   duration: 5min
  1203.                   fill: last
  1204.               - entity: sensor.pace_bms_bms3_max_cell_differential
  1205.                 name: BMS 3
  1206.                 color: '#FF9800'
  1207.                 float_precision: 0
  1208.                 transform: return x * 1000;
  1209.                 unit: mV
  1210.                 stroke_width: 0
  1211.                 show:
  1212.                   in_chart: false
  1213.                   in_header: true
  1214.                   name_in_header: true
  1215.               - entity: sensor.pace_bms_bms3_max_cell_differential
  1216.                 name: BMS 3
  1217.                 color: '#FF9800'
  1218.                 float_precision: 0
  1219.                 transform: return x * 1000;
  1220.                 unit: mV
  1221.                 stroke_width: 1
  1222.                 curve: smooth
  1223.                 show:
  1224.                   in_header: false
  1225.                 group_by:
  1226.                   func: avg
  1227.                   duration: 5min
  1228.                   fill: last
  1229.               - entity: sensor.pace_bms_bms4_max_cell_differential
  1230.                 name: BMS 4
  1231.                 color: '#E91E63'
  1232.                 float_precision: 0
  1233.                 transform: return x * 1000;
  1234.                 unit: mV
  1235.                 stroke_width: 0
  1236.                 show:
  1237.                   in_chart: false
  1238.                   in_header: true
  1239.                   name_in_header: true
  1240.               - entity: sensor.pace_bms_bms4_max_cell_differential
  1241.                 name: BMS 4
  1242.                 color: '#E91E63'
  1243.                 float_precision: 0
  1244.                 transform: return x * 1000;
  1245.                 unit: mV
  1246.                 stroke_width: 1
  1247.                 curve: smooth
  1248.                 show:
  1249.                   in_header: false
  1250.                 group_by:
  1251.                   func: avg
  1252.                   duration: 5min
  1253.                   fill: last
  1254.               - entity: sensor.pace_bms_bms5_max_cell_differential
  1255.                 name: BMS 5
  1256.                 color: '#9C27B0'
  1257.                 float_precision: 0
  1258.                 transform: return x * 1000;
  1259.                 unit: mV
  1260.                 stroke_width: 0
  1261.                 show:
  1262.                   in_chart: false
  1263.                   in_header: true
  1264.                   name_in_header: true
  1265.               - entity: sensor.pace_bms_bms5_max_cell_differential
  1266.                 name: BMS 5
  1267.                 color: '#9C27B0'
  1268.                 float_precision: 0
  1269.                 transform: return x * 1000;
  1270.                 unit: mV
  1271.                 stroke_width: 1
  1272.                 curve: smooth
  1273.                 show:
  1274.                   in_header: false
  1275.                 group_by:
  1276.                   func: avg
  1277.                   duration: 5min
  1278.                   fill: last
  1279.               - entity: sensor.pace_bms_bms6_max_cell_differential
  1280.                 name: BMS 6
  1281.                 color: '#00BCD4'
  1282.                 float_precision: 0
  1283.                 transform: return x * 1000;
  1284.                 unit: mV
  1285.                 stroke_width: 0
  1286.                 show:
  1287.                   in_chart: false
  1288.                   in_header: true
  1289.                   name_in_header: true
  1290.               - entity: sensor.pace_bms_bms6_max_cell_differential
  1291.                 name: BMS 6
  1292.                 color: '#00BCD4'
  1293.                 float_precision: 0
  1294.                 transform: return x * 1000;
  1295.                 unit: mV
  1296.                 stroke_width: 1
  1297.                 curve: smooth
  1298.                 show:
  1299.                   in_header: false
  1300.                 group_by:
  1301.                   func: avg
  1302.                   duration: 5min
  1303.                   fill: last
  1304.       - type: grid
  1305.         cards:
  1306.           - type: custom:apexcharts-card
  1307.             header:
  1308.               show: true
  1309.               title: Omgevingstemperatuur
  1310.               show_states: true
  1311.               colorize_states: true
  1312.             graph_span: 24h
  1313.             apex_config:
  1314.               chart:
  1315.                 height: 260
  1316.                 toolbar:
  1317.                   show: false
  1318.               yaxis:
  1319.                 forceNiceScale: true
  1320.               legend:
  1321.                 show: false
  1322.               tooltip:
  1323.                 shared: true
  1324.                 intersect: false
  1325.                 'true':
  1326.                   formatter: function(value) { return value.toFixed(1) + ' °C'; }
  1327.               xaxis:
  1328.                 tooltip:
  1329.                   enabled: false
  1330.             series:
  1331.               - entity: sensor.pace_bms_bms1_environment_temperature
  1332.                 name: BMS 1
  1333.                 color: '#4CAF50'
  1334.                 float_precision: 1
  1335.                 stroke_width: 0
  1336.                 show:
  1337.                   in_chart: false
  1338.                   in_header: true
  1339.                   name_in_header: true
  1340.               - entity: sensor.pace_bms_bms1_environment_temperature
  1341.                 name: BMS 1
  1342.                 color: '#4CAF50'
  1343.                 float_precision: 1
  1344.                 stroke_width: 1
  1345.                 curve: smooth
  1346.                 show:
  1347.                   in_header: false
  1348.                 group_by:
  1349.                   func: avg
  1350.                   duration: 5min
  1351.                   fill: last
  1352.               - entity: sensor.pace_bms_bms2_environment_temperature
  1353.                 name: BMS 2
  1354.                 color: '#2196F3'
  1355.                 float_precision: 1
  1356.                 stroke_width: 0
  1357.                 show:
  1358.                   in_chart: false
  1359.                   in_header: true
  1360.                   name_in_header: true
  1361.               - entity: sensor.pace_bms_bms2_environment_temperature
  1362.                 name: BMS 2
  1363.                 color: '#2196F3'
  1364.                 float_precision: 1
  1365.                 stroke_width: 1
  1366.                 curve: smooth
  1367.                 show:
  1368.                   in_header: false
  1369.                 group_by:
  1370.                   func: avg
  1371.                   duration: 5min
  1372.                   fill: last
  1373.               - entity: sensor.pace_bms_bms3_environment_temperature
  1374.                 name: BMS 3
  1375.                 color: '#FF9800'
  1376.                 float_precision: 1
  1377.                 stroke_width: 0
  1378.                 show:
  1379.                   in_chart: false
  1380.                   in_header: true
  1381.                   name_in_header: true
  1382.               - entity: sensor.pace_bms_bms3_environment_temperature
  1383.                 name: BMS 3
  1384.                 color: '#FF9800'
  1385.                 float_precision: 1
  1386.                 stroke_width: 1
  1387.                 curve: smooth
  1388.                 show:
  1389.                   in_header: false
  1390.                 group_by:
  1391.                   func: avg
  1392.                   duration: 5min
  1393.                   fill: last
  1394.               - entity: sensor.pace_bms_bms4_environment_temperature
  1395.                 name: BMS 4
  1396.                 color: '#E91E63'
  1397.                 float_precision: 1
  1398.                 stroke_width: 0
  1399.                 show:
  1400.                   in_chart: false
  1401.                   in_header: true
  1402.                   name_in_header: true
  1403.               - entity: sensor.pace_bms_bms4_environment_temperature
  1404.                 name: BMS 4
  1405.                 color: '#E91E63'
  1406.                 float_precision: 1
  1407.                 stroke_width: 1
  1408.                 curve: smooth
  1409.                 show:
  1410.                   in_header: false
  1411.                 group_by:
  1412.                   func: avg
  1413.                   duration: 5min
  1414.                   fill: last
  1415.               - entity: sensor.pace_bms_bms5_environment_temperature
  1416.                 name: BMS 5
  1417.                 color: '#9C27B0'
  1418.                 float_precision: 1
  1419.                 stroke_width: 0
  1420.                 show:
  1421.                   in_chart: false
  1422.                   in_header: true
  1423.                   name_in_header: true
  1424.               - entity: sensor.pace_bms_bms5_environment_temperature
  1425.                 name: BMS 5
  1426.                 color: '#9C27B0'
  1427.                 float_precision: 1
  1428.                 stroke_width: 1
  1429.                 curve: smooth
  1430.                 show:
  1431.                   in_header: false
  1432.                 group_by:
  1433.                   func: avg
  1434.                   duration: 5min
  1435.                   fill: last
  1436.               - entity: sensor.pace_bms_bms6_environment_temperature
  1437.                 name: BMS 6
  1438.                 color: '#00BCD4'
  1439.                 float_precision: 1
  1440.                 stroke_width: 0
  1441.                 show:
  1442.                   in_chart: false
  1443.                   in_header: true
  1444.                   name_in_header: true
  1445.               - entity: sensor.pace_bms_bms6_environment_temperature
  1446.                 name: BMS 6
  1447.                 color: '#00BCD4'
  1448.                 float_precision: 1
  1449.                 stroke_width: 1
  1450.                 curve: smooth
  1451.                 show:
  1452.                   in_header: false
  1453.                 group_by:
  1454.                   func: avg
  1455.                   duration: 5min
  1456.                   fill: last
  1457.       - type: grid
  1458.         column_span: 3
  1459.         cards:
  1460.           - type: heading
  1461.             heading: Alle modules naast elkaar
  1462.           - type: markdown
  1463.             content: >+
  1464.               {%- macro v(e, d=2, m=1) -%}{%- set s = states(e) -%}{%- if
  1465.               is_number(s) -%}{%- if d == 0 -%}{{ ((s|float) * m) | round(0) |
  1466.              int }}{%- else -%}{{ ((s|float) * m) | round(d) }}{%- endif -%}{%-
  1467.               else -%}–{%- endif -%}{%- endmacro -%}
  1468.  
  1469.               {%- macro tmax(b) -%}{%- set t = [1,2,3,4] | map('string') |
  1470.               map('regex_replace', '^', 'sensor.pace_bms_bms' ~ b ~
  1471.               '_temperatuur_') | map('states') | select('is_number') |
  1472.               map('float') | list -%}{{ (t | max) | round(1) if t | count > 0
  1473.               else '–' }}{%- endmacro -%}
  1474.  
  1475.               {%- macro txt(e) -%}{%- set s = states(e) -%}{{ '' if s | lower in
  1476.               ['', 'unknown', 'unavailable', 'none', 'normal', 'ok'] else s
  1477.               }}{%- endmacro -%}
  1478.  
  1479.               {%- macro alarm(b) -%}{%- set p = 'sensor.pace_bms_bms' ~ b ~ '_'
  1480.               -%}{%- set t = [txt(p ~ 'protection_status'), txt(p ~
  1481.               'fault_status')] | reject('eq', '') | join('; ') -%}{{ '[⚠️ ' ~ t
  1482.               ~ '](bms' ~ b ~ ')' if t else '✅' }}{%- endmacro -%}
  1483.  
  1484.               {%- macro warn(b) -%}{%- set t = txt('sensor.pace_bms_bms' ~ b ~
  1485.               '_warning_status') -%}{{ '[⚠️ ' ~ t ~ '](bms' ~ b ~ ')' if t else
  1486.               '–' }}{%- endmacro -%}
  1487.  
  1488.  
  1489.               | | [BMS 1](bms1) | [BMS 2](bms2) | [BMS 3](bms3) | [BMS 4](bms4)
  1490.               | [BMS 5](bms5) | [BMS 6](bms6) |
  1491.  
  1492.               |:--|--:|--:|--:|--:|--:|--:|
  1493.  
  1494.               | **SOC (%)** | {{ v('sensor.pace_bms_bms1_soc', 0, 1) }} | {{
  1495.               v('sensor.pace_bms_bms2_soc', 0, 1) }} | {{
  1496.               v('sensor.pace_bms_bms3_soc', 0, 1) }} | {{
  1497.               v('sensor.pace_bms_bms4_soc', 0, 1) }} | {{
  1498.               v('sensor.pace_bms_bms5_soc', 0, 1) }} | {{
  1499.               v('sensor.pace_bms_bms6_soc', 0, 1) }} |
  1500.  
  1501.               | **Coulomb SOC (%)** | {{ v('sensor.coulomb_bms1_soc', 1, 1) }} |
  1502.               {{ v('sensor.coulomb_bms2_soc', 1, 1) }} | {{
  1503.               v('sensor.coulomb_bms3_soc', 1, 1) }} | {{
  1504.               v('sensor.coulomb_bms4_soc', 1, 1) }} | {{
  1505.               v('sensor.coulomb_bms5_soc', 1, 1) }} | {{
  1506.               v('sensor.coulomb_bms6_soc', 1, 1) }} |
  1507.  
  1508.               | **Coulomb Δ BMS (%)** | {{ state_attr('sensor.coulomb_bms1_soc',
  1509.               'verschil') | round(1, default='–') }} | {{
  1510.               state_attr('sensor.coulomb_bms2_soc', 'verschil') | round(1,
  1511.               default='–') }} | {{ state_attr('sensor.coulomb_bms3_soc',
  1512.               'verschil') | round(1, default='–') }} | {{
  1513.               state_attr('sensor.coulomb_bms4_soc', 'verschil') | round(1,
  1514.               default='–') }} | {{ state_attr('sensor.coulomb_bms5_soc',
  1515.               'verschil') | round(1, default='–') }} | {{
  1516.               state_attr('sensor.coulomb_bms6_soc', 'verschil') | round(1,
  1517.               default='–') }} |
  1518.  
  1519.               | **Spanning (V)** | {{ v('sensor.pace_bms_bms1_total_voltage', 2,
  1520.               1) }} | {{ v('sensor.pace_bms_bms2_total_voltage', 2, 1) }} | {{
  1521.               v('sensor.pace_bms_bms3_total_voltage', 2, 1) }} | {{
  1522.               v('sensor.pace_bms_bms4_total_voltage', 2, 1) }} | {{
  1523.               v('sensor.pace_bms_bms5_total_voltage', 2, 1) }} | {{
  1524.               v('sensor.pace_bms_bms6_total_voltage', 2, 1) }} |
  1525.  
  1526.               | **Stroom (A)** | {{ v('sensor.pace_bms_bms1_current', 1, 1) }} |
  1527.               {{ v('sensor.pace_bms_bms2_current', 1, 1) }} | {{
  1528.               v('sensor.pace_bms_bms3_current', 1, 1) }} | {{
  1529.               v('sensor.pace_bms_bms4_current', 1, 1) }} | {{
  1530.               v('sensor.pace_bms_bms5_current', 1, 1) }} | {{
  1531.               v('sensor.pace_bms_bms6_current', 1, 1) }} |
  1532.  
  1533.               | **Vermogen (W)** | {{ v('sensor.pace_bms_bms1_power', 0, 1) }} |
  1534.               {{ v('sensor.pace_bms_bms2_power', 0, 1) }} | {{
  1535.               v('sensor.pace_bms_bms3_power', 0, 1) }} | {{
  1536.               v('sensor.pace_bms_bms4_power', 0, 1) }} | {{
  1537.               v('sensor.pace_bms_bms5_power', 0, 1) }} | {{
  1538.               v('sensor.pace_bms_bms6_power', 0, 1) }} |
  1539.  
  1540.               | **Capaciteit (Ah)** | {{ v('sensor.pace_bms_bms1_full_capacity',
  1541.               1, 1) }} | {{ v('sensor.pace_bms_bms2_full_capacity', 1, 1) }} |
  1542.               {{ v('sensor.pace_bms_bms3_full_capacity', 1, 1) }} | {{
  1543.               v('sensor.pace_bms_bms4_full_capacity', 1, 1) }} | {{
  1544.               v('sensor.pace_bms_bms5_full_capacity', 1, 1) }} | {{
  1545.               v('sensor.pace_bms_bms6_full_capacity', 1, 1) }} |
  1546.  
  1547.               | **Min cel (V)** | {{ v('sensor.pace_bms_bms1_min_cell_voltage',
  1548.               3, 1) }} | {{ v('sensor.pace_bms_bms2_min_cell_voltage', 3, 1) }}
  1549.               | {{ v('sensor.pace_bms_bms3_min_cell_voltage', 3, 1) }} | {{
  1550.               v('sensor.pace_bms_bms4_min_cell_voltage', 3, 1) }} | {{
  1551.               v('sensor.pace_bms_bms5_min_cell_voltage', 3, 1) }} | {{
  1552.               v('sensor.pace_bms_bms6_min_cell_voltage', 3, 1) }} |
  1553.  
  1554.               | **Max cel (V)** | {{ v('sensor.pace_bms_bms1_max_cell_voltage',
  1555.               3, 1) }} | {{ v('sensor.pace_bms_bms2_max_cell_voltage', 3, 1) }}
  1556.               | {{ v('sensor.pace_bms_bms3_max_cell_voltage', 3, 1) }} | {{
  1557.               v('sensor.pace_bms_bms4_max_cell_voltage', 3, 1) }} | {{
  1558.               v('sensor.pace_bms_bms5_max_cell_voltage', 3, 1) }} | {{
  1559.               v('sensor.pace_bms_bms6_max_cell_voltage', 3, 1) }} |
  1560.  
  1561.               | **Δ cel (mV)** | {{
  1562.               v('sensor.pace_bms_bms1_max_cell_differential', 0, 1000) }} | {{
  1563.               v('sensor.pace_bms_bms2_max_cell_differential', 0, 1000) }} | {{
  1564.               v('sensor.pace_bms_bms3_max_cell_differential', 0, 1000) }} | {{
  1565.               v('sensor.pace_bms_bms4_max_cell_differential', 0, 1000) }} | {{
  1566.               v('sensor.pace_bms_bms5_max_cell_differential', 0, 1000) }} | {{
  1567.               v('sensor.pace_bms_bms6_max_cell_differential', 0, 1000) }} |
  1568.  
  1569.               | **Omgeving (°C)** | {{
  1570.               v('sensor.pace_bms_bms1_environment_temperature', 1, 1) }} | {{
  1571.               v('sensor.pace_bms_bms2_environment_temperature', 1, 1) }} | {{
  1572.               v('sensor.pace_bms_bms3_environment_temperature', 1, 1) }} | {{
  1573.               v('sensor.pace_bms_bms4_environment_temperature', 1, 1) }} | {{
  1574.               v('sensor.pace_bms_bms5_environment_temperature', 1, 1) }} | {{
  1575.               v('sensor.pace_bms_bms6_environment_temperature', 1, 1) }} |
  1576.  
  1577.               | **Cel temp max (°C)** | {{ tmax(1) }} | {{ tmax(2) }} | {{
  1578.               tmax(3) }} | {{ tmax(4) }} | {{ tmax(5) }} | {{ tmax(6) }} |
  1579.  
  1580.               | **Balancing** | {{
  1581.               states('sensor.pace_bms_bms1_balancing_cells') |
  1582.               replace('Balancing: ', '') | replace('cellen ', '') }} | {{
  1583.               states('sensor.pace_bms_bms2_balancing_cells') |
  1584.               replace('Balancing: ', '') | replace('cellen ', '') }} | {{
  1585.               states('sensor.pace_bms_bms3_balancing_cells') |
  1586.               replace('Balancing: ', '') | replace('cellen ', '') }} | {{
  1587.               states('sensor.pace_bms_bms4_balancing_cells') |
  1588.               replace('Balancing: ', '') | replace('cellen ', '') }} | {{
  1589.               states('sensor.pace_bms_bms5_balancing_cells') |
  1590.               replace('Balancing: ', '') | replace('cellen ', '') }} | {{
  1591.               states('sensor.pace_bms_bms6_balancing_cells') |
  1592.               replace('Balancing: ', '') | replace('cellen ', '') }} |
  1593.  
  1594.               | **Waarschuwing** | {{ warn(1) }} | {{ warn(2) }} | {{ warn(3) }}
  1595.               | {{ warn(4) }} | {{ warn(5) }} | {{ warn(6) }} |
  1596.  
  1597.               | **Bescherming/fout** | {{ alarm(1) }} | {{ alarm(2) }} | {{
  1598.               alarm(3) }} | {{ alarm(4) }} | {{ alarm(5) }} | {{ alarm(6) }} |
  1599.  
  1600.               {%- set ns = namespace(m=[]) -%}
  1601.  
  1602.               {%- for b in range(1, 7) -%}
  1603.  
  1604.               {%- if alarm(b) != '✅' or warn(b) != '–' -%}{%- set ns.m = ns.m +
  1605.               ['<a href="bms' ~ b ~ '">BMS ' ~ b ~ '</a>'] -%}{%- endif -%}
  1606.  
  1607.               {%- endfor %}
  1608.  
  1609.  
  1610.               {% if ns.m | count > 0 -%}
  1611.  
  1612.               <ha-alert alert-type="warning">Actieve melding bij {{ ns.m |
  1613.               join(', ') }}. Open de module en kijk in de kaart <b>Status</b>
  1614.               voor de details.</ha-alert>
  1615.  
  1616.               {%- endif %}
  1617.  
  1618.             grid_options:
  1619.               columns: 24
  1620.             visibility:
  1621.               - condition: screen
  1622.                 media_query: '(min-width: 1280px)'
  1623.           - type: custom:apexcharts-card
  1624.             header:
  1625.               show: true
  1626.               title: Celverschil nu per module
  1627.               show_states: false
  1628.             graph_span: 1min
  1629.             span:
  1630.               end: minute
  1631.             update_interval: 30s
  1632.             yaxis:
  1633.               - min: 0
  1634.                 decimals: 0
  1635.             apex_config:
  1636.               chart:
  1637.                 height: 360
  1638.               legend:
  1639.                 show: false
  1640.               xaxis:
  1641.                 labels:
  1642.                   show: false
  1643.                 axisTicks:
  1644.                   show: false
  1645.               plotOptions:
  1646.                 bar:
  1647.                   columnWidth: 70%
  1648.               dataLabels:
  1649.                 enabled: true
  1650.               tooltip:
  1651.                 x:
  1652.                   show: true
  1653.                   formatter: >
  1654.                    EVAL:function(val) { return 'BMS ' + Math.round((val %
  1655.                     60000) / 8000); }
  1656.             series:
  1657.               - entity: sensor.pace_bms_bms1_max_cell_differential
  1658.                 name: Δ cel
  1659.                 type: column
  1660.                 color: '#FF9800'
  1661.                 float_precision: 0
  1662.                 unit: mV
  1663.                 data_generator: |
  1664.                  const t0 = start.getTime();
  1665.                   const out = [];
  1666.                   for (let b = 1; b <= 6; b++) {
  1667.                     const s = hass.states[`sensor.pace_bms_bms${b}_max_cell_differential`];
  1668.                     const v = s ? parseFloat(s.state) : NaN;
  1669.                     if (!isNaN(v)) out.push([t0 + b * 8000, v * 1000]);
  1670.                   }
  1671.                   return out;
  1672.             grid_options:
  1673.               columns: 12
  1674.             visibility:
  1675.               - condition: screen
  1676.                 media_query: '(min-width: 1280px)'
  1677.           - type: markdown
  1678.             content: >+
  1679.               {%- macro v(e, d=2, m=1) -%}{%- set s = states(e) -%}{%- if
  1680.               is_number(s) -%}{%- if d == 0 -%}{{ ((s|float) * m) | round(0) |
  1681.              int }}{%- else -%}{{ ((s|float) * m) | round(d) }}{%- endif -%}{%-
  1682.               else -%}–{%- endif -%}{%- endmacro -%}
  1683.  
  1684.               {%- macro tmax(b) -%}{%- set t = [1,2,3,4] | map('string') |
  1685.               map('regex_replace', '^', 'sensor.pace_bms_bms' ~ b ~
  1686.               '_temperatuur_') | map('states') | select('is_number') |
  1687.               map('float') | list -%}{{ (t | max) | round(1) if t | count > 0
  1688.               else '–' }}{%- endmacro -%}
  1689.  
  1690.               {%- macro txt(e) -%}{%- set s = states(e) -%}{{ '' if s | lower in
  1691.               ['', 'unknown', 'unavailable', 'none', 'normal', 'ok'] else s
  1692.               }}{%- endmacro -%}
  1693.  
  1694.               {%- macro alarm(b) -%}{%- set p = 'sensor.pace_bms_bms' ~ b ~ '_'
  1695.               -%}{%- set t = [txt(p ~ 'protection_status'), txt(p ~
  1696.               'fault_status')] | reject('eq', '') | join('; ') -%}{{ '[⚠️ ' ~ t
  1697.               ~ '](bms' ~ b ~ ')' if t else '✅' }}{%- endmacro -%}
  1698.  
  1699.               {%- macro warn(b) -%}{%- set t = txt('sensor.pace_bms_bms' ~ b ~
  1700.               '_warning_status') -%}{{ '[⚠️ ' ~ t ~ '](bms' ~ b ~ ')' if t else
  1701.               '–' }}{%- endmacro -%}
  1702.  
  1703.  
  1704.               | | [BMS 1](bms1) | [BMS 2](bms2) | [BMS 3](bms3) | [BMS 4](bms4)
  1705.               | [BMS 5](bms5) | [BMS 6](bms6) |
  1706.  
  1707.               |:--|--:|--:|--:|--:|--:|--:|
  1708.  
  1709.               | **SOC (%)** | {{ v('sensor.pace_bms_bms1_soc', 0, 1) }} | {{
  1710.               v('sensor.pace_bms_bms2_soc', 0, 1) }} | {{
  1711.               v('sensor.pace_bms_bms3_soc', 0, 1) }} | {{
  1712.               v('sensor.pace_bms_bms4_soc', 0, 1) }} | {{
  1713.               v('sensor.pace_bms_bms5_soc', 0, 1) }} | {{
  1714.               v('sensor.pace_bms_bms6_soc', 0, 1) }} |
  1715.  
  1716.               | **Coulomb SOC (%)** | {{ v('sensor.coulomb_bms1_soc', 1, 1) }} |
  1717.               {{ v('sensor.coulomb_bms2_soc', 1, 1) }} | {{
  1718.               v('sensor.coulomb_bms3_soc', 1, 1) }} | {{
  1719.               v('sensor.coulomb_bms4_soc', 1, 1) }} | {{
  1720.               v('sensor.coulomb_bms5_soc', 1, 1) }} | {{
  1721.               v('sensor.coulomb_bms6_soc', 1, 1) }} |
  1722.  
  1723.               | **Coulomb Δ BMS (%)** | {{ state_attr('sensor.coulomb_bms1_soc',
  1724.               'verschil') | round(1, default='–') }} | {{
  1725.               state_attr('sensor.coulomb_bms2_soc', 'verschil') | round(1,
  1726.               default='–') }} | {{ state_attr('sensor.coulomb_bms3_soc',
  1727.               'verschil') | round(1, default='–') }} | {{
  1728.               state_attr('sensor.coulomb_bms4_soc', 'verschil') | round(1,
  1729.               default='–') }} | {{ state_attr('sensor.coulomb_bms5_soc',
  1730.               'verschil') | round(1, default='–') }} | {{
  1731.               state_attr('sensor.coulomb_bms6_soc', 'verschil') | round(1,
  1732.               default='–') }} |
  1733.  
  1734.               | **Spanning (V)** | {{ v('sensor.pace_bms_bms1_total_voltage', 2,
  1735.               1) }} | {{ v('sensor.pace_bms_bms2_total_voltage', 2, 1) }} | {{
  1736.               v('sensor.pace_bms_bms3_total_voltage', 2, 1) }} | {{
  1737.               v('sensor.pace_bms_bms4_total_voltage', 2, 1) }} | {{
  1738.               v('sensor.pace_bms_bms5_total_voltage', 2, 1) }} | {{
  1739.               v('sensor.pace_bms_bms6_total_voltage', 2, 1) }} |
  1740.  
  1741.               | **Stroom (A)** | {{ v('sensor.pace_bms_bms1_current', 1, 1) }} |
  1742.               {{ v('sensor.pace_bms_bms2_current', 1, 1) }} | {{
  1743.               v('sensor.pace_bms_bms3_current', 1, 1) }} | {{
  1744.               v('sensor.pace_bms_bms4_current', 1, 1) }} | {{
  1745.               v('sensor.pace_bms_bms5_current', 1, 1) }} | {{
  1746.               v('sensor.pace_bms_bms6_current', 1, 1) }} |
  1747.  
  1748.               | **Vermogen (W)** | {{ v('sensor.pace_bms_bms1_power', 0, 1) }} |
  1749.               {{ v('sensor.pace_bms_bms2_power', 0, 1) }} | {{
  1750.               v('sensor.pace_bms_bms3_power', 0, 1) }} | {{
  1751.               v('sensor.pace_bms_bms4_power', 0, 1) }} | {{
  1752.               v('sensor.pace_bms_bms5_power', 0, 1) }} | {{
  1753.               v('sensor.pace_bms_bms6_power', 0, 1) }} |
  1754.  
  1755.               | **Capaciteit (Ah)** | {{ v('sensor.pace_bms_bms1_full_capacity',
  1756.               1, 1) }} | {{ v('sensor.pace_bms_bms2_full_capacity', 1, 1) }} |
  1757.               {{ v('sensor.pace_bms_bms3_full_capacity', 1, 1) }} | {{
  1758.               v('sensor.pace_bms_bms4_full_capacity', 1, 1) }} | {{
  1759.               v('sensor.pace_bms_bms5_full_capacity', 1, 1) }} | {{
  1760.               v('sensor.pace_bms_bms6_full_capacity', 1, 1) }} |
  1761.  
  1762.               | **Min cel (V)** | {{ v('sensor.pace_bms_bms1_min_cell_voltage',
  1763.               3, 1) }} | {{ v('sensor.pace_bms_bms2_min_cell_voltage', 3, 1) }}
  1764.               | {{ v('sensor.pace_bms_bms3_min_cell_voltage', 3, 1) }} | {{
  1765.               v('sensor.pace_bms_bms4_min_cell_voltage', 3, 1) }} | {{
  1766.               v('sensor.pace_bms_bms5_min_cell_voltage', 3, 1) }} | {{
  1767.               v('sensor.pace_bms_bms6_min_cell_voltage', 3, 1) }} |
  1768.  
  1769.               | **Max cel (V)** | {{ v('sensor.pace_bms_bms1_max_cell_voltage',
  1770.               3, 1) }} | {{ v('sensor.pace_bms_bms2_max_cell_voltage', 3, 1) }}
  1771.               | {{ v('sensor.pace_bms_bms3_max_cell_voltage', 3, 1) }} | {{
  1772.               v('sensor.pace_bms_bms4_max_cell_voltage', 3, 1) }} | {{
  1773.               v('sensor.pace_bms_bms5_max_cell_voltage', 3, 1) }} | {{
  1774.               v('sensor.pace_bms_bms6_max_cell_voltage', 3, 1) }} |
  1775.  
  1776.               | **Δ cel (mV)** | {{
  1777.               v('sensor.pace_bms_bms1_max_cell_differential', 0, 1000) }} | {{
  1778.               v('sensor.pace_bms_bms2_max_cell_differential', 0, 1000) }} | {{
  1779.               v('sensor.pace_bms_bms3_max_cell_differential', 0, 1000) }} | {{
  1780.               v('sensor.pace_bms_bms4_max_cell_differential', 0, 1000) }} | {{
  1781.               v('sensor.pace_bms_bms5_max_cell_differential', 0, 1000) }} | {{
  1782.               v('sensor.pace_bms_bms6_max_cell_differential', 0, 1000) }} |
  1783.  
  1784.               | **Omgeving (°C)** | {{
  1785.               v('sensor.pace_bms_bms1_environment_temperature', 1, 1) }} | {{
  1786.               v('sensor.pace_bms_bms2_environment_temperature', 1, 1) }} | {{
  1787.               v('sensor.pace_bms_bms3_environment_temperature', 1, 1) }} | {{
  1788.               v('sensor.pace_bms_bms4_environment_temperature', 1, 1) }} | {{
  1789.               v('sensor.pace_bms_bms5_environment_temperature', 1, 1) }} | {{
  1790.               v('sensor.pace_bms_bms6_environment_temperature', 1, 1) }} |
  1791.  
  1792.               | **Cel temp max (°C)** | {{ tmax(1) }} | {{ tmax(2) }} | {{
  1793.               tmax(3) }} | {{ tmax(4) }} | {{ tmax(5) }} | {{ tmax(6) }} |
  1794.  
  1795.               | **Balancing** | {{
  1796.               states('sensor.pace_bms_bms1_balancing_cells') |
  1797.               replace('Balancing: ', '') | replace('cellen ', '') }} | {{
  1798.               states('sensor.pace_bms_bms2_balancing_cells') |
  1799.               replace('Balancing: ', '') | replace('cellen ', '') }} | {{
  1800.               states('sensor.pace_bms_bms3_balancing_cells') |
  1801.               replace('Balancing: ', '') | replace('cellen ', '') }} | {{
  1802.               states('sensor.pace_bms_bms4_balancing_cells') |
  1803.               replace('Balancing: ', '') | replace('cellen ', '') }} | {{
  1804.               states('sensor.pace_bms_bms5_balancing_cells') |
  1805.               replace('Balancing: ', '') | replace('cellen ', '') }} | {{
  1806.               states('sensor.pace_bms_bms6_balancing_cells') |
  1807.               replace('Balancing: ', '') | replace('cellen ', '') }} |
  1808.  
  1809.               | **Waarschuwing** | {{ warn(1) }} | {{ warn(2) }} | {{ warn(3) }}
  1810.               | {{ warn(4) }} | {{ warn(5) }} | {{ warn(6) }} |
  1811.  
  1812.               | **Bescherming/fout** | {{ alarm(1) }} | {{ alarm(2) }} | {{
  1813.               alarm(3) }} | {{ alarm(4) }} | {{ alarm(5) }} | {{ alarm(6) }} |
  1814.  
  1815.               {%- set ns = namespace(m=[]) -%}
  1816.  
  1817.               {%- for b in range(1, 7) -%}
  1818.  
  1819.               {%- if alarm(b) != '✅' or warn(b) != '–' -%}{%- set ns.m = ns.m +
  1820.               ['<a href="bms' ~ b ~ '">BMS ' ~ b ~ '</a>'] -%}{%- endif -%}
  1821.  
  1822.               {%- endfor %}
  1823.  
  1824.  
  1825.               {% if ns.m | count > 0 -%}
  1826.  
  1827.               <ha-alert alert-type="warning">Actieve melding bij {{ ns.m |
  1828.               join(', ') }}. Open de module en kijk in de kaart <b>Status</b>
  1829.               voor de details.</ha-alert>
  1830.  
  1831.               {%- endif %}
  1832.  
  1833.             grid_options:
  1834.               columns: full
  1835.             visibility:
  1836.               - condition: screen
  1837.                 media_query: '(max-width: 1279px)'
  1838.           - type: markdown
  1839.             content: >
  1840.              <details><summary><b>Uitleg waarschuwingen en
  1841.               meldingen</b></summary>
  1842.  
  1843.  
  1844.               - **✅ / –** — de BMS meldt niets.
  1845.  
  1846.               - **⚠️ Waarschuwing** — een waarde nadert een grens (bijv. hoge
  1847.               celspanning of temperatuur). De BMS grijpt nog niet in.
  1848.  
  1849.               - **⚠️ Bescherming/fout** — de BMS heeft ingegrepen (bijv. laden
  1850.               of ontladen geblokkeerd) of meldt een hardwarefout.
  1851.  
  1852.               - De tekst achter ⚠️ komt rechtstreeks uit de BMS. Klik erop, of
  1853.               op de BMS-naam bovenaan de kolom, om de detailpagina te openen.
  1854.  
  1855.               - Op de detailpagina staat in de kaart **Status** per regel de
  1856.               tekst en de ruwe registerwaarde (hex). Daar staat ook uitleg over
  1857.               hoe je die leest.
  1858.  
  1859.  
  1860.               </details>
  1861.             grid_options:
  1862.               columns: full
  1863.   - title: BMS 1
  1864.     path: bms1
  1865.     icon: mdi:battery
  1866.     type: sections
  1867.     max_columns: 3
  1868.     dense_section_placement: false
  1869.     sections:
  1870.       - type: grid
  1871.         column_span: 3
  1872.         cards:
  1873.           - type: custom:mushroom-template-card
  1874.             primary: ACCU 1 (master) · positie 1 van boven · adres 2
  1875.             secondary: >-
  1876.               {%- set ok = ['', 'unknown', 'unavailable', 'none', 'normal',
  1877.               'ok'] -%}
  1878.  
  1879.               {%- set ns = namespace(t=[]) -%}
  1880.  
  1881.               {%- for s in [states('sensor.pace_bms_bms1_protection_status'),
  1882.               states('sensor.pace_bms_bms1_fault_status')] if s | lower not in
  1883.               ok -%}{%- set ns.t = ns.t + [s] -%}{%- endfor -%}
  1884.  
  1885.               {{ states('sensor.pace_bms_bms1_system_status') or 'Normaal' }} ·
  1886.               {{ states('sensor.pace_bms_bms1_balancing_cells') }}{{ ' · ⚠️ ' ~
  1887.               (ns.t | join('; ')) if ns.t | count > 0 else '' }}
  1888.             icon: >-
  1889.               {% set soc = states('sensor.pace_bms_bms1_soc') | float(0) %}
  1890.  
  1891.               {% if soc >= 95 %}mdi:battery{% elif soc >= 85 %}mdi:battery-90{%
  1892.               elif soc >= 75 %}mdi:battery-80{% elif soc >= 65
  1893.               %}mdi:battery-70{% elif soc >= 55 %}mdi:battery-60{% elif soc >=
  1894.               45 %}mdi:battery-50{% elif soc >= 35 %}mdi:battery-40{% elif soc
  1895.               >= 25 %}mdi:battery-30{% elif soc >= 15 %}mdi:battery-20{% elif
  1896.               soc >= 5 %}mdi:battery-10{% else %}mdi:battery-alert{% endif %}
  1897.             color: >-
  1898.               {% set soc = states('sensor.pace_bms_bms1_soc') | float(0) %}
  1899.  
  1900.               {% if soc >= 75 %}green{% elif soc >= 50 %}amber{% elif soc >= 30
  1901.               %}orange{% else %}red{% endif %}
  1902.             badge_icon: >-
  1903.               {% set ok = ['', 'unknown', 'unavailable', 'none', 'normal', 'ok']
  1904.               %}{% if states('sensor.pace_bms_bms1_protection_status') | lower
  1905.               not in ok or states('sensor.pace_bms_bms1_fault_status') | lower
  1906.               not in ok %}mdi:alert{% endif %}
  1907.             badge_color: red
  1908.             tap_action:
  1909.               action: navigate
  1910.               navigation_path: bms-overzicht
  1911.             grid_options:
  1912.               columns: full
  1913.               rows: 1
  1914.           - type: tile
  1915.             entity: sensor.pace_bms_bms1_soc
  1916.             name: SOC
  1917.           - type: tile
  1918.             entity: sensor.coulomb_bms1_soc
  1919.             name: Coulomb SOC
  1920.             icon: mdi:battery-sync
  1921.           - type: tile
  1922.             entity: sensor.pace_bms_bms1_total_voltage
  1923.             name: Spanning
  1924.           - type: tile
  1925.             entity: sensor.pace_bms_bms1_current
  1926.             name: Stroom
  1927.           - type: tile
  1928.             entity: sensor.pace_bms_bms1_power
  1929.             name: Vermogen
  1930.           - type: tile
  1931.             entity: sensor.pace_bms_bms1_max_cell_differential
  1932.             name: Celverschil
  1933.             icon: mdi:arrow-expand-vertical
  1934.           - type: tile
  1935.             entity: sensor.pace_bms_bms1_full_capacity
  1936.             name: Capaciteit
  1937.           - type: tile
  1938.             entity: script.coulomb_herijk
  1939.             name: Herijk Coulomb
  1940.             icon: mdi:battery-sync
  1941.             tap_action:
  1942.               action: perform-action
  1943.               perform_action: script.coulomb_herijk
  1944.               data:
  1945.                 module: 1
  1946.               confirmation:
  1947.                 text: Coulomb-SOC van BMS 1 gelijkzetten aan de SOC van de BMS?
  1948.       - type: grid
  1949.         column_span: 2
  1950.         cards:
  1951.           - type: custom:apexcharts-card
  1952.             header:
  1953.               show: true
  1954.               title: Celspanningen
  1955.               show_states: false
  1956.             graph_span: 1min
  1957.             span:
  1958.               end: minute
  1959.             update_interval: 30s
  1960.             yaxis:
  1961.               - min: '|-0.005|'
  1962.                 max: '|+0.005|'
  1963.                 decimals: 3
  1964.                 apex_config:
  1965.                   tickAmount: 4
  1966.             apex_config:
  1967.               chart:
  1968.                 height: 330
  1969.               legend:
  1970.                 show: false
  1971.               xaxis:
  1972.                 labels:
  1973.                   show: false
  1974.                 axisTicks:
  1975.                   show: false
  1976.               plotOptions:
  1977.                 bar:
  1978.                   columnWidth: 80%
  1979.               dataLabels:
  1980.                 enabled: false
  1981.               tooltip:
  1982.                 x:
  1983.                   show: true
  1984.                   formatter: >
  1985.                    EVAL:function(val) { return 'Cel ' + Math.round((val %
  1986.                     60000) / 3500); }
  1987.             series:
  1988.               - entity: sensor.pace_bms_bms1_cel_01_voltage
  1989.                 name: Spanning
  1990.                 type: column
  1991.                 color: '#4CAF50'
  1992.                 float_precision: 3
  1993.                 unit: V
  1994.                 data_generator: >
  1995.                  const base = entity.entity_id.replace(/_cel_\d+_voltage$/,
  1996.                   '');
  1997.  
  1998.                   const t0 = start.getTime();
  1999.  
  2000.                   const out = [];
  2001.  
  2002.                   for (let i = 1; i <= 16; i++) {
  2003.                     const s = hass.states[`${base}_cel_${String(i).padStart(2, '0')}_voltage`];
  2004.                     const v = s ? parseFloat(s.state) : NaN;
  2005.                     if (!isNaN(v)) out.push([t0 + i * 3500, v]);
  2006.                   }
  2007.  
  2008.                   return out;
  2009.             grid_options:
  2010.               columns: full
  2011.       - type: grid
  2012.         column_span: 1
  2013.         cards:
  2014.           - type: markdown
  2015.             content: >
  2016.              {%- set p = 'sensor.pace_bms_bms1_cel_' -%}
  2017.  
  2018.               {%- set ns = namespace(v=[]) -%}
  2019.  
  2020.               {%- for i in range(1, 17) -%}
  2021.  
  2022.               {%- set ns.v = ns.v + [states(p ~ ('%02d' | format(i)) ~
  2023.               '_voltage') | float(0)] -%}
  2024.  
  2025.               {%- endfor -%}
  2026.  
  2027.               {%- set bal = states('sensor.pace_bms_bms1_balancing_status_raw')
  2028.               | int(0) -%}
  2029.  
  2030.               {%- set ok = ns.v | select('>', 0) | list -%}
  2031.  
  2032.               {%- if ok | count == 16 -%}
  2033.  
  2034.               {%- set vmin = ok | min -%}{%- set vmax = ok | max -%}{%- set avg
  2035.               = (ok | sum) / 16 -%}
  2036.  
  2037.               {%- macro c(i) -%}
  2038.  
  2039.               {%- set v = ns.v[i - 1] -%}
  2040.  
  2041.               {%- set d = ((v - avg) * 1000) | round(0) | int -%}
  2042.  
  2043.               {%- set s = '%.3f' | format(v) -%}
  2044.  
  2045.               {{ i }}{{ ' ⚖️' if (bal // (2 ** (i - 1))) % 2 == 1 else '' }} |
  2046.               {% if v == vmax %}<font color="#e53935">**{{ s }}**</font>{% elif
  2047.               v == vmin %}<font color="#1e88e5">**{{ s }}**</font>{% else %}{{ s
  2048.               }}{% endif %} | {{ '%+d' | format(d) }}
  2049.  
  2050.               {%- endmacro -%}
  2051.  
  2052.               Gem. **{{ '%.3f' | format(avg) }} V** · Δ **{{ ((vmax - vmin) *
  2053.               1000) | round(0) | int }} mV**
  2054.  
  2055.  
  2056.               | Cel | V | mV | Cel | V | mV |
  2057.  
  2058.               |:--|--:|--:|:--|--:|--:|
  2059.  
  2060.               {% for i in range(1, 9) -%}
  2061.  
  2062.               | {{ c(i) }} | {{ c(i + 8) }} |
  2063.  
  2064.               {% endfor %}
  2065.  
  2066.               <font color="#e53935">■</font> hoogste · <font
  2067.               color="#1e88e5">■</font> laagste · ⚖️ balanceert · mV t.o.v. gem.
  2068.  
  2069.               {%- else -%}
  2070.  
  2071.               Celdata (nog) niet beschikbaar.
  2072.  
  2073.               {%- endif %}
  2074.             grid_options:
  2075.               columns: full
  2076.       - type: grid
  2077.         column_span: 3
  2078.         cards:
  2079.           - type: entities
  2080.             title: Temperaturen
  2081.             grid_options:
  2082.               columns: 12
  2083.             entities:
  2084.               - entity: sensor.pace_bms_bms1_temperatuur_1
  2085.                 name: Celsensor 1
  2086.               - entity: sensor.pace_bms_bms1_temperatuur_2
  2087.                 name: Celsensor 2
  2088.               - entity: sensor.pace_bms_bms1_temperatuur_3
  2089.                 name: Celsensor 3
  2090.               - entity: sensor.pace_bms_bms1_temperatuur_4
  2091.                 name: Celsensor 4
  2092.               - entity: sensor.pace_bms_bms1_environment_temperature
  2093.                 name: Omgeving
  2094.           - type: entities
  2095.             title: Cellen
  2096.             grid_options:
  2097.               columns: 12
  2098.             entities:
  2099.               - entity: sensor.pace_bms_bms1_min_cell_voltage
  2100.                 name: Laagste cel
  2101.               - entity: sensor.pace_bms_bms1_avg_cell_voltage
  2102.                 name: Gemiddeld
  2103.               - entity: sensor.pace_bms_bms1_max_cell_voltage
  2104.                 name: Hoogste cel
  2105.               - entity: sensor.pace_bms_bms1_max_cell_differential
  2106.                 name: Verschil
  2107.               - entity: sensor.pace_bms_bms1_balancing_cells
  2108.                 name: Balancing
  2109.                 icon: mdi:scale-balance
  2110.           - type: vertical-stack
  2111.             grid_options:
  2112.               columns: 12
  2113.             cards:
  2114.               - type: markdown
  2115.                 title: Status
  2116.                 content: >+
  2117.                   | | Status | Ruw |
  2118.                   |:--|:--|--:|
  2119.  
  2120.                   | **Systeem** | {{
  2121.                   states('sensor.pace_bms_bms1_system_status') if
  2122.                   states('sensor.pace_bms_bms1_system_status') not in ['',
  2123.                   'unknown', 'unavailable'] else '–' }} | {{ '0x%04X' |
  2124.                  format(states('sensor.pace_bms_bms1_system_status_raw') |
  2125.                   int(0)) }} |
  2126.  
  2127.                   | **Waarschuwing** | {{
  2128.                   states('sensor.pace_bms_bms1_warning_status') if
  2129.                   states('sensor.pace_bms_bms1_warning_status') not in ['',
  2130.                   'unknown', 'unavailable'] else '–' }} | |
  2131.  
  2132.                   | **Bescherming** | {{
  2133.                   states('sensor.pace_bms_bms1_protection_status') if
  2134.                   states('sensor.pace_bms_bms1_protection_status') not in ['',
  2135.                   'unknown', 'unavailable'] else '–' }} | {{ '0x%04X' |
  2136.                   format(states('sensor.pace_bms_bms1_protection1_raw') |
  2137.                   int(0)) }} / {{ '0x%04X' |
  2138.                   format(states('sensor.pace_bms_bms1_protection2_raw') |
  2139.                   int(0)) }} |
  2140.  
  2141.                   | **Fout** | {{ states('sensor.pace_bms_bms1_fault_status') if
  2142.                   states('sensor.pace_bms_bms1_fault_status') not in ['',
  2143.                   'unknown', 'unavailable'] else '–' }} | {{ '0x%04X' |
  2144.                   format(states('sensor.pace_bms_bms1_fault_status_raw') |
  2145.                   int(0)) }} |
  2146.  
  2147.                   | **Balancing** | {{
  2148.                   states('sensor.pace_bms_bms1_balancing_status') if
  2149.                   states('sensor.pace_bms_bms1_balancing_status') not in ['',
  2150.                   'unknown', 'unavailable'] else '–' }} | {{ '0x%04X' |
  2151.                   format(states('sensor.pace_bms_bms1_balancing_status_raw') |
  2152.                   int(0)) }} |
  2153.  
  2154.                   | **Configuratie** | {{
  2155.                   states('sensor.pace_bms_bms1_configuration_status') if
  2156.                   states('sensor.pace_bms_bms1_configuration_status') not in
  2157.                   ['', 'unknown', 'unavailable'] else '–' }} | |
  2158.  
  2159.               - type: markdown
  2160.                 content: >
  2161.                  <details><summary><b>Hoe lees ik dit?</b></summary>
  2162.  
  2163.  
  2164.                   - **Status** is wat de BMS zelf rapporteert. Een – betekent:
  2165.                   niets actief.
  2166.  
  2167.                   - **Waarschuwing**: een waarde nadert een grens. Er wordt nog
  2168.                   niet ingegrepen.
  2169.  
  2170.                   - **Bescherming**: de BMS heeft ingegrepen, bijv. laden of
  2171.                   ontladen geblokkeerd bij te hoge of te lage cel­spanning, te
  2172.                   hoge stroom of een temperatuur buiten bereik. Dit heft
  2173.                   zichzelf meestal op zodra de waarde weer normaal is.
  2174.  
  2175.                   - **Fout**: een hardwareprobleem (meting, MOSFET,
  2176.                   communicatie). Dit verdwijnt meestal niet vanzelf. Blijft het
  2177.                   staan, neem dan contact op met de installateur.
  2178.  
  2179.                   - **Ruw** is de registerwaarde als bitmask. `0x0000` = niets
  2180.                   gezet. Een waarde ongelijk aan 0 terwijl de Status-kolom leeg
  2181.                   is, is een informatief bit (bijv. "volledig geladen") en geen
  2182.                   probleem.
  2183.  
  2184.                   - Wil je terugzien wanneer iets speelde, open dan de entiteit
  2185.                   (bijv. *BMS1 Protection Status*) via **Settings → Entities**
  2186.                   en bekijk de geschiedenis.
  2187.  
  2188.  
  2189.                   </details>
  2190.       - type: grid
  2191.         column_span: 3
  2192.         cards:
  2193.           - type: custom:apexcharts-card
  2194.             header:
  2195.               show: true
  2196.               title: Min / gem. / max cel (24 u)
  2197.               show_states: true
  2198.               colorize_states: true
  2199.             graph_span: 24h
  2200.             apex_config:
  2201.               chart:
  2202.                 height: 260
  2203.                 toolbar:
  2204.                   show: false
  2205.               legend:
  2206.                 show: false
  2207.                 fontSize: 11px
  2208.               tooltip:
  2209.                 shared: true
  2210.                 intersect: false
  2211.               xaxis:
  2212.                 tooltip:
  2213.                   enabled: false
  2214.             all_series_config:
  2215.               stroke_width: 1.5
  2216.               curve: smooth
  2217.               group_by:
  2218.                 func: avg
  2219.                 duration: 5min
  2220.                 fill: last
  2221.             series:
  2222.               - entity: sensor.pace_bms_bms1_min_cell_voltage
  2223.                 name: Min
  2224.                 float_precision: 3
  2225.                 color: '#1e88e5'
  2226.               - entity: sensor.pace_bms_bms1_avg_cell_voltage
  2227.                 name: Gem.
  2228.                 float_precision: 3
  2229.                 color: '#4CAF50'
  2230.               - entity: sensor.pace_bms_bms1_max_cell_voltage
  2231.                 name: Max
  2232.                 float_precision: 3
  2233.                 color: '#e53935'
  2234.             yaxis:
  2235.               - decimals: 3
  2236.             grid_options:
  2237.               columns: 18
  2238.           - type: custom:apexcharts-card
  2239.             header:
  2240.               show: true
  2241.               title: Celverschil (24 u)
  2242.               show_states: true
  2243.               colorize_states: true
  2244.             graph_span: 24h
  2245.             apex_config:
  2246.               chart:
  2247.                 height: 260
  2248.                 toolbar:
  2249.                   show: false
  2250.               legend:
  2251.                 show: false
  2252.                 fontSize: 11px
  2253.               tooltip:
  2254.                 shared: true
  2255.                 intersect: false
  2256.               xaxis:
  2257.                 tooltip:
  2258.                   enabled: false
  2259.             all_series_config:
  2260.               stroke_width: 1.5
  2261.               curve: smooth
  2262.               group_by:
  2263.                 func: avg
  2264.                 duration: 5min
  2265.                 fill: last
  2266.             series:
  2267.               - entity: sensor.pace_bms_bms1_max_cell_differential
  2268.                 name: Δ
  2269.                 float_precision: 0
  2270.                 transform: return x * 1000;
  2271.                 unit: mV
  2272.                 color: '#4CAF50'
  2273.             yaxis:
  2274.               - min: 0
  2275.                 decimals: 0
  2276.             grid_options:
  2277.               columns: 18
  2278.           - type: custom:apexcharts-card
  2279.             header:
  2280.               show: true
  2281.               title: Alle cellen (12 u)
  2282.               show_states: false
  2283.               colorize_states: true
  2284.             graph_span: 12h
  2285.             apex_config:
  2286.               chart:
  2287.                 height: 320
  2288.                 toolbar:
  2289.                   show: false
  2290.               legend:
  2291.                 show: true
  2292.                 fontSize: 11px
  2293.               tooltip:
  2294.                 shared: true
  2295.                 intersect: false
  2296.               xaxis:
  2297.                 tooltip:
  2298.                   enabled: false
  2299.             all_series_config:
  2300.               stroke_width: 1.5
  2301.               curve: smooth
  2302.               group_by:
  2303.                 func: avg
  2304.                 duration: 5min
  2305.                 fill: last
  2306.             series:
  2307.               - entity: sensor.pace_bms_bms1_cel_01_voltage
  2308.                 name: '1'
  2309.                 float_precision: 3
  2310.               - entity: sensor.pace_bms_bms1_cel_02_voltage
  2311.                 name: '2'
  2312.                 float_precision: 3
  2313.               - entity: sensor.pace_bms_bms1_cel_03_voltage
  2314.                 name: '3'
  2315.                 float_precision: 3
  2316.               - entity: sensor.pace_bms_bms1_cel_04_voltage
  2317.                 name: '4'
  2318.                 float_precision: 3
  2319.               - entity: sensor.pace_bms_bms1_cel_05_voltage
  2320.                 name: '5'
  2321.                 float_precision: 3
  2322.               - entity: sensor.pace_bms_bms1_cel_06_voltage
  2323.                 name: '6'
  2324.                 float_precision: 3
  2325.               - entity: sensor.pace_bms_bms1_cel_07_voltage
  2326.                 name: '7'
  2327.                 float_precision: 3
  2328.               - entity: sensor.pace_bms_bms1_cel_08_voltage
  2329.                 name: '8'
  2330.                 float_precision: 3
  2331.               - entity: sensor.pace_bms_bms1_cel_09_voltage
  2332.                 name: '9'
  2333.                 float_precision: 3
  2334.               - entity: sensor.pace_bms_bms1_cel_10_voltage
  2335.                 name: '10'
  2336.                 float_precision: 3
  2337.               - entity: sensor.pace_bms_bms1_cel_11_voltage
  2338.                 name: '11'
  2339.                 float_precision: 3
  2340.               - entity: sensor.pace_bms_bms1_cel_12_voltage
  2341.                 name: '12'
  2342.                 float_precision: 3
  2343.               - entity: sensor.pace_bms_bms1_cel_13_voltage
  2344.                 name: '13'
  2345.                 float_precision: 3
  2346.               - entity: sensor.pace_bms_bms1_cel_14_voltage
  2347.                 name: '14'
  2348.                 float_precision: 3
  2349.               - entity: sensor.pace_bms_bms1_cel_15_voltage
  2350.                 name: '15'
  2351.                 float_precision: 3
  2352.               - entity: sensor.pace_bms_bms1_cel_16_voltage
  2353.                 name: '16'
  2354.                 float_precision: 3
  2355.             yaxis:
  2356.               - min: '|-0.01|'
  2357.                 max: '|+0.01|'
  2358.                 decimals: 3
  2359.             grid_options:
  2360.               columns: full
  2361.           - type: custom:apexcharts-card
  2362.             header:
  2363.               show: true
  2364.               title: Stroom & SOC (24 u)
  2365.               show_states: true
  2366.               colorize_states: true
  2367.             graph_span: 24h
  2368.             apex_config:
  2369.               chart:
  2370.                 height: 260
  2371.                 toolbar:
  2372.                   show: false
  2373.               legend:
  2374.                 show: false
  2375.                 fontSize: 11px
  2376.               tooltip:
  2377.                 shared: true
  2378.                 intersect: false
  2379.               xaxis:
  2380.                 tooltip:
  2381.                   enabled: false
  2382.             all_series_config:
  2383.               stroke_width: 1.5
  2384.               curve: smooth
  2385.               group_by:
  2386.                 func: avg
  2387.                 duration: 5min
  2388.                 fill: last
  2389.             series:
  2390.               - entity: sensor.pace_bms_bms1_current
  2391.                 name: Stroom
  2392.                 float_precision: 1
  2393.                 yaxis_id: a
  2394.                 color: '#4CAF50'
  2395.               - entity: sensor.pace_bms_bms1_soc
  2396.                 name: SOC
  2397.                 float_precision: 0
  2398.                 yaxis_id: soc
  2399.                 color: '#9e9e9e'
  2400.               - entity: sensor.coulomb_bms1_soc
  2401.                 name: Coulomb SOC
  2402.                 float_precision: 1
  2403.                 yaxis_id: soc
  2404.                 color: '#4CAF50'
  2405.             yaxis:
  2406.               - id: a
  2407.                 decimals: 1
  2408.               - id: soc
  2409.                 opposite: true
  2410.                 min: 0
  2411.                 max: 100
  2412.                 decimals: 0
  2413.             grid_options:
  2414.               columns: 18
  2415.           - type: custom:apexcharts-card
  2416.             header:
  2417.               show: true
  2418.               title: Temperaturen (24 u)
  2419.               show_states: true
  2420.               colorize_states: true
  2421.             graph_span: 24h
  2422.             apex_config:
  2423.               chart:
  2424.                 height: 260
  2425.                 toolbar:
  2426.                   show: false
  2427.               legend:
  2428.                 show: false
  2429.                 fontSize: 11px
  2430.               tooltip:
  2431.                 shared: true
  2432.                 intersect: false
  2433.               xaxis:
  2434.                 tooltip:
  2435.                   enabled: false
  2436.             all_series_config:
  2437.               stroke_width: 1.5
  2438.               curve: smooth
  2439.               group_by:
  2440.                 func: avg
  2441.                 duration: 5min
  2442.                 fill: last
  2443.             series:
  2444.               - entity: sensor.pace_bms_bms1_temperatuur_1
  2445.                 name: T1
  2446.                 float_precision: 1
  2447.                 color: '#ef5350'
  2448.               - entity: sensor.pace_bms_bms1_temperatuur_2
  2449.                 name: T2
  2450.                 float_precision: 1
  2451.                 color: '#ffa726'
  2452.               - entity: sensor.pace_bms_bms1_temperatuur_3
  2453.                 name: T3
  2454.                 float_precision: 1
  2455.                 color: '#66bb6a'
  2456.               - entity: sensor.pace_bms_bms1_temperatuur_4
  2457.                 name: T4
  2458.                 float_precision: 1
  2459.                 color: '#42a5f5'
  2460.               - entity: sensor.pace_bms_bms1_environment_temperature
  2461.                 name: Omg.
  2462.                 float_precision: 1
  2463.                 color: '#9e9e9e'
  2464.             yaxis:
  2465.               - decimals: 1
  2466.             grid_options:
  2467.               columns: 18
  2468.   - title: BMS 2
  2469.     path: bms2
  2470.     icon: mdi:battery
  2471.     type: sections
  2472.     max_columns: 3
  2473.     dense_section_placement: false
  2474.     sections:
  2475.       - type: grid
  2476.         column_span: 3
  2477.         cards:
  2478.           - type: custom:mushroom-template-card
  2479.             primary: ACCU 2 · positie 2 van boven · adres 3
  2480.             secondary: >-
  2481.               {%- set ok = ['', 'unknown', 'unavailable', 'none', 'normal',
  2482.               'ok'] -%}
  2483.  
  2484.               {%- set ns = namespace(t=[]) -%}
  2485.  
  2486.               {%- for s in [states('sensor.pace_bms_bms2_protection_status'),
  2487.               states('sensor.pace_bms_bms2_fault_status')] if s | lower not in
  2488.               ok -%}{%- set ns.t = ns.t + [s] -%}{%- endfor -%}
  2489.  
  2490.               {{ states('sensor.pace_bms_bms2_system_status') or 'Normaal' }} ·
  2491.               {{ states('sensor.pace_bms_bms2_balancing_cells') }}{{ ' · ⚠️ ' ~
  2492.               (ns.t | join('; ')) if ns.t | count > 0 else '' }}
  2493.             icon: >-
  2494.               {% set soc = states('sensor.pace_bms_bms2_soc') | float(0) %}
  2495.  
  2496.               {% if soc >= 95 %}mdi:battery{% elif soc >= 85 %}mdi:battery-90{%
  2497.               elif soc >= 75 %}mdi:battery-80{% elif soc >= 65
  2498.               %}mdi:battery-70{% elif soc >= 55 %}mdi:battery-60{% elif soc >=
  2499.               45 %}mdi:battery-50{% elif soc >= 35 %}mdi:battery-40{% elif soc
  2500.               >= 25 %}mdi:battery-30{% elif soc >= 15 %}mdi:battery-20{% elif
  2501.               soc >= 5 %}mdi:battery-10{% else %}mdi:battery-alert{% endif %}
  2502.             color: >-
  2503.               {% set soc = states('sensor.pace_bms_bms2_soc') | float(0) %}
  2504.  
  2505.               {% if soc >= 75 %}green{% elif soc >= 50 %}amber{% elif soc >= 30
  2506.               %}orange{% else %}red{% endif %}
  2507.             badge_icon: >-
  2508.               {% set ok = ['', 'unknown', 'unavailable', 'none', 'normal', 'ok']
  2509.               %}{% if states('sensor.pace_bms_bms2_protection_status') | lower
  2510.               not in ok or states('sensor.pace_bms_bms2_fault_status') | lower
  2511.               not in ok %}mdi:alert{% endif %}
  2512.             badge_color: red
  2513.             tap_action:
  2514.               action: navigate
  2515.               navigation_path: bms-overzicht
  2516.             grid_options:
  2517.               columns: full
  2518.               rows: 1
  2519.           - type: tile
  2520.             entity: sensor.pace_bms_bms2_soc
  2521.             name: SOC
  2522.           - type: tile
  2523.             entity: sensor.coulomb_bms2_soc
  2524.             name: Coulomb SOC
  2525.             icon: mdi:battery-sync
  2526.           - type: tile
  2527.             entity: sensor.pace_bms_bms2_total_voltage
  2528.             name: Spanning
  2529.           - type: tile
  2530.             entity: sensor.pace_bms_bms2_current
  2531.             name: Stroom
  2532.           - type: tile
  2533.             entity: sensor.pace_bms_bms2_power
  2534.             name: Vermogen
  2535.           - type: tile
  2536.             entity: sensor.pace_bms_bms2_max_cell_differential
  2537.             name: Celverschil
  2538.             icon: mdi:arrow-expand-vertical
  2539.           - type: tile
  2540.             entity: sensor.pace_bms_bms2_full_capacity
  2541.             name: Capaciteit
  2542.           - type: tile
  2543.             entity: script.coulomb_herijk
  2544.             name: Herijk Coulomb
  2545.             icon: mdi:battery-sync
  2546.             tap_action:
  2547.               action: perform-action
  2548.               perform_action: script.coulomb_herijk
  2549.               data:
  2550.                 module: 2
  2551.               confirmation:
  2552.                 text: Coulomb-SOC van BMS 2 gelijkzetten aan de SOC van de BMS?
  2553.       - type: grid
  2554.         column_span: 2
  2555.         cards:
  2556.           - type: custom:apexcharts-card
  2557.             header:
  2558.               show: true
  2559.               title: Celspanningen
  2560.               show_states: false
  2561.             graph_span: 1min
  2562.             span:
  2563.               end: minute
  2564.             update_interval: 30s
  2565.             yaxis:
  2566.               - min: '|-0.005|'
  2567.                 max: '|+0.005|'
  2568.                 decimals: 3
  2569.                 apex_config:
  2570.                   tickAmount: 4
  2571.             apex_config:
  2572.               chart:
  2573.                 height: 330
  2574.               legend:
  2575.                 show: false
  2576.               xaxis:
  2577.                 labels:
  2578.                   show: false
  2579.                 axisTicks:
  2580.                   show: false
  2581.               plotOptions:
  2582.                 bar:
  2583.                   columnWidth: 80%
  2584.               dataLabels:
  2585.                 enabled: false
  2586.               tooltip:
  2587.                 x:
  2588.                   show: true
  2589.                   formatter: >
  2590.                    EVAL:function(val) { return 'Cel ' + Math.round((val %
  2591.                     60000) / 3500); }
  2592.             series:
  2593.               - entity: sensor.pace_bms_bms2_cel_01_voltage
  2594.                 name: Spanning
  2595.                 type: column
  2596.                 color: '#2196F3'
  2597.                 float_precision: 3
  2598.                 unit: V
  2599.                 data_generator: >
  2600.                  const base = entity.entity_id.replace(/_cel_\d+_voltage$/,
  2601.                   '');
  2602.  
  2603.                   const t0 = start.getTime();
  2604.  
  2605.                   const out = [];
  2606.  
  2607.                   for (let i = 1; i <= 16; i++) {
  2608.                     const s = hass.states[`${base}_cel_${String(i).padStart(2, '0')}_voltage`];
  2609.                     const v = s ? parseFloat(s.state) : NaN;
  2610.                     if (!isNaN(v)) out.push([t0 + i * 3500, v]);
  2611.                   }
  2612.  
  2613.                   return out;
  2614.             grid_options:
  2615.               columns: full
  2616.       - type: grid
  2617.         column_span: 1
  2618.         cards:
  2619.           - type: markdown
  2620.             content: >
  2621.              {%- set p = 'sensor.pace_bms_bms2_cel_' -%}
  2622.  
  2623.               {%- set ns = namespace(v=[]) -%}
  2624.  
  2625.               {%- for i in range(1, 17) -%}
  2626.  
  2627.               {%- set ns.v = ns.v + [states(p ~ ('%02d' | format(i)) ~
  2628.               '_voltage') | float(0)] -%}
  2629.  
  2630.               {%- endfor -%}
  2631.  
  2632.               {%- set bal = states('sensor.pace_bms_bms2_balancing_status_raw')
  2633.               | int(0) -%}
  2634.  
  2635.               {%- set ok = ns.v | select('>', 0) | list -%}
  2636.  
  2637.               {%- if ok | count == 16 -%}
  2638.  
  2639.               {%- set vmin = ok | min -%}{%- set vmax = ok | max -%}{%- set avg
  2640.               = (ok | sum) / 16 -%}
  2641.  
  2642.               {%- macro c(i) -%}
  2643.  
  2644.               {%- set v = ns.v[i - 1] -%}
  2645.  
  2646.               {%- set d = ((v - avg) * 1000) | round(0) | int -%}
  2647.  
  2648.               {%- set s = '%.3f' | format(v) -%}
  2649.  
  2650.               {{ i }}{{ ' ⚖️' if (bal // (2 ** (i - 1))) % 2 == 1 else '' }} |
  2651.               {% if v == vmax %}<font color="#e53935">**{{ s }}**</font>{% elif
  2652.               v == vmin %}<font color="#1e88e5">**{{ s }}**</font>{% else %}{{ s
  2653.               }}{% endif %} | {{ '%+d' | format(d) }}
  2654.  
  2655.               {%- endmacro -%}
  2656.  
  2657.               Gem. **{{ '%.3f' | format(avg) }} V** · Δ **{{ ((vmax - vmin) *
  2658.               1000) | round(0) | int }} mV**
  2659.  
  2660.  
  2661.               | Cel | V | mV | Cel | V | mV |
  2662.  
  2663.               |:--|--:|--:|:--|--:|--:|
  2664.  
  2665.               {% for i in range(1, 9) -%}
  2666.  
  2667.               | {{ c(i) }} | {{ c(i + 8) }} |
  2668.  
  2669.               {% endfor %}
  2670.  
  2671.               <font color="#e53935">■</font> hoogste · <font
  2672.               color="#1e88e5">■</font> laagste · ⚖️ balanceert · mV t.o.v. gem.
  2673.  
  2674.               {%- else -%}
  2675.  
  2676.               Celdata (nog) niet beschikbaar.
  2677.  
  2678.               {%- endif %}
  2679.             grid_options:
  2680.               columns: full
  2681.       - type: grid
  2682.         column_span: 3
  2683.         cards:
  2684.           - type: entities
  2685.             title: Temperaturen
  2686.             grid_options:
  2687.               columns: 12
  2688.             entities:
  2689.               - entity: sensor.pace_bms_bms2_temperatuur_1
  2690.                 name: Celsensor 1
  2691.               - entity: sensor.pace_bms_bms2_temperatuur_2
  2692.                 name: Celsensor 2
  2693.               - entity: sensor.pace_bms_bms2_temperatuur_3
  2694.                 name: Celsensor 3
  2695.               - entity: sensor.pace_bms_bms2_temperatuur_4
  2696.                 name: Celsensor 4
  2697.               - entity: sensor.pace_bms_bms2_environment_temperature
  2698.                 name: Omgeving
  2699.           - type: entities
  2700.             title: Cellen
  2701.             grid_options:
  2702.               columns: 12
  2703.             entities:
  2704.               - entity: sensor.pace_bms_bms2_min_cell_voltage
  2705.                 name: Laagste cel
  2706.               - entity: sensor.pace_bms_bms2_avg_cell_voltage
  2707.                 name: Gemiddeld
  2708.               - entity: sensor.pace_bms_bms2_max_cell_voltage
  2709.                 name: Hoogste cel
  2710.               - entity: sensor.pace_bms_bms2_max_cell_differential
  2711.                 name: Verschil
  2712.               - entity: sensor.pace_bms_bms2_balancing_cells
  2713.                 name: Balancing
  2714.                 icon: mdi:scale-balance
  2715.           - type: vertical-stack
  2716.             grid_options:
  2717.               columns: 12
  2718.             cards:
  2719.               - type: markdown
  2720.                 title: Status
  2721.                 content: >+
  2722.                   | | Status | Ruw |
  2723.                   |:--|:--|--:|
  2724.  
  2725.                   | **Systeem** | {{
  2726.                   states('sensor.pace_bms_bms2_system_status') if
  2727.                   states('sensor.pace_bms_bms2_system_status') not in ['',
  2728.                   'unknown', 'unavailable'] else '–' }} | {{ '0x%04X' |
  2729.                  format(states('sensor.pace_bms_bms2_system_status_raw') |
  2730.                   int(0)) }} |
  2731.  
  2732.                   | **Waarschuwing** | {{
  2733.                   states('sensor.pace_bms_bms2_warning_status') if
  2734.                   states('sensor.pace_bms_bms2_warning_status') not in ['',
  2735.                   'unknown', 'unavailable'] else '–' }} | |
  2736.  
  2737.                   | **Bescherming** | {{
  2738.                   states('sensor.pace_bms_bms2_protection_status') if
  2739.                   states('sensor.pace_bms_bms2_protection_status') not in ['',
  2740.                   'unknown', 'unavailable'] else '–' }} | {{ '0x%04X' |
  2741.                   format(states('sensor.pace_bms_bms2_protection1_raw') |
  2742.                   int(0)) }} / {{ '0x%04X' |
  2743.                   format(states('sensor.pace_bms_bms2_protection2_raw') |
  2744.                   int(0)) }} |
  2745.  
  2746.                   | **Fout** | {{ states('sensor.pace_bms_bms2_fault_status') if
  2747.                   states('sensor.pace_bms_bms2_fault_status') not in ['',
  2748.                   'unknown', 'unavailable'] else '–' }} | {{ '0x%04X' |
  2749.                   format(states('sensor.pace_bms_bms2_fault_status_raw') |
  2750.                   int(0)) }} |
  2751.  
  2752.                   | **Balancing** | {{
  2753.                   states('sensor.pace_bms_bms2_balancing_status') if
  2754.                   states('sensor.pace_bms_bms2_balancing_status') not in ['',
  2755.                   'unknown', 'unavailable'] else '–' }} | {{ '0x%04X' |
  2756.                   format(states('sensor.pace_bms_bms2_balancing_status_raw') |
  2757.                   int(0)) }} |
  2758.  
  2759.                   | **Configuratie** | {{
  2760.                   states('sensor.pace_bms_bms2_configuration_status') if
  2761.                   states('sensor.pace_bms_bms2_configuration_status') not in
  2762.                   ['', 'unknown', 'unavailable'] else '–' }} | |
  2763.  
  2764.               - type: markdown
  2765.                 content: >
  2766.                  <details><summary><b>Hoe lees ik dit?</b></summary>
  2767.  
  2768.  
  2769.                   - **Status** is wat de BMS zelf rapporteert. Een – betekent:
  2770.                   niets actief.
  2771.  
  2772.                   - **Waarschuwing**: een waarde nadert een grens. Er wordt nog
  2773.                   niet ingegrepen.
  2774.  
  2775.                   - **Bescherming**: de BMS heeft ingegrepen, bijv. laden of
  2776.                   ontladen geblokkeerd bij te hoge of te lage cel­spanning, te
  2777.                   hoge stroom of een temperatuur buiten bereik. Dit heft
  2778.                   zichzelf meestal op zodra de waarde weer normaal is.
  2779.  
  2780.                   - **Fout**: een hardwareprobleem (meting, MOSFET,
  2781.                   communicatie). Dit verdwijnt meestal niet vanzelf. Blijft het
  2782.                   staan, neem dan contact op met de installateur.
  2783.  
  2784.                   - **Ruw** is de registerwaarde als bitmask. `0x0000` = niets
  2785.                   gezet. Een waarde ongelijk aan 0 terwijl de Status-kolom leeg
  2786.                   is, is een informatief bit (bijv. "volledig geladen") en geen
  2787.                   probleem.
  2788.  
  2789.                   - Wil je terugzien wanneer iets speelde, open dan de entiteit
  2790.                   (bijv. *BMS2 Protection Status*) via **Settings → Entities**
  2791.                   en bekijk de geschiedenis.
  2792.  
  2793.  
  2794.                   </details>
  2795.       - type: grid
  2796.         column_span: 3
  2797.         cards:
  2798.           - type: custom:apexcharts-card
  2799.             header:
  2800.               show: true
  2801.               title: Min / gem. / max cel (24 u)
  2802.               show_states: true
  2803.               colorize_states: true
  2804.             graph_span: 24h
  2805.             apex_config:
  2806.               chart:
  2807.                 height: 260
  2808.                 toolbar:
  2809.                   show: false
  2810.               legend:
  2811.                 show: false
  2812.                 fontSize: 11px
  2813.               tooltip:
  2814.                 shared: true
  2815.                 intersect: false
  2816.               xaxis:
  2817.                 tooltip:
  2818.                   enabled: false
  2819.             all_series_config:
  2820.               stroke_width: 1.5
  2821.               curve: smooth
  2822.               group_by:
  2823.                 func: avg
  2824.                 duration: 5min
  2825.                 fill: last
  2826.             series:
  2827.               - entity: sensor.pace_bms_bms2_min_cell_voltage
  2828.                 name: Min
  2829.                 float_precision: 3
  2830.                 color: '#1e88e5'
  2831.               - entity: sensor.pace_bms_bms2_avg_cell_voltage
  2832.                 name: Gem.
  2833.                 float_precision: 3
  2834.                 color: '#2196F3'
  2835.               - entity: sensor.pace_bms_bms2_max_cell_voltage
  2836.                 name: Max
  2837.                 float_precision: 3
  2838.                 color: '#e53935'
  2839.             yaxis:
  2840.               - decimals: 3
  2841.             grid_options:
  2842.               columns: 18
  2843.           - type: custom:apexcharts-card
  2844.             header:
  2845.               show: true
  2846.               title: Celverschil (24 u)
  2847.               show_states: true
  2848.               colorize_states: true
  2849.             graph_span: 24h
  2850.             apex_config:
  2851.               chart:
  2852.                 height: 260
  2853.                 toolbar:
  2854.                   show: false
  2855.               legend:
  2856.                 show: false
  2857.                 fontSize: 11px
  2858.               tooltip:
  2859.                 shared: true
  2860.                 intersect: false
  2861.               xaxis:
  2862.                 tooltip:
  2863.                   enabled: false
  2864.             all_series_config:
  2865.               stroke_width: 1.5
  2866.               curve: smooth
  2867.               group_by:
  2868.                 func: avg
  2869.                 duration: 5min
  2870.                 fill: last
  2871.             series:
  2872.               - entity: sensor.pace_bms_bms2_max_cell_differential
  2873.                 name: Δ
  2874.                 float_precision: 0
  2875.                 transform: return x * 1000;
  2876.                 unit: mV
  2877.                 color: '#2196F3'
  2878.             yaxis:
  2879.               - min: 0
  2880.                 decimals: 0
  2881.             grid_options:
  2882.               columns: 18
  2883.           - type: custom:apexcharts-card
  2884.             header:
  2885.               show: true
  2886.               title: Alle cellen (12 u)
  2887.               show_states: false
  2888.               colorize_states: true
  2889.             graph_span: 12h
  2890.             apex_config:
  2891.               chart:
  2892.                 height: 320
  2893.                 toolbar:
  2894.                   show: false
  2895.               legend:
  2896.                 show: true
  2897.                 fontSize: 11px
  2898.               tooltip:
  2899.                 shared: true
  2900.                 intersect: false
  2901.               xaxis:
  2902.                 tooltip:
  2903.                   enabled: false
  2904.             all_series_config:
  2905.               stroke_width: 1.5
  2906.               curve: smooth
  2907.               group_by:
  2908.                 func: avg
  2909.                 duration: 5min
  2910.                 fill: last
  2911.             series:
  2912.               - entity: sensor.pace_bms_bms2_cel_01_voltage
  2913.                 name: '1'
  2914.                 float_precision: 3
  2915.               - entity: sensor.pace_bms_bms2_cel_02_voltage
  2916.                 name: '2'
  2917.                 float_precision: 3
  2918.               - entity: sensor.pace_bms_bms2_cel_03_voltage
  2919.                 name: '3'
  2920.                 float_precision: 3
  2921.               - entity: sensor.pace_bms_bms2_cel_04_voltage
  2922.                 name: '4'
  2923.                 float_precision: 3
  2924.               - entity: sensor.pace_bms_bms2_cel_05_voltage
  2925.                 name: '5'
  2926.                 float_precision: 3
  2927.               - entity: sensor.pace_bms_bms2_cel_06_voltage
  2928.                 name: '6'
  2929.                 float_precision: 3
  2930.               - entity: sensor.pace_bms_bms2_cel_07_voltage
  2931.                 name: '7'
  2932.                 float_precision: 3
  2933.               - entity: sensor.pace_bms_bms2_cel_08_voltage
  2934.                 name: '8'
  2935.                 float_precision: 3
  2936.               - entity: sensor.pace_bms_bms2_cel_09_voltage
  2937.                 name: '9'
  2938.                 float_precision: 3
  2939.               - entity: sensor.pace_bms_bms2_cel_10_voltage
  2940.                 name: '10'
  2941.                 float_precision: 3
  2942.               - entity: sensor.pace_bms_bms2_cel_11_voltage
  2943.                 name: '11'
  2944.                 float_precision: 3
  2945.               - entity: sensor.pace_bms_bms2_cel_12_voltage
  2946.                 name: '12'
  2947.                 float_precision: 3
  2948.               - entity: sensor.pace_bms_bms2_cel_13_voltage
  2949.                 name: '13'
  2950.                 float_precision: 3
  2951.               - entity: sensor.pace_bms_bms2_cel_14_voltage
  2952.                 name: '14'
  2953.                 float_precision: 3
  2954.               - entity: sensor.pace_bms_bms2_cel_15_voltage
  2955.                 name: '15'
  2956.                 float_precision: 3
  2957.               - entity: sensor.pace_bms_bms2_cel_16_voltage
  2958.                 name: '16'
  2959.                 float_precision: 3
  2960.             yaxis:
  2961.               - min: '|-0.01|'
  2962.                 max: '|+0.01|'
  2963.                 decimals: 3
  2964.             grid_options:
  2965.               columns: full
  2966.           - type: custom:apexcharts-card
  2967.             header:
  2968.               show: true
  2969.               title: Stroom & SOC (24 u)
  2970.               show_states: true
  2971.               colorize_states: true
  2972.             graph_span: 24h
  2973.             apex_config:
  2974.               chart:
  2975.                 height: 260
  2976.                 toolbar:
  2977.                   show: false
  2978.               legend:
  2979.                 show: false
  2980.                 fontSize: 11px
  2981.               tooltip:
  2982.                 shared: true
  2983.                 intersect: false
  2984.               xaxis:
  2985.                 tooltip:
  2986.                   enabled: false
  2987.             all_series_config:
  2988.               stroke_width: 1.5
  2989.               curve: smooth
  2990.               group_by:
  2991.                 func: avg
  2992.                 duration: 5min
  2993.                 fill: last
  2994.             series:
  2995.               - entity: sensor.pace_bms_bms2_current
  2996.                 name: Stroom
  2997.                 float_precision: 1
  2998.                 yaxis_id: a
  2999.                 color: '#2196F3'
  3000.               - entity: sensor.pace_bms_bms2_soc
  3001.                 name: SOC
  3002.                 float_precision: 0
  3003.                 yaxis_id: soc
  3004.                 color: '#9e9e9e'
  3005.               - entity: sensor.coulomb_bms2_soc
  3006.                 name: Coulomb SOC
  3007.                 float_precision: 1
  3008.                 yaxis_id: soc
  3009.                 color: '#2196F3'
  3010.             yaxis:
  3011.               - id: a
  3012.                 decimals: 1
  3013.               - id: soc
  3014.                 opposite: true
  3015.                 min: 0
  3016.                 max: 100
  3017.                 decimals: 0
  3018.             grid_options:
  3019.               columns: 18
  3020.           - type: custom:apexcharts-card
  3021.             header:
  3022.               show: true
  3023.               title: Temperaturen (24 u)
  3024.               show_states: true
  3025.               colorize_states: true
  3026.             graph_span: 24h
  3027.             apex_config:
  3028.               chart:
  3029.                 height: 260
  3030.                 toolbar:
  3031.                   show: false
  3032.               legend:
  3033.                 show: false
  3034.                 fontSize: 11px
  3035.               tooltip:
  3036.                 shared: true
  3037.                 intersect: false
  3038.               xaxis:
  3039.                 tooltip:
  3040.                   enabled: false
  3041.             all_series_config:
  3042.               stroke_width: 1.5
  3043.               curve: smooth
  3044.               group_by:
  3045.                 func: avg
  3046.                 duration: 5min
  3047.                 fill: last
  3048.             series:
  3049.               - entity: sensor.pace_bms_bms2_temperatuur_1
  3050.                 name: T1
  3051.                 float_precision: 1
  3052.                 color: '#ef5350'
  3053.               - entity: sensor.pace_bms_bms2_temperatuur_2
  3054.                 name: T2
  3055.                 float_precision: 1
  3056.                 color: '#ffa726'
  3057.               - entity: sensor.pace_bms_bms2_temperatuur_3
  3058.                 name: T3
  3059.                 float_precision: 1
  3060.                 color: '#66bb6a'
  3061.               - entity: sensor.pace_bms_bms2_temperatuur_4
  3062.                 name: T4
  3063.                 float_precision: 1
  3064.                 color: '#42a5f5'
  3065.               - entity: sensor.pace_bms_bms2_environment_temperature
  3066.                 name: Omg.
  3067.                 float_precision: 1
  3068.                 color: '#9e9e9e'
  3069.             yaxis:
  3070.               - decimals: 1
  3071.             grid_options:
  3072.               columns: 18
  3073.   - title: BMS 3
  3074.     path: bms3
  3075.     icon: mdi:battery
  3076.     type: sections
  3077.     max_columns: 3
  3078.     dense_section_placement: false
  3079.     sections:
  3080.       - type: grid
  3081.         column_span: 3
  3082.         cards:
  3083.           - type: custom:mushroom-template-card
  3084.             primary: ACCU 3 · positie 3 van boven · adres 5
  3085.             secondary: >-
  3086.               {%- set ok = ['', 'unknown', 'unavailable', 'none', 'normal',
  3087.               'ok'] -%}
  3088.  
  3089.               {%- set ns = namespace(t=[]) -%}
  3090.  
  3091.               {%- for s in [states('sensor.pace_bms_bms3_protection_status'),
  3092.               states('sensor.pace_bms_bms3_fault_status')] if s | lower not in
  3093.               ok -%}{%- set ns.t = ns.t + [s] -%}{%- endfor -%}
  3094.  
  3095.               {{ states('sensor.pace_bms_bms3_system_status') or 'Normaal' }} ·
  3096.               {{ states('sensor.pace_bms_bms3_balancing_cells') }}{{ ' · ⚠️ ' ~
  3097.               (ns.t | join('; ')) if ns.t | count > 0 else '' }}
  3098.             icon: >-
  3099.               {% set soc = states('sensor.pace_bms_bms3_soc') | float(0) %}
  3100.  
  3101.               {% if soc >= 95 %}mdi:battery{% elif soc >= 85 %}mdi:battery-90{%
  3102.               elif soc >= 75 %}mdi:battery-80{% elif soc >= 65
  3103.               %}mdi:battery-70{% elif soc >= 55 %}mdi:battery-60{% elif soc >=
  3104.               45 %}mdi:battery-50{% elif soc >= 35 %}mdi:battery-40{% elif soc
  3105.               >= 25 %}mdi:battery-30{% elif soc >= 15 %}mdi:battery-20{% elif
  3106.               soc >= 5 %}mdi:battery-10{% else %}mdi:battery-alert{% endif %}
  3107.             color: >-
  3108.               {% set soc = states('sensor.pace_bms_bms3_soc') | float(0) %}
  3109.  
  3110.               {% if soc >= 75 %}green{% elif soc >= 50 %}amber{% elif soc >= 30
  3111.               %}orange{% else %}red{% endif %}
  3112.             badge_icon: >-
  3113.               {% set ok = ['', 'unknown', 'unavailable', 'none', 'normal', 'ok']
  3114.               %}{% if states('sensor.pace_bms_bms3_protection_status') | lower
  3115.               not in ok or states('sensor.pace_bms_bms3_fault_status') | lower
  3116.               not in ok %}mdi:alert{% endif %}
  3117.             badge_color: red
  3118.             tap_action:
  3119.               action: navigate
  3120.               navigation_path: bms-overzicht
  3121.             grid_options:
  3122.               columns: full
  3123.               rows: 1
  3124.           - type: tile
  3125.             entity: sensor.pace_bms_bms3_soc
  3126.             name: SOC
  3127.           - type: tile
  3128.             entity: sensor.coulomb_bms3_soc
  3129.             name: Coulomb SOC
  3130.             icon: mdi:battery-sync
  3131.           - type: tile
  3132.             entity: sensor.pace_bms_bms3_total_voltage
  3133.             name: Spanning
  3134.           - type: tile
  3135.             entity: sensor.pace_bms_bms3_current
  3136.             name: Stroom
  3137.           - type: tile
  3138.             entity: sensor.pace_bms_bms3_power
  3139.             name: Vermogen
  3140.           - type: tile
  3141.             entity: sensor.pace_bms_bms3_max_cell_differential
  3142.             name: Celverschil
  3143.             icon: mdi:arrow-expand-vertical
  3144.           - type: tile
  3145.             entity: sensor.pace_bms_bms3_full_capacity
  3146.             name: Capaciteit
  3147.           - type: tile
  3148.             entity: script.coulomb_herijk
  3149.             name: Herijk Coulomb
  3150.             icon: mdi:battery-sync
  3151.             tap_action:
  3152.               action: perform-action
  3153.               perform_action: script.coulomb_herijk
  3154.               data:
  3155.                 module: 3
  3156.               confirmation:
  3157.                 text: Coulomb-SOC van BMS 3 gelijkzetten aan de SOC van de BMS?
  3158.       - type: grid
  3159.         column_span: 2
  3160.         cards:
  3161.           - type: custom:apexcharts-card
  3162.             header:
  3163.               show: true
  3164.               title: Celspanningen
  3165.               show_states: false
  3166.             graph_span: 1min
  3167.             span:
  3168.               end: minute
  3169.             update_interval: 30s
  3170.             yaxis:
  3171.               - min: '|-0.005|'
  3172.                 max: '|+0.005|'
  3173.                 decimals: 3
  3174.                 apex_config:
  3175.                   tickAmount: 4
  3176.             apex_config:
  3177.               chart:
  3178.                 height: 330
  3179.               legend:
  3180.                 show: false
  3181.               xaxis:
  3182.                 labels:
  3183.                   show: false
  3184.                 axisTicks:
  3185.                   show: false
  3186.               plotOptions:
  3187.                 bar:
  3188.                   columnWidth: 80%
  3189.               dataLabels:
  3190.                 enabled: false
  3191.               tooltip:
  3192.                 x:
  3193.                   show: true
  3194.                   formatter: >
  3195.                    EVAL:function(val) { return 'Cel ' + Math.round((val %
  3196.                     60000) / 3500); }
  3197.             series:
  3198.               - entity: sensor.pace_bms_bms3_cel_01_voltage
  3199.                 name: Spanning
  3200.                 type: column
  3201.                 color: '#FF9800'
  3202.                 float_precision: 3
  3203.                 unit: V
  3204.                 data_generator: >
  3205.                  const base = entity.entity_id.replace(/_cel_\d+_voltage$/,
  3206.                   '');
  3207.  
  3208.                   const t0 = start.getTime();
  3209.  
  3210.                   const out = [];
  3211.  
  3212.                   for (let i = 1; i <= 16; i++) {
  3213.                     const s = hass.states[`${base}_cel_${String(i).padStart(2, '0')}_voltage`];
  3214.                     const v = s ? parseFloat(s.state) : NaN;
  3215.                     if (!isNaN(v)) out.push([t0 + i * 3500, v]);
  3216.                   }
  3217.  
  3218.                   return out;
  3219.             grid_options:
  3220.               columns: full
  3221.       - type: grid
  3222.         column_span: 1
  3223.         cards:
  3224.           - type: markdown
  3225.             content: >
  3226.              {%- set p = 'sensor.pace_bms_bms3_cel_' -%}
  3227.  
  3228.               {%- set ns = namespace(v=[]) -%}
  3229.  
  3230.               {%- for i in range(1, 17) -%}
  3231.  
  3232.               {%- set ns.v = ns.v + [states(p ~ ('%02d' | format(i)) ~
  3233.               '_voltage') | float(0)] -%}
  3234.  
  3235.               {%- endfor -%}
  3236.  
  3237.               {%- set bal = states('sensor.pace_bms_bms3_balancing_status_raw')
  3238.               | int(0) -%}
  3239.  
  3240.               {%- set ok = ns.v | select('>', 0) | list -%}
  3241.  
  3242.               {%- if ok | count == 16 -%}
  3243.  
  3244.               {%- set vmin = ok | min -%}{%- set vmax = ok | max -%}{%- set avg
  3245.               = (ok | sum) / 16 -%}
  3246.  
  3247.               {%- macro c(i) -%}
  3248.  
  3249.               {%- set v = ns.v[i - 1] -%}
  3250.  
  3251.               {%- set d = ((v - avg) * 1000) | round(0) | int -%}
  3252.  
  3253.               {%- set s = '%.3f' | format(v) -%}
  3254.  
  3255.               {{ i }}{{ ' ⚖️' if (bal // (2 ** (i - 1))) % 2 == 1 else '' }} |
  3256.               {% if v == vmax %}<font color="#e53935">**{{ s }}**</font>{% elif
  3257.               v == vmin %}<font color="#1e88e5">**{{ s }}**</font>{% else %}{{ s
  3258.               }}{% endif %} | {{ '%+d' | format(d) }}
  3259.  
  3260.               {%- endmacro -%}
  3261.  
  3262.               Gem. **{{ '%.3f' | format(avg) }} V** · Δ **{{ ((vmax - vmin) *
  3263.               1000) | round(0) | int }} mV**
  3264.  
  3265.  
  3266.               | Cel | V | mV | Cel | V | mV |
  3267.  
  3268.               |:--|--:|--:|:--|--:|--:|
  3269.  
  3270.               {% for i in range(1, 9) -%}
  3271.  
  3272.               | {{ c(i) }} | {{ c(i + 8) }} |
  3273.  
  3274.               {% endfor %}
  3275.  
  3276.               <font color="#e53935">■</font> hoogste · <font
  3277.               color="#1e88e5">■</font> laagste · ⚖️ balanceert · mV t.o.v. gem.
  3278.  
  3279.               {%- else -%}
  3280.  
  3281.               Celdata (nog) niet beschikbaar.
  3282.  
  3283.               {%- endif %}
  3284.             grid_options:
  3285.               columns: full
  3286.       - type: grid
  3287.         column_span: 3
  3288.         cards:
  3289.           - type: entities
  3290.             title: Temperaturen
  3291.             grid_options:
  3292.               columns: 12
  3293.             entities:
  3294.               - entity: sensor.pace_bms_bms3_temperatuur_1
  3295.                 name: Celsensor 1
  3296.               - entity: sensor.pace_bms_bms3_temperatuur_2
  3297.                 name: Celsensor 2
  3298.               - entity: sensor.pace_bms_bms3_temperatuur_3
  3299.                 name: Celsensor 3
  3300.               - entity: sensor.pace_bms_bms3_temperatuur_4
  3301.                 name: Celsensor 4
  3302.               - entity: sensor.pace_bms_bms3_environment_temperature
  3303.                 name: Omgeving
  3304.           - type: entities
  3305.             title: Cellen
  3306.             grid_options:
  3307.               columns: 12
  3308.             entities:
  3309.               - entity: sensor.pace_bms_bms3_min_cell_voltage
  3310.                 name: Laagste cel
  3311.               - entity: sensor.pace_bms_bms3_avg_cell_voltage
  3312.                 name: Gemiddeld
  3313.               - entity: sensor.pace_bms_bms3_max_cell_voltage
  3314.                 name: Hoogste cel
  3315.               - entity: sensor.pace_bms_bms3_max_cell_differential
  3316.                 name: Verschil
  3317.               - entity: sensor.pace_bms_bms3_balancing_cells
  3318.                 name: Balancing
  3319.                 icon: mdi:scale-balance
  3320.           - type: vertical-stack
  3321.             grid_options:
  3322.               columns: 12
  3323.             cards:
  3324.               - type: markdown
  3325.                 title: Status
  3326.                 content: >+
  3327.                   | | Status | Ruw |
  3328.                   |:--|:--|--:|
  3329.  
  3330.                   | **Systeem** | {{
  3331.                   states('sensor.pace_bms_bms3_system_status') if
  3332.                   states('sensor.pace_bms_bms3_system_status') not in ['',
  3333.                   'unknown', 'unavailable'] else '–' }} | {{ '0x%04X' |
  3334.                  format(states('sensor.pace_bms_bms3_system_status_raw') |
  3335.                   int(0)) }} |
  3336.  
  3337.                   | **Waarschuwing** | {{
  3338.                   states('sensor.pace_bms_bms3_warning_status') if
  3339.                   states('sensor.pace_bms_bms3_warning_status') not in ['',
  3340.                   'unknown', 'unavailable'] else '–' }} | |
  3341.  
  3342.                   | **Bescherming** | {{
  3343.                   states('sensor.pace_bms_bms3_protection_status') if
  3344.                   states('sensor.pace_bms_bms3_protection_status') not in ['',
  3345.                   'unknown', 'unavailable'] else '–' }} | {{ '0x%04X' |
  3346.                   format(states('sensor.pace_bms_bms3_protection1_raw') |
  3347.                   int(0)) }} / {{ '0x%04X' |
  3348.                   format(states('sensor.pace_bms_bms3_protection2_raw') |
  3349.                   int(0)) }} |
  3350.  
  3351.                   | **Fout** | {{ states('sensor.pace_bms_bms3_fault_status') if
  3352.                   states('sensor.pace_bms_bms3_fault_status') not in ['',
  3353.                   'unknown', 'unavailable'] else '–' }} | {{ '0x%04X' |
  3354.                   format(states('sensor.pace_bms_bms3_fault_status_raw') |
  3355.                   int(0)) }} |
  3356.  
  3357.                   | **Balancing** | {{
  3358.                   states('sensor.pace_bms_bms3_balancing_status') if
  3359.                   states('sensor.pace_bms_bms3_balancing_status') not in ['',
  3360.                   'unknown', 'unavailable'] else '–' }} | {{ '0x%04X' |
  3361.                   format(states('sensor.pace_bms_bms3_balancing_status_raw') |
  3362.                   int(0)) }} |
  3363.  
  3364.                   | **Configuratie** | {{
  3365.                   states('sensor.pace_bms_bms3_configuration_status') if
  3366.                   states('sensor.pace_bms_bms3_configuration_status') not in
  3367.                   ['', 'unknown', 'unavailable'] else '–' }} | |
  3368.  
  3369.               - type: markdown
  3370.                 content: >
  3371.                  <details><summary><b>Hoe lees ik dit?</b></summary>
  3372.  
  3373.  
  3374.                   - **Status** is wat de BMS zelf rapporteert. Een – betekent:
  3375.                   niets actief.
  3376.  
  3377.                   - **Waarschuwing**: een waarde nadert een grens. Er wordt nog
  3378.                   niet ingegrepen.
  3379.  
  3380.                   - **Bescherming**: de BMS heeft ingegrepen, bijv. laden of
  3381.                   ontladen geblokkeerd bij te hoge of te lage cel­spanning, te
  3382.                   hoge stroom of een temperatuur buiten bereik. Dit heft
  3383.                   zichzelf meestal op zodra de waarde weer normaal is.
  3384.  
  3385.                   - **Fout**: een hardwareprobleem (meting, MOSFET,
  3386.                   communicatie). Dit verdwijnt meestal niet vanzelf. Blijft het
  3387.                   staan, neem dan contact op met de installateur.
  3388.  
  3389.                   - **Ruw** is de registerwaarde als bitmask. `0x0000` = niets
  3390.                   gezet. Een waarde ongelijk aan 0 terwijl de Status-kolom leeg
  3391.                   is, is een informatief bit (bijv. "volledig geladen") en geen
  3392.                   probleem.
  3393.  
  3394.                   - Wil je terugzien wanneer iets speelde, open dan de entiteit
  3395.                   (bijv. *BMS3 Protection Status*) via **Settings → Entities**
  3396.                   en bekijk de geschiedenis.
  3397.  
  3398.  
  3399.                   </details>
  3400.       - type: grid
  3401.         column_span: 3
  3402.         cards:
  3403.           - type: custom:apexcharts-card
  3404.             header:
  3405.               show: true
  3406.               title: Min / gem. / max cel (24 u)
  3407.               show_states: true
  3408.               colorize_states: true
  3409.             graph_span: 24h
  3410.             apex_config:
  3411.               chart:
  3412.                 height: 260
  3413.                 toolbar:
  3414.                   show: false
  3415.               legend:
  3416.                 show: false
  3417.                 fontSize: 11px
  3418.               tooltip:
  3419.                 shared: true
  3420.                 intersect: false
  3421.               xaxis:
  3422.                 tooltip:
  3423.                   enabled: false
  3424.             all_series_config:
  3425.               stroke_width: 1.5
  3426.               curve: smooth
  3427.               group_by:
  3428.                 func: avg
  3429.                 duration: 5min
  3430.                 fill: last
  3431.             series:
  3432.               - entity: sensor.pace_bms_bms3_min_cell_voltage
  3433.                 name: Min
  3434.                 float_precision: 3
  3435.                 color: '#1e88e5'
  3436.               - entity: sensor.pace_bms_bms3_avg_cell_voltage
  3437.                 name: Gem.
  3438.                 float_precision: 3
  3439.                 color: '#FF9800'
  3440.               - entity: sensor.pace_bms_bms3_max_cell_voltage
  3441.                 name: Max
  3442.                 float_precision: 3
  3443.                 color: '#e53935'
  3444.             yaxis:
  3445.               - decimals: 3
  3446.             grid_options:
  3447.               columns: 18
  3448.           - type: custom:apexcharts-card
  3449.             header:
  3450.               show: true
  3451.               title: Celverschil (24 u)
  3452.               show_states: true
  3453.               colorize_states: true
  3454.             graph_span: 24h
  3455.             apex_config:
  3456.               chart:
  3457.                 height: 260
  3458.                 toolbar:
  3459.                   show: false
  3460.               legend:
  3461.                 show: false
  3462.                 fontSize: 11px
  3463.               tooltip:
  3464.                 shared: true
  3465.                 intersect: false
  3466.               xaxis:
  3467.                 tooltip:
  3468.                   enabled: false
  3469.             all_series_config:
  3470.               stroke_width: 1.5
  3471.               curve: smooth
  3472.               group_by:
  3473.                 func: avg
  3474.                 duration: 5min
  3475.                 fill: last
  3476.             series:
  3477.               - entity: sensor.pace_bms_bms3_max_cell_differential
  3478.                 name: Δ
  3479.                 float_precision: 0
  3480.                 transform: return x * 1000;
  3481.                 unit: mV
  3482.                 color: '#FF9800'
  3483.             yaxis:
  3484.               - min: 0
  3485.                 decimals: 0
  3486.             grid_options:
  3487.               columns: 18
  3488.           - type: custom:apexcharts-card
  3489.             header:
  3490.               show: true
  3491.               title: Alle cellen (12 u)
  3492.               show_states: false
  3493.               colorize_states: true
  3494.             graph_span: 12h
  3495.             apex_config:
  3496.               chart:
  3497.                 height: 320
  3498.                 toolbar:
  3499.                   show: false
  3500.               legend:
  3501.                 show: true
  3502.                 fontSize: 11px
  3503.               tooltip:
  3504.                 shared: true
  3505.                 intersect: false
  3506.               xaxis:
  3507.                 tooltip:
  3508.                   enabled: false
  3509.             all_series_config:
  3510.               stroke_width: 1.5
  3511.               curve: smooth
  3512.               group_by:
  3513.                 func: avg
  3514.                 duration: 5min
  3515.                 fill: last
  3516.             series:
  3517.               - entity: sensor.pace_bms_bms3_cel_01_voltage
  3518.                 name: '1'
  3519.                 float_precision: 3
  3520.               - entity: sensor.pace_bms_bms3_cel_02_voltage
  3521.                 name: '2'
  3522.                 float_precision: 3
  3523.               - entity: sensor.pace_bms_bms3_cel_03_voltage
  3524.                 name: '3'
  3525.                 float_precision: 3
  3526.               - entity: sensor.pace_bms_bms3_cel_04_voltage
  3527.                 name: '4'
  3528.                 float_precision: 3
  3529.               - entity: sensor.pace_bms_bms3_cel_05_voltage
  3530.                 name: '5'
  3531.                 float_precision: 3
  3532.               - entity: sensor.pace_bms_bms3_cel_06_voltage
  3533.                 name: '6'
  3534.                 float_precision: 3
  3535.               - entity: sensor.pace_bms_bms3_cel_07_voltage
  3536.                 name: '7'
  3537.                 float_precision: 3
  3538.               - entity: sensor.pace_bms_bms3_cel_08_voltage
  3539.                 name: '8'
  3540.                 float_precision: 3
  3541.               - entity: sensor.pace_bms_bms3_cel_09_voltage
  3542.                 name: '9'
  3543.                 float_precision: 3
  3544.               - entity: sensor.pace_bms_bms3_cel_10_voltage
  3545.                 name: '10'
  3546.                 float_precision: 3
  3547.               - entity: sensor.pace_bms_bms3_cel_11_voltage
  3548.                 name: '11'
  3549.                 float_precision: 3
  3550.               - entity: sensor.pace_bms_bms3_cel_12_voltage
  3551.                 name: '12'
  3552.                 float_precision: 3
  3553.               - entity: sensor.pace_bms_bms3_cel_13_voltage
  3554.                 name: '13'
  3555.                 float_precision: 3
  3556.               - entity: sensor.pace_bms_bms3_cel_14_voltage
  3557.                 name: '14'
  3558.                 float_precision: 3
  3559.               - entity: sensor.pace_bms_bms3_cel_15_voltage
  3560.                 name: '15'
  3561.                 float_precision: 3
  3562.               - entity: sensor.pace_bms_bms3_cel_16_voltage
  3563.                 name: '16'
  3564.                 float_precision: 3
  3565.             yaxis:
  3566.               - min: '|-0.01|'
  3567.                 max: '|+0.01|'
  3568.                 decimals: 3
  3569.             grid_options:
  3570.               columns: full
  3571.           - type: custom:apexcharts-card
  3572.             header:
  3573.               show: true
  3574.               title: Stroom & SOC (24 u)
  3575.               show_states: true
  3576.               colorize_states: true
  3577.             graph_span: 24h
  3578.             apex_config:
  3579.               chart:
  3580.                 height: 260
  3581.                 toolbar:
  3582.                   show: false
  3583.               legend:
  3584.                 show: false
  3585.                 fontSize: 11px
  3586.               tooltip:
  3587.                 shared: true
  3588.                 intersect: false
  3589.               xaxis:
  3590.                 tooltip:
  3591.                   enabled: false
  3592.             all_series_config:
  3593.               stroke_width: 1.5
  3594.               curve: smooth
  3595.               group_by:
  3596.                 func: avg
  3597.                 duration: 5min
  3598.                 fill: last
  3599.             series:
  3600.               - entity: sensor.pace_bms_bms3_current
  3601.                 name: Stroom
  3602.                 float_precision: 1
  3603.                 yaxis_id: a
  3604.                 color: '#FF9800'
  3605.               - entity: sensor.pace_bms_bms3_soc
  3606.                 name: SOC
  3607.                 float_precision: 0
  3608.                 yaxis_id: soc
  3609.                 color: '#9e9e9e'
  3610.               - entity: sensor.coulomb_bms3_soc
  3611.                 name: Coulomb SOC
  3612.                 float_precision: 1
  3613.                 yaxis_id: soc
  3614.                 color: '#FF9800'
  3615.             yaxis:
  3616.               - id: a
  3617.                 decimals: 1
  3618.               - id: soc
  3619.                 opposite: true
  3620.                 min: 0
  3621.                 max: 100
  3622.                 decimals: 0
  3623.             grid_options:
  3624.               columns: 18
  3625.           - type: custom:apexcharts-card
  3626.             header:
  3627.               show: true
  3628.               title: Temperaturen (24 u)
  3629.               show_states: true
  3630.               colorize_states: true
  3631.             graph_span: 24h
  3632.             apex_config:
  3633.               chart:
  3634.                 height: 260
  3635.                 toolbar:
  3636.                   show: false
  3637.               legend:
  3638.                 show: false
  3639.                 fontSize: 11px
  3640.               tooltip:
  3641.                 shared: true
  3642.                 intersect: false
  3643.               xaxis:
  3644.                 tooltip:
  3645.                   enabled: false
  3646.             all_series_config:
  3647.               stroke_width: 1.5
  3648.               curve: smooth
  3649.               group_by:
  3650.                 func: avg
  3651.                 duration: 5min
  3652.                 fill: last
  3653.             series:
  3654.               - entity: sensor.pace_bms_bms3_temperatuur_1
  3655.                 name: T1
  3656.                 float_precision: 1
  3657.                 color: '#ef5350'
  3658.               - entity: sensor.pace_bms_bms3_temperatuur_2
  3659.                 name: T2
  3660.                 float_precision: 1
  3661.                 color: '#ffa726'
  3662.               - entity: sensor.pace_bms_bms3_temperatuur_3
  3663.                 name: T3
  3664.                 float_precision: 1
  3665.                 color: '#66bb6a'
  3666.               - entity: sensor.pace_bms_bms3_temperatuur_4
  3667.                 name: T4
  3668.                 float_precision: 1
  3669.                 color: '#42a5f5'
  3670.               - entity: sensor.pace_bms_bms3_environment_temperature
  3671.                 name: Omg.
  3672.                 float_precision: 1
  3673.                 color: '#9e9e9e'
  3674.             yaxis:
  3675.               - decimals: 1
  3676.             grid_options:
  3677.               columns: 18
  3678.   - title: BMS 4
  3679.     path: bms4
  3680.     icon: mdi:battery
  3681.     type: sections
  3682.     max_columns: 3
  3683.     dense_section_placement: false
  3684.     sections:
  3685.       - type: grid
  3686.         column_span: 3
  3687.         cards:
  3688.           - type: custom:mushroom-template-card
  3689.             primary: ACCU 4 · positie 4 van boven · adres 9
  3690.             secondary: >-
  3691.               {%- set ok = ['', 'unknown', 'unavailable', 'none', 'normal',
  3692.               'ok'] -%}
  3693.  
  3694.               {%- set ns = namespace(t=[]) -%}
  3695.  
  3696.               {%- for s in [states('sensor.pace_bms_bms4_protection_status'),
  3697.               states('sensor.pace_bms_bms4_fault_status')] if s | lower not in
  3698.               ok -%}{%- set ns.t = ns.t + [s] -%}{%- endfor -%}
  3699.  
  3700.               {{ states('sensor.pace_bms_bms4_system_status') or 'Normaal' }} ·
  3701.               {{ states('sensor.pace_bms_bms4_balancing_cells') }}{{ ' · ⚠️ ' ~
  3702.               (ns.t | join('; ')) if ns.t | count > 0 else '' }}
  3703.             icon: >-
  3704.               {% set soc = states('sensor.pace_bms_bms4_soc') | float(0) %}
  3705.  
  3706.               {% if soc >= 95 %}mdi:battery{% elif soc >= 85 %}mdi:battery-90{%
  3707.               elif soc >= 75 %}mdi:battery-80{% elif soc >= 65
  3708.               %}mdi:battery-70{% elif soc >= 55 %}mdi:battery-60{% elif soc >=
  3709.               45 %}mdi:battery-50{% elif soc >= 35 %}mdi:battery-40{% elif soc
  3710.               >= 25 %}mdi:battery-30{% elif soc >= 15 %}mdi:battery-20{% elif
  3711.               soc >= 5 %}mdi:battery-10{% else %}mdi:battery-alert{% endif %}
  3712.             color: >-
  3713.               {% set soc = states('sensor.pace_bms_bms4_soc') | float(0) %}
  3714.  
  3715.               {% if soc >= 75 %}green{% elif soc >= 50 %}amber{% elif soc >= 30
  3716.               %}orange{% else %}red{% endif %}
  3717.             badge_icon: >-
  3718.               {% set ok = ['', 'unknown', 'unavailable', 'none', 'normal', 'ok']
  3719.               %}{% if states('sensor.pace_bms_bms4_protection_status') | lower
  3720.               not in ok or states('sensor.pace_bms_bms4_fault_status') | lower
  3721.               not in ok %}mdi:alert{% endif %}
  3722.             badge_color: red
  3723.             tap_action:
  3724.               action: navigate
  3725.               navigation_path: bms-overzicht
  3726.             grid_options:
  3727.               columns: full
  3728.               rows: 1
  3729.           - type: tile
  3730.             entity: sensor.pace_bms_bms4_soc
  3731.             name: SOC
  3732.           - type: tile
  3733.             entity: sensor.coulomb_bms4_soc
  3734.             name: Coulomb SOC
  3735.             icon: mdi:battery-sync
  3736.           - type: tile
  3737.             entity: sensor.pace_bms_bms4_total_voltage
  3738.             name: Spanning
  3739.           - type: tile
  3740.             entity: sensor.pace_bms_bms4_current
  3741.             name: Stroom
  3742.           - type: tile
  3743.             entity: sensor.pace_bms_bms4_power
  3744.             name: Vermogen
  3745.           - type: tile
  3746.             entity: sensor.pace_bms_bms4_max_cell_differential
  3747.             name: Celverschil
  3748.             icon: mdi:arrow-expand-vertical
  3749.           - type: tile
  3750.             entity: sensor.pace_bms_bms4_full_capacity
  3751.             name: Capaciteit
  3752.           - type: tile
  3753.             entity: script.coulomb_herijk
  3754.             name: Herijk Coulomb
  3755.             icon: mdi:battery-sync
  3756.             tap_action:
  3757.               action: perform-action
  3758.               perform_action: script.coulomb_herijk
  3759.               data:
  3760.                 module: 4
  3761.               confirmation:
  3762.                 text: Coulomb-SOC van BMS 4 gelijkzetten aan de SOC van de BMS?
  3763.       - type: grid
  3764.         column_span: 2
  3765.         cards:
  3766.           - type: custom:apexcharts-card
  3767.             header:
  3768.               show: true
  3769.               title: Celspanningen
  3770.               show_states: false
  3771.             graph_span: 1min
  3772.             span:
  3773.               end: minute
  3774.             update_interval: 30s
  3775.             yaxis:
  3776.               - min: '|-0.005|'
  3777.                 max: '|+0.005|'
  3778.                 decimals: 3
  3779.                 apex_config:
  3780.                   tickAmount: 4
  3781.             apex_config:
  3782.               chart:
  3783.                 height: 330
  3784.               legend:
  3785.                 show: false
  3786.               xaxis:
  3787.                 labels:
  3788.                   show: false
  3789.                 axisTicks:
  3790.                   show: false
  3791.               plotOptions:
  3792.                 bar:
  3793.                   columnWidth: 80%
  3794.               dataLabels:
  3795.                 enabled: false
  3796.               tooltip:
  3797.                 x:
  3798.                   show: true
  3799.                   formatter: >
  3800.                    EVAL:function(val) { return 'Cel ' + Math.round((val %
  3801.                     60000) / 3500); }
  3802.             series:
  3803.               - entity: sensor.pace_bms_bms4_cel_01_voltage
  3804.                 name: Spanning
  3805.                 type: column
  3806.                 color: '#E91E63'
  3807.                 float_precision: 3
  3808.                 unit: V
  3809.                 data_generator: >
  3810.                  const base = entity.entity_id.replace(/_cel_\d+_voltage$/,
  3811.                   '');
  3812.  
  3813.                   const t0 = start.getTime();
  3814.  
  3815.                   const out = [];
  3816.  
  3817.                   for (let i = 1; i <= 16; i++) {
  3818.                     const s = hass.states[`${base}_cel_${String(i).padStart(2, '0')}_voltage`];
  3819.                     const v = s ? parseFloat(s.state) : NaN;
  3820.                     if (!isNaN(v)) out.push([t0 + i * 3500, v]);
  3821.                   }
  3822.  
  3823.                   return out;
  3824.             grid_options:
  3825.               columns: full
  3826.       - type: grid
  3827.         column_span: 1
  3828.         cards:
  3829.           - type: markdown
  3830.             content: >
  3831.              {%- set p = 'sensor.pace_bms_bms4_cel_' -%}
  3832.  
  3833.               {%- set ns = namespace(v=[]) -%}
  3834.  
  3835.               {%- for i in range(1, 17) -%}
  3836.  
  3837.               {%- set ns.v = ns.v + [states(p ~ ('%02d' | format(i)) ~
  3838.               '_voltage') | float(0)] -%}
  3839.  
  3840.               {%- endfor -%}
  3841.  
  3842.               {%- set bal = states('sensor.pace_bms_bms4_balancing_status_raw')
  3843.               | int(0) -%}
  3844.  
  3845.               {%- set ok = ns.v | select('>', 0) | list -%}
  3846.  
  3847.               {%- if ok | count == 16 -%}
  3848.  
  3849.               {%- set vmin = ok | min -%}{%- set vmax = ok | max -%}{%- set avg
  3850.               = (ok | sum) / 16 -%}
  3851.  
  3852.               {%- macro c(i) -%}
  3853.  
  3854.               {%- set v = ns.v[i - 1] -%}
  3855.  
  3856.               {%- set d = ((v - avg) * 1000) | round(0) | int -%}
  3857.  
  3858.               {%- set s = '%.3f' | format(v) -%}
  3859.  
  3860.               {{ i }}{{ ' ⚖️' if (bal // (2 ** (i - 1))) % 2 == 1 else '' }} |
  3861.               {% if v == vmax %}<font color="#e53935">**{{ s }}**</font>{% elif
  3862.               v == vmin %}<font color="#1e88e5">**{{ s }}**</font>{% else %}{{ s
  3863.               }}{% endif %} | {{ '%+d' | format(d) }}
  3864.  
  3865.               {%- endmacro -%}
  3866.  
  3867.               Gem. **{{ '%.3f' | format(avg) }} V** · Δ **{{ ((vmax - vmin) *
  3868.               1000) | round(0) | int }} mV**
  3869.  
  3870.  
  3871.               | Cel | V | mV | Cel | V | mV |
  3872.  
  3873.               |:--|--:|--:|:--|--:|--:|
  3874.  
  3875.               {% for i in range(1, 9) -%}
  3876.  
  3877.               | {{ c(i) }} | {{ c(i + 8) }} |
  3878.  
  3879.               {% endfor %}
  3880.  
  3881.               <font color="#e53935">■</font> hoogste · <font
  3882.               color="#1e88e5">■</font> laagste · ⚖️ balanceert · mV t.o.v. gem.
  3883.  
  3884.               {%- else -%}
  3885.  
  3886.               Celdata (nog) niet beschikbaar.
  3887.  
  3888.               {%- endif %}
  3889.             grid_options:
  3890.               columns: full
  3891.       - type: grid
  3892.         column_span: 3
  3893.         cards:
  3894.           - type: entities
  3895.             title: Temperaturen
  3896.             grid_options:
  3897.               columns: 12
  3898.             entities:
  3899.               - entity: sensor.pace_bms_bms4_temperatuur_1
  3900.                 name: Celsensor 1
  3901.               - entity: sensor.pace_bms_bms4_temperatuur_2
  3902.                 name: Celsensor 2
  3903.               - entity: sensor.pace_bms_bms4_temperatuur_3
  3904.                 name: Celsensor 3
  3905.               - entity: sensor.pace_bms_bms4_temperatuur_4
  3906.                 name: Celsensor 4
  3907.               - entity: sensor.pace_bms_bms4_environment_temperature
  3908.                 name: Omgeving
  3909.           - type: entities
  3910.             title: Cellen
  3911.             grid_options:
  3912.               columns: 12
  3913.             entities:
  3914.               - entity: sensor.pace_bms_bms4_min_cell_voltage
  3915.                 name: Laagste cel
  3916.               - entity: sensor.pace_bms_bms4_avg_cell_voltage
  3917.                 name: Gemiddeld
  3918.               - entity: sensor.pace_bms_bms4_max_cell_voltage
  3919.                 name: Hoogste cel
  3920.               - entity: sensor.pace_bms_bms4_max_cell_differential
  3921.                 name: Verschil
  3922.               - entity: sensor.pace_bms_bms4_balancing_cells
  3923.                 name: Balancing
  3924.                 icon: mdi:scale-balance
  3925.           - type: vertical-stack
  3926.             grid_options:
  3927.               columns: 12
  3928.             cards:
  3929.               - type: markdown
  3930.                 title: Status
  3931.                 content: >+
  3932.                   | | Status | Ruw |
  3933.                   |:--|:--|--:|
  3934.  
  3935.                   | **Systeem** | {{
  3936.                   states('sensor.pace_bms_bms4_system_status') if
  3937.                   states('sensor.pace_bms_bms4_system_status') not in ['',
  3938.                   'unknown', 'unavailable'] else '–' }} | {{ '0x%04X' |
  3939.                  format(states('sensor.pace_bms_bms4_system_status_raw') |
  3940.                   int(0)) }} |
  3941.  
  3942.                   | **Waarschuwing** | {{
  3943.                   states('sensor.pace_bms_bms4_warning_status') if
  3944.                   states('sensor.pace_bms_bms4_warning_status') not in ['',
  3945.                   'unknown', 'unavailable'] else '–' }} | |
  3946.  
  3947.                   | **Bescherming** | {{
  3948.                   states('sensor.pace_bms_bms4_protection_status') if
  3949.                   states('sensor.pace_bms_bms4_protection_status') not in ['',
  3950.                   'unknown', 'unavailable'] else '–' }} | {{ '0x%04X' |
  3951.                   format(states('sensor.pace_bms_bms4_protection1_raw') |
  3952.                   int(0)) }} / {{ '0x%04X' |
  3953.                   format(states('sensor.pace_bms_bms4_protection2_raw') |
  3954.                   int(0)) }} |
  3955.  
  3956.                   | **Fout** | {{ states('sensor.pace_bms_bms4_fault_status') if
  3957.                   states('sensor.pace_bms_bms4_fault_status') not in ['',
  3958.                   'unknown', 'unavailable'] else '–' }} | {{ '0x%04X' |
  3959.                   format(states('sensor.pace_bms_bms4_fault_status_raw') |
  3960.                   int(0)) }} |
  3961.  
  3962.                   | **Balancing** | {{
  3963.                   states('sensor.pace_bms_bms4_balancing_status') if
  3964.                   states('sensor.pace_bms_bms4_balancing_status') not in ['',
  3965.                   'unknown', 'unavailable'] else '–' }} | {{ '0x%04X' |
  3966.                   format(states('sensor.pace_bms_bms4_balancing_status_raw') |
  3967.                   int(0)) }} |
  3968.  
  3969.                   | **Configuratie** | {{
  3970.                   states('sensor.pace_bms_bms4_configuration_status') if
  3971.                   states('sensor.pace_bms_bms4_configuration_status') not in
  3972.                   ['', 'unknown', 'unavailable'] else '–' }} | |
  3973.  
  3974.               - type: markdown
  3975.                 content: >
  3976.                  <details><summary><b>Hoe lees ik dit?</b></summary>
  3977.  
  3978.  
  3979.                   - **Status** is wat de BMS zelf rapporteert. Een – betekent:
  3980.                   niets actief.
  3981.  
  3982.                   - **Waarschuwing**: een waarde nadert een grens. Er wordt nog
  3983.                   niet ingegrepen.
  3984.  
  3985.                   - **Bescherming**: de BMS heeft ingegrepen, bijv. laden of
  3986.                   ontladen geblokkeerd bij te hoge of te lage cel­spanning, te
  3987.                   hoge stroom of een temperatuur buiten bereik. Dit heft
  3988.                   zichzelf meestal op zodra de waarde weer normaal is.
  3989.  
  3990.                   - **Fout**: een hardwareprobleem (meting, MOSFET,
  3991.                   communicatie). Dit verdwijnt meestal niet vanzelf. Blijft het
  3992.                   staan, neem dan contact op met de installateur.
  3993.  
  3994.                   - **Ruw** is de registerwaarde als bitmask. `0x0000` = niets
  3995.                   gezet. Een waarde ongelijk aan 0 terwijl de Status-kolom leeg
  3996.                   is, is een informatief bit (bijv. "volledig geladen") en geen
  3997.                   probleem.
  3998.  
  3999.                   - Wil je terugzien wanneer iets speelde, open dan de entiteit
  4000.                   (bijv. *BMS4 Protection Status*) via **Settings → Entities**
  4001.                   en bekijk de geschiedenis.
  4002.  
  4003.  
  4004.                   </details>
  4005.       - type: grid
  4006.         column_span: 3
  4007.         cards:
  4008.           - type: custom:apexcharts-card
  4009.             header:
  4010.               show: true
  4011.               title: Min / gem. / max cel (24 u)
  4012.               show_states: true
  4013.               colorize_states: true
  4014.             graph_span: 24h
  4015.             apex_config:
  4016.               chart:
  4017.                 height: 260
  4018.                 toolbar:
  4019.                   show: false
  4020.               legend:
  4021.                 show: false
  4022.                 fontSize: 11px
  4023.               tooltip:
  4024.                 shared: true
  4025.                 intersect: false
  4026.               xaxis:
  4027.                 tooltip:
  4028.                   enabled: false
  4029.             all_series_config:
  4030.               stroke_width: 1.5
  4031.               curve: smooth
  4032.               group_by:
  4033.                 func: avg
  4034.                 duration: 5min
  4035.                 fill: last
  4036.             series:
  4037.               - entity: sensor.pace_bms_bms4_min_cell_voltage
  4038.                 name: Min
  4039.                 float_precision: 3
  4040.                 color: '#1e88e5'
  4041.               - entity: sensor.pace_bms_bms4_avg_cell_voltage
  4042.                 name: Gem.
  4043.                 float_precision: 3
  4044.                 color: '#E91E63'
  4045.               - entity: sensor.pace_bms_bms4_max_cell_voltage
  4046.                 name: Max
  4047.                 float_precision: 3
  4048.                 color: '#e53935'
  4049.             yaxis:
  4050.               - decimals: 3
  4051.             grid_options:
  4052.               columns: 18
  4053.           - type: custom:apexcharts-card
  4054.             header:
  4055.               show: true
  4056.               title: Celverschil (24 u)
  4057.               show_states: true
  4058.               colorize_states: true
  4059.             graph_span: 24h
  4060.             apex_config:
  4061.               chart:
  4062.                 height: 260
  4063.                 toolbar:
  4064.                   show: false
  4065.               legend:
  4066.                 show: false
  4067.                 fontSize: 11px
  4068.               tooltip:
  4069.                 shared: true
  4070.                 intersect: false
  4071.               xaxis:
  4072.                 tooltip:
  4073.                   enabled: false
  4074.             all_series_config:
  4075.               stroke_width: 1.5
  4076.               curve: smooth
  4077.               group_by:
  4078.                 func: avg
  4079.                 duration: 5min
  4080.                 fill: last
  4081.             series:
  4082.               - entity: sensor.pace_bms_bms4_max_cell_differential
  4083.                 name: Δ
  4084.                 float_precision: 0
  4085.                 transform: return x * 1000;
  4086.                 unit: mV
  4087.                 color: '#E91E63'
  4088.             yaxis:
  4089.               - min: 0
  4090.                 decimals: 0
  4091.             grid_options:
  4092.               columns: 18
  4093.           - type: custom:apexcharts-card
  4094.             header:
  4095.               show: true
  4096.               title: Alle cellen (12 u)
  4097.               show_states: false
  4098.               colorize_states: true
  4099.             graph_span: 12h
  4100.             apex_config:
  4101.               chart:
  4102.                 height: 320
  4103.                 toolbar:
  4104.                   show: false
  4105.               legend:
  4106.                 show: true
  4107.                 fontSize: 11px
  4108.               tooltip:
  4109.                 shared: true
  4110.                 intersect: false
  4111.               xaxis:
  4112.                 tooltip:
  4113.                   enabled: false
  4114.             all_series_config:
  4115.               stroke_width: 1.5
  4116.               curve: smooth
  4117.               group_by:
  4118.                 func: avg
  4119.                 duration: 5min
  4120.                 fill: last
  4121.             series:
  4122.               - entity: sensor.pace_bms_bms4_cel_01_voltage
  4123.                 name: '1'
  4124.                 float_precision: 3
  4125.               - entity: sensor.pace_bms_bms4_cel_02_voltage
  4126.                 name: '2'
  4127.                 float_precision: 3
  4128.               - entity: sensor.pace_bms_bms4_cel_03_voltage
  4129.                 name: '3'
  4130.                 float_precision: 3
  4131.               - entity: sensor.pace_bms_bms4_cel_04_voltage
  4132.                 name: '4'
  4133.                 float_precision: 3
  4134.               - entity: sensor.pace_bms_bms4_cel_05_voltage
  4135.                 name: '5'
  4136.                 float_precision: 3
  4137.               - entity: sensor.pace_bms_bms4_cel_06_voltage
  4138.                 name: '6'
  4139.                 float_precision: 3
  4140.               - entity: sensor.pace_bms_bms4_cel_07_voltage
  4141.                 name: '7'
  4142.                 float_precision: 3
  4143.               - entity: sensor.pace_bms_bms4_cel_08_voltage
  4144.                 name: '8'
  4145.                 float_precision: 3
  4146.               - entity: sensor.pace_bms_bms4_cel_09_voltage
  4147.                 name: '9'
  4148.                 float_precision: 3
  4149.               - entity: sensor.pace_bms_bms4_cel_10_voltage
  4150.                 name: '10'
  4151.                 float_precision: 3
  4152.               - entity: sensor.pace_bms_bms4_cel_11_voltage
  4153.                 name: '11'
  4154.                 float_precision: 3
  4155.               - entity: sensor.pace_bms_bms4_cel_12_voltage
  4156.                 name: '12'
  4157.                 float_precision: 3
  4158.               - entity: sensor.pace_bms_bms4_cel_13_voltage
  4159.                 name: '13'
  4160.                 float_precision: 3
  4161.               - entity: sensor.pace_bms_bms4_cel_14_voltage
  4162.                 name: '14'
  4163.                 float_precision: 3
  4164.               - entity: sensor.pace_bms_bms4_cel_15_voltage
  4165.                 name: '15'
  4166.                 float_precision: 3
  4167.               - entity: sensor.pace_bms_bms4_cel_16_voltage
  4168.                 name: '16'
  4169.                 float_precision: 3
  4170.             yaxis:
  4171.               - min: '|-0.01|'
  4172.                 max: '|+0.01|'
  4173.                 decimals: 3
  4174.             grid_options:
  4175.               columns: full
  4176.           - type: custom:apexcharts-card
  4177.             header:
  4178.               show: true
  4179.               title: Stroom & SOC (24 u)
  4180.               show_states: true
  4181.               colorize_states: true
  4182.             graph_span: 24h
  4183.             apex_config:
  4184.               chart:
  4185.                 height: 260
  4186.                 toolbar:
  4187.                   show: false
  4188.               legend:
  4189.                 show: false
  4190.                 fontSize: 11px
  4191.               tooltip:
  4192.                 shared: true
  4193.                 intersect: false
  4194.               xaxis:
  4195.                 tooltip:
  4196.                   enabled: false
  4197.             all_series_config:
  4198.               stroke_width: 1.5
  4199.               curve: smooth
  4200.               group_by:
  4201.                 func: avg
  4202.                 duration: 5min
  4203.                 fill: last
  4204.             series:
  4205.               - entity: sensor.pace_bms_bms4_current
  4206.                 name: Stroom
  4207.                 float_precision: 1
  4208.                 yaxis_id: a
  4209.                 color: '#E91E63'
  4210.               - entity: sensor.pace_bms_bms4_soc
  4211.                 name: SOC
  4212.                 float_precision: 0
  4213.                 yaxis_id: soc
  4214.                 color: '#9e9e9e'
  4215.               - entity: sensor.coulomb_bms4_soc
  4216.                 name: Coulomb SOC
  4217.                 float_precision: 1
  4218.                 yaxis_id: soc
  4219.                 color: '#E91E63'
  4220.             yaxis:
  4221.               - id: a
  4222.                 decimals: 1
  4223.               - id: soc
  4224.                 opposite: true
  4225.                 min: 0
  4226.                 max: 100
  4227.                 decimals: 0
  4228.             grid_options:
  4229.               columns: 18
  4230.           - type: custom:apexcharts-card
  4231.             header:
  4232.               show: true
  4233.               title: Temperaturen (24 u)
  4234.               show_states: true
  4235.               colorize_states: true
  4236.             graph_span: 24h
  4237.             apex_config:
  4238.               chart:
  4239.                 height: 260
  4240.                 toolbar:
  4241.                   show: false
  4242.               legend:
  4243.                 show: false
  4244.                 fontSize: 11px
  4245.               tooltip:
  4246.                 shared: true
  4247.                 intersect: false
  4248.               xaxis:
  4249.                 tooltip:
  4250.                   enabled: false
  4251.             all_series_config:
  4252.               stroke_width: 1.5
  4253.               curve: smooth
  4254.               group_by:
  4255.                 func: avg
  4256.                 duration: 5min
  4257.                 fill: last
  4258.             series:
  4259.               - entity: sensor.pace_bms_bms4_temperatuur_1
  4260.                 name: T1
  4261.                 float_precision: 1
  4262.                 color: '#ef5350'
  4263.               - entity: sensor.pace_bms_bms4_temperatuur_2
  4264.                 name: T2
  4265.                 float_precision: 1
  4266.                 color: '#ffa726'
  4267.               - entity: sensor.pace_bms_bms4_temperatuur_3
  4268.                 name: T3
  4269.                 float_precision: 1
  4270.                 color: '#66bb6a'
  4271.               - entity: sensor.pace_bms_bms4_temperatuur_4
  4272.                 name: T4
  4273.                 float_precision: 1
  4274.                 color: '#42a5f5'
  4275.               - entity: sensor.pace_bms_bms4_environment_temperature
  4276.                 name: Omg.
  4277.                 float_precision: 1
  4278.                 color: '#9e9e9e'
  4279.             yaxis:
  4280.               - decimals: 1
  4281.             grid_options:
  4282.               columns: 18
  4283.   - title: BMS 5
  4284.     path: bms5
  4285.     icon: mdi:battery
  4286.     type: sections
  4287.     max_columns: 3
  4288.     dense_section_placement: false
  4289.     sections:
  4290.       - type: grid
  4291.         column_span: 3
  4292.         cards:
  4293.           - type: custom:mushroom-template-card
  4294.             primary: ACCU 5 · positie 5 van boven · adres 10
  4295.             secondary: >-
  4296.               {%- set ok = ['', 'unknown', 'unavailable', 'none', 'normal',
  4297.               'ok'] -%}
  4298.  
  4299.               {%- set ns = namespace(t=[]) -%}
  4300.  
  4301.               {%- for s in [states('sensor.pace_bms_bms5_protection_status'),
  4302.               states('sensor.pace_bms_bms5_fault_status')] if s | lower not in
  4303.               ok -%}{%- set ns.t = ns.t + [s] -%}{%- endfor -%}
  4304.  
  4305.               {{ states('sensor.pace_bms_bms5_system_status') or 'Normaal' }} ·
  4306.               {{ states('sensor.pace_bms_bms5_balancing_cells') }}{{ ' · ⚠️ ' ~
  4307.               (ns.t | join('; ')) if ns.t | count > 0 else '' }}
  4308.             icon: >-
  4309.               {% set soc = states('sensor.pace_bms_bms5_soc') | float(0) %}
  4310.  
  4311.               {% if soc >= 95 %}mdi:battery{% elif soc >= 85 %}mdi:battery-90{%
  4312.               elif soc >= 75 %}mdi:battery-80{% elif soc >= 65
  4313.               %}mdi:battery-70{% elif soc >= 55 %}mdi:battery-60{% elif soc >=
  4314.               45 %}mdi:battery-50{% elif soc >= 35 %}mdi:battery-40{% elif soc
  4315.               >= 25 %}mdi:battery-30{% elif soc >= 15 %}mdi:battery-20{% elif
  4316.               soc >= 5 %}mdi:battery-10{% else %}mdi:battery-alert{% endif %}
  4317.             color: >-
  4318.               {% set soc = states('sensor.pace_bms_bms5_soc') | float(0) %}
  4319.  
  4320.               {% if soc >= 75 %}green{% elif soc >= 50 %}amber{% elif soc >= 30
  4321.               %}orange{% else %}red{% endif %}
  4322.             badge_icon: >-
  4323.               {% set ok = ['', 'unknown', 'unavailable', 'none', 'normal', 'ok']
  4324.               %}{% if states('sensor.pace_bms_bms5_protection_status') | lower
  4325.               not in ok or states('sensor.pace_bms_bms5_fault_status') | lower
  4326.               not in ok %}mdi:alert{% endif %}
  4327.             badge_color: red
  4328.             tap_action:
  4329.               action: navigate
  4330.               navigation_path: bms-overzicht
  4331.             grid_options:
  4332.               columns: full
  4333.               rows: 1
  4334.           - type: tile
  4335.             entity: sensor.pace_bms_bms5_soc
  4336.             name: SOC
  4337.           - type: tile
  4338.             entity: sensor.coulomb_bms5_soc
  4339.             name: Coulomb SOC
  4340.             icon: mdi:battery-sync
  4341.           - type: tile
  4342.             entity: sensor.pace_bms_bms5_total_voltage
  4343.             name: Spanning
  4344.           - type: tile
  4345.             entity: sensor.pace_bms_bms5_current
  4346.             name: Stroom
  4347.           - type: tile
  4348.             entity: sensor.pace_bms_bms5_power
  4349.             name: Vermogen
  4350.           - type: tile
  4351.             entity: sensor.pace_bms_bms5_max_cell_differential
  4352.             name: Celverschil
  4353.             icon: mdi:arrow-expand-vertical
  4354.           - type: tile
  4355.             entity: sensor.pace_bms_bms5_full_capacity
  4356.             name: Capaciteit
  4357.           - type: tile
  4358.             entity: script.coulomb_herijk
  4359.             name: Herijk Coulomb
  4360.             icon: mdi:battery-sync
  4361.             tap_action:
  4362.               action: perform-action
  4363.               perform_action: script.coulomb_herijk
  4364.               data:
  4365.                 module: 5
  4366.               confirmation:
  4367.                 text: Coulomb-SOC van BMS 5 gelijkzetten aan de SOC van de BMS?
  4368.       - type: grid
  4369.         column_span: 2
  4370.         cards:
  4371.           - type: custom:apexcharts-card
  4372.             header:
  4373.               show: true
  4374.               title: Celspanningen
  4375.               show_states: false
  4376.             graph_span: 1min
  4377.             span:
  4378.               end: minute
  4379.             update_interval: 30s
  4380.             yaxis:
  4381.               - min: '|-0.005|'
  4382.                 max: '|+0.005|'
  4383.                 decimals: 3
  4384.                 apex_config:
  4385.                   tickAmount: 4
  4386.             apex_config:
  4387.               chart:
  4388.                 height: 330
  4389.               legend:
  4390.                 show: false
  4391.               xaxis:
  4392.                 labels:
  4393.                   show: false
  4394.                 axisTicks:
  4395.                   show: false
  4396.               plotOptions:
  4397.                 bar:
  4398.                   columnWidth: 80%
  4399.               dataLabels:
  4400.                 enabled: false
  4401.               tooltip:
  4402.                 x:
  4403.                   show: true
  4404.                   formatter: >
  4405.                    EVAL:function(val) { return 'Cel ' + Math.round((val %
  4406.                     60000) / 3500); }
  4407.             series:
  4408.               - entity: sensor.pace_bms_bms5_cel_01_voltage
  4409.                 name: Spanning
  4410.                 type: column
  4411.                 color: '#9C27B0'
  4412.                 float_precision: 3
  4413.                 unit: V
  4414.                 data_generator: >
  4415.                  const base = entity.entity_id.replace(/_cel_\d+_voltage$/,
  4416.                   '');
  4417.  
  4418.                   const t0 = start.getTime();
  4419.  
  4420.                   const out = [];
  4421.  
  4422.                   for (let i = 1; i <= 16; i++) {
  4423.                     const s = hass.states[`${base}_cel_${String(i).padStart(2, '0')}_voltage`];
  4424.                     const v = s ? parseFloat(s.state) : NaN;
  4425.                     if (!isNaN(v)) out.push([t0 + i * 3500, v]);
  4426.                   }
  4427.  
  4428.                   return out;
  4429.             grid_options:
  4430.               columns: full
  4431.       - type: grid
  4432.         column_span: 1
  4433.         cards:
  4434.           - type: markdown
  4435.             content: >
  4436.              {%- set p = 'sensor.pace_bms_bms5_cel_' -%}
  4437.  
  4438.               {%- set ns = namespace(v=[]) -%}
  4439.  
  4440.               {%- for i in range(1, 17) -%}
  4441.  
  4442.               {%- set ns.v = ns.v + [states(p ~ ('%02d' | format(i)) ~
  4443.               '_voltage') | float(0)] -%}
  4444.  
  4445.               {%- endfor -%}
  4446.  
  4447.               {%- set bal = states('sensor.pace_bms_bms5_balancing_status_raw')
  4448.               | int(0) -%}
  4449.  
  4450.               {%- set ok = ns.v | select('>', 0) | list -%}
  4451.  
  4452.               {%- if ok | count == 16 -%}
  4453.  
  4454.               {%- set vmin = ok | min -%}{%- set vmax = ok | max -%}{%- set avg
  4455.               = (ok | sum) / 16 -%}
  4456.  
  4457.               {%- macro c(i) -%}
  4458.  
  4459.               {%- set v = ns.v[i - 1] -%}
  4460.  
  4461.               {%- set d = ((v - avg) * 1000) | round(0) | int -%}
  4462.  
  4463.               {%- set s = '%.3f' | format(v) -%}
  4464.  
  4465.               {{ i }}{{ ' ⚖️' if (bal // (2 ** (i - 1))) % 2 == 1 else '' }} |
  4466.               {% if v == vmax %}<font color="#e53935">**{{ s }}**</font>{% elif
  4467.               v == vmin %}<font color="#1e88e5">**{{ s }}**</font>{% else %}{{ s
  4468.               }}{% endif %} | {{ '%+d' | format(d) }}
  4469.  
  4470.               {%- endmacro -%}
  4471.  
  4472.               Gem. **{{ '%.3f' | format(avg) }} V** · Δ **{{ ((vmax - vmin) *
  4473.               1000) | round(0) | int }} mV**
  4474.  
  4475.  
  4476.               | Cel | V | mV | Cel | V | mV |
  4477.  
  4478.               |:--|--:|--:|:--|--:|--:|
  4479.  
  4480.               {% for i in range(1, 9) -%}
  4481.  
  4482.               | {{ c(i) }} | {{ c(i + 8) }} |
  4483.  
  4484.               {% endfor %}
  4485.  
  4486.               <font color="#e53935">■</font> hoogste · <font
  4487.               color="#1e88e5">■</font> laagste · ⚖️ balanceert · mV t.o.v. gem.
  4488.  
  4489.               {%- else -%}
  4490.  
  4491.               Celdata (nog) niet beschikbaar.
  4492.  
  4493.               {%- endif %}
  4494.             grid_options:
  4495.               columns: full
  4496.       - type: grid
  4497.         column_span: 3
  4498.         cards:
  4499.           - type: entities
  4500.             title: Temperaturen
  4501.             grid_options:
  4502.               columns: 12
  4503.             entities:
  4504.               - entity: sensor.pace_bms_bms5_temperatuur_1
  4505.                 name: Celsensor 1
  4506.               - entity: sensor.pace_bms_bms5_temperatuur_2
  4507.                 name: Celsensor 2
  4508.               - entity: sensor.pace_bms_bms5_temperatuur_3
  4509.                 name: Celsensor 3
  4510.               - entity: sensor.pace_bms_bms5_temperatuur_4
  4511.                 name: Celsensor 4
  4512.               - entity: sensor.pace_bms_bms5_environment_temperature
  4513.                 name: Omgeving
  4514.           - type: entities
  4515.             title: Cellen
  4516.             grid_options:
  4517.               columns: 12
  4518.             entities:
  4519.               - entity: sensor.pace_bms_bms5_min_cell_voltage
  4520.                 name: Laagste cel
  4521.               - entity: sensor.pace_bms_bms5_avg_cell_voltage
  4522.                 name: Gemiddeld
  4523.               - entity: sensor.pace_bms_bms5_max_cell_voltage
  4524.                 name: Hoogste cel
  4525.               - entity: sensor.pace_bms_bms5_max_cell_differential
  4526.                 name: Verschil
  4527.               - entity: sensor.pace_bms_bms5_balancing_cells
  4528.                 name: Balancing
  4529.                 icon: mdi:scale-balance
  4530.           - type: vertical-stack
  4531.             grid_options:
  4532.               columns: 12
  4533.             cards:
  4534.               - type: markdown
  4535.                 title: Status
  4536.                 content: >+
  4537.                   | | Status | Ruw |
  4538.                   |:--|:--|--:|
  4539.  
  4540.                   | **Systeem** | {{
  4541.                   states('sensor.pace_bms_bms5_system_status') if
  4542.                   states('sensor.pace_bms_bms5_system_status') not in ['',
  4543.                   'unknown', 'unavailable'] else '–' }} | {{ '0x%04X' |
  4544.                  format(states('sensor.pace_bms_bms5_system_status_raw') |
  4545.                   int(0)) }} |
  4546.  
  4547.                   | **Waarschuwing** | {{
  4548.                   states('sensor.pace_bms_bms5_warning_status') if
  4549.                   states('sensor.pace_bms_bms5_warning_status') not in ['',
  4550.                   'unknown', 'unavailable'] else '–' }} | |
  4551.  
  4552.                   | **Bescherming** | {{
  4553.                   states('sensor.pace_bms_bms5_protection_status') if
  4554.                   states('sensor.pace_bms_bms5_protection_status') not in ['',
  4555.                   'unknown', 'unavailable'] else '–' }} | {{ '0x%04X' |
  4556.                   format(states('sensor.pace_bms_bms5_protection1_raw') |
  4557.                   int(0)) }} / {{ '0x%04X' |
  4558.                   format(states('sensor.pace_bms_bms5_protection2_raw') |
  4559.                   int(0)) }} |
  4560.  
  4561.                   | **Fout** | {{ states('sensor.pace_bms_bms5_fault_status') if
  4562.                   states('sensor.pace_bms_bms5_fault_status') not in ['',
  4563.                   'unknown', 'unavailable'] else '–' }} | {{ '0x%04X' |
  4564.                   format(states('sensor.pace_bms_bms5_fault_status_raw') |
  4565.                   int(0)) }} |
  4566.  
  4567.                   | **Balancing** | {{
  4568.                   states('sensor.pace_bms_bms5_balancing_status') if
  4569.                   states('sensor.pace_bms_bms5_balancing_status') not in ['',
  4570.                   'unknown', 'unavailable'] else '–' }} | {{ '0x%04X' |
  4571.                   format(states('sensor.pace_bms_bms5_balancing_status_raw') |
  4572.                   int(0)) }} |
  4573.  
  4574.                   | **Configuratie** | {{
  4575.                   states('sensor.pace_bms_bms5_configuration_status') if
  4576.                   states('sensor.pace_bms_bms5_configuration_status') not in
  4577.                   ['', 'unknown', 'unavailable'] else '–' }} | |
  4578.  
  4579.               - type: markdown
  4580.                 content: >
  4581.                  <details><summary><b>Hoe lees ik dit?</b></summary>
  4582.  
  4583.  
  4584.                   - **Status** is wat de BMS zelf rapporteert. Een – betekent:
  4585.                   niets actief.
  4586.  
  4587.                   - **Waarschuwing**: een waarde nadert een grens. Er wordt nog
  4588.                   niet ingegrepen.
  4589.  
  4590.                   - **Bescherming**: de BMS heeft ingegrepen, bijv. laden of
  4591.                   ontladen geblokkeerd bij te hoge of te lage cel­spanning, te
  4592.                   hoge stroom of een temperatuur buiten bereik. Dit heft
  4593.                   zichzelf meestal op zodra de waarde weer normaal is.
  4594.  
  4595.                   - **Fout**: een hardwareprobleem (meting, MOSFET,
  4596.                   communicatie). Dit verdwijnt meestal niet vanzelf. Blijft het
  4597.                   staan, neem dan contact op met de installateur.
  4598.  
  4599.                   - **Ruw** is de registerwaarde als bitmask. `0x0000` = niets
  4600.                   gezet. Een waarde ongelijk aan 0 terwijl de Status-kolom leeg
  4601.                   is, is een informatief bit (bijv. "volledig geladen") en geen
  4602.                   probleem.
  4603.  
  4604.                   - Wil je terugzien wanneer iets speelde, open dan de entiteit
  4605.                   (bijv. *BMS5 Protection Status*) via **Settings → Entities**
  4606.                   en bekijk de geschiedenis.
  4607.  
  4608.  
  4609.                   </details>
  4610.       - type: grid
  4611.         column_span: 3
  4612.         cards:
  4613.           - type: custom:apexcharts-card
  4614.             header:
  4615.               show: true
  4616.               title: Min / gem. / max cel (24 u)
  4617.               show_states: true
  4618.               colorize_states: true
  4619.             graph_span: 24h
  4620.             apex_config:
  4621.               chart:
  4622.                 height: 260
  4623.                 toolbar:
  4624.                   show: false
  4625.               legend:
  4626.                 show: false
  4627.                 fontSize: 11px
  4628.               tooltip:
  4629.                 shared: true
  4630.                 intersect: false
  4631.               xaxis:
  4632.                 tooltip:
  4633.                   enabled: false
  4634.             all_series_config:
  4635.               stroke_width: 1.5
  4636.               curve: smooth
  4637.               group_by:
  4638.                 func: avg
  4639.                 duration: 5min
  4640.                 fill: last
  4641.             series:
  4642.               - entity: sensor.pace_bms_bms5_min_cell_voltage
  4643.                 name: Min
  4644.                 float_precision: 3
  4645.                 color: '#1e88e5'
  4646.               - entity: sensor.pace_bms_bms5_avg_cell_voltage
  4647.                 name: Gem.
  4648.                 float_precision: 3
  4649.                 color: '#9C27B0'
  4650.               - entity: sensor.pace_bms_bms5_max_cell_voltage
  4651.                 name: Max
  4652.                 float_precision: 3
  4653.                 color: '#e53935'
  4654.             yaxis:
  4655.               - decimals: 3
  4656.             grid_options:
  4657.               columns: 18
  4658.           - type: custom:apexcharts-card
  4659.             header:
  4660.               show: true
  4661.               title: Celverschil (24 u)
  4662.               show_states: true
  4663.               colorize_states: true
  4664.             graph_span: 24h
  4665.             apex_config:
  4666.               chart:
  4667.                 height: 260
  4668.                 toolbar:
  4669.                   show: false
  4670.               legend:
  4671.                 show: false
  4672.                 fontSize: 11px
  4673.               tooltip:
  4674.                 shared: true
  4675.                 intersect: false
  4676.               xaxis:
  4677.                 tooltip:
  4678.                   enabled: false
  4679.             all_series_config:
  4680.               stroke_width: 1.5
  4681.               curve: smooth
  4682.               group_by:
  4683.                 func: avg
  4684.                 duration: 5min
  4685.                 fill: last
  4686.             series:
  4687.               - entity: sensor.pace_bms_bms5_max_cell_differential
  4688.                 name: Δ
  4689.                 float_precision: 0
  4690.                 transform: return x * 1000;
  4691.                 unit: mV
  4692.                 color: '#9C27B0'
  4693.             yaxis:
  4694.               - min: 0
  4695.                 decimals: 0
  4696.             grid_options:
  4697.               columns: 18
  4698.           - type: custom:apexcharts-card
  4699.             header:
  4700.               show: true
  4701.               title: Alle cellen (12 u)
  4702.               show_states: false
  4703.               colorize_states: true
  4704.             graph_span: 12h
  4705.             apex_config:
  4706.               chart:
  4707.                 height: 320
  4708.                 toolbar:
  4709.                   show: false
  4710.               legend:
  4711.                 show: true
  4712.                 fontSize: 11px
  4713.               tooltip:
  4714.                 shared: true
  4715.                 intersect: false
  4716.               xaxis:
  4717.                 tooltip:
  4718.                   enabled: false
  4719.             all_series_config:
  4720.               stroke_width: 1.5
  4721.               curve: smooth
  4722.               group_by:
  4723.                 func: avg
  4724.                 duration: 5min
  4725.                 fill: last
  4726.             series:
  4727.               - entity: sensor.pace_bms_bms5_cel_01_voltage
  4728.                 name: '1'
  4729.                 float_precision: 3
  4730.               - entity: sensor.pace_bms_bms5_cel_02_voltage
  4731.                 name: '2'
  4732.                 float_precision: 3
  4733.               - entity: sensor.pace_bms_bms5_cel_03_voltage
  4734.                 name: '3'
  4735.                 float_precision: 3
  4736.               - entity: sensor.pace_bms_bms5_cel_04_voltage
  4737.                 name: '4'
  4738.                 float_precision: 3
  4739.               - entity: sensor.pace_bms_bms5_cel_05_voltage
  4740.                 name: '5'
  4741.                 float_precision: 3
  4742.               - entity: sensor.pace_bms_bms5_cel_06_voltage
  4743.                 name: '6'
  4744.                 float_precision: 3
  4745.               - entity: sensor.pace_bms_bms5_cel_07_voltage
  4746.                 name: '7'
  4747.                 float_precision: 3
  4748.               - entity: sensor.pace_bms_bms5_cel_08_voltage
  4749.                 name: '8'
  4750.                 float_precision: 3
  4751.               - entity: sensor.pace_bms_bms5_cel_09_voltage
  4752.                 name: '9'
  4753.                 float_precision: 3
  4754.               - entity: sensor.pace_bms_bms5_cel_10_voltage
  4755.                 name: '10'
  4756.                 float_precision: 3
  4757.               - entity: sensor.pace_bms_bms5_cel_11_voltage
  4758.                 name: '11'
  4759.                 float_precision: 3
  4760.               - entity: sensor.pace_bms_bms5_cel_12_voltage
  4761.                 name: '12'
  4762.                 float_precision: 3
  4763.               - entity: sensor.pace_bms_bms5_cel_13_voltage
  4764.                 name: '13'
  4765.                 float_precision: 3
  4766.               - entity: sensor.pace_bms_bms5_cel_14_voltage
  4767.                 name: '14'
  4768.                 float_precision: 3
  4769.               - entity: sensor.pace_bms_bms5_cel_15_voltage
  4770.                 name: '15'
  4771.                 float_precision: 3
  4772.               - entity: sensor.pace_bms_bms5_cel_16_voltage
  4773.                 name: '16'
  4774.                 float_precision: 3
  4775.             yaxis:
  4776.               - min: '|-0.01|'
  4777.                 max: '|+0.01|'
  4778.                 decimals: 3
  4779.             grid_options:
  4780.               columns: full
  4781.           - type: custom:apexcharts-card
  4782.             header:
  4783.               show: true
  4784.               title: Stroom & SOC (24 u)
  4785.               show_states: true
  4786.               colorize_states: true
  4787.             graph_span: 24h
  4788.             apex_config:
  4789.               chart:
  4790.                 height: 260
  4791.                 toolbar:
  4792.                   show: false
  4793.               legend:
  4794.                 show: false
  4795.                 fontSize: 11px
  4796.               tooltip:
  4797.                 shared: true
  4798.                 intersect: false
  4799.               xaxis:
  4800.                 tooltip:
  4801.                   enabled: false
  4802.             all_series_config:
  4803.               stroke_width: 1.5
  4804.               curve: smooth
  4805.               group_by:
  4806.                 func: avg
  4807.                 duration: 5min
  4808.                 fill: last
  4809.             series:
  4810.               - entity: sensor.pace_bms_bms5_current
  4811.                 name: Stroom
  4812.                 float_precision: 1
  4813.                 yaxis_id: a
  4814.                 color: '#9C27B0'
  4815.               - entity: sensor.pace_bms_bms5_soc
  4816.                 name: SOC
  4817.                 float_precision: 0
  4818.                 yaxis_id: soc
  4819.                 color: '#9e9e9e'
  4820.               - entity: sensor.coulomb_bms5_soc
  4821.                 name: Coulomb SOC
  4822.                 float_precision: 1
  4823.                 yaxis_id: soc
  4824.                 color: '#9C27B0'
  4825.             yaxis:
  4826.               - id: a
  4827.                 decimals: 1
  4828.               - id: soc
  4829.                 opposite: true
  4830.                 min: 0
  4831.                 max: 100
  4832.                 decimals: 0
  4833.             grid_options:
  4834.               columns: 18
  4835.           - type: custom:apexcharts-card
  4836.             header:
  4837.               show: true
  4838.               title: Temperaturen (24 u)
  4839.               show_states: true
  4840.               colorize_states: true
  4841.             graph_span: 24h
  4842.             apex_config:
  4843.               chart:
  4844.                 height: 260
  4845.                 toolbar:
  4846.                   show: false
  4847.               legend:
  4848.                 show: false
  4849.                 fontSize: 11px
  4850.               tooltip:
  4851.                 shared: true
  4852.                 intersect: false
  4853.               xaxis:
  4854.                 tooltip:
  4855.                   enabled: false
  4856.             all_series_config:
  4857.               stroke_width: 1.5
  4858.               curve: smooth
  4859.               group_by:
  4860.                 func: avg
  4861.                 duration: 5min
  4862.                 fill: last
  4863.             series:
  4864.               - entity: sensor.pace_bms_bms5_temperatuur_1
  4865.                 name: T1
  4866.                 float_precision: 1
  4867.                 color: '#ef5350'
  4868.               - entity: sensor.pace_bms_bms5_temperatuur_2
  4869.                 name: T2
  4870.                 float_precision: 1
  4871.                 color: '#ffa726'
  4872.               - entity: sensor.pace_bms_bms5_temperatuur_3
  4873.                 name: T3
  4874.                 float_precision: 1
  4875.                 color: '#66bb6a'
  4876.               - entity: sensor.pace_bms_bms5_temperatuur_4
  4877.                 name: T4
  4878.                 float_precision: 1
  4879.                 color: '#42a5f5'
  4880.               - entity: sensor.pace_bms_bms5_environment_temperature
  4881.                 name: Omg.
  4882.                 float_precision: 1
  4883.                 color: '#9e9e9e'
  4884.             yaxis:
  4885.               - decimals: 1
  4886.             grid_options:
  4887.               columns: 18
  4888.   - title: BMS 6
  4889.     path: bms6
  4890.     icon: mdi:battery
  4891.     type: sections
  4892.     max_columns: 3
  4893.     dense_section_placement: false
  4894.     sections:
  4895.       - type: grid
  4896.         column_span: 3
  4897.         cards:
  4898.           - type: custom:mushroom-template-card
  4899.             primary: ACCU 6 · positie 6 van boven · adres 11
  4900.             secondary: >-
  4901.               {%- set ok = ['', 'unknown', 'unavailable', 'none', 'normal',
  4902.               'ok'] -%}
  4903.  
  4904.               {%- set ns = namespace(t=[]) -%}
  4905.  
  4906.               {%- for s in [states('sensor.pace_bms_bms6_protection_status'),
  4907.               states('sensor.pace_bms_bms6_fault_status')] if s | lower not in
  4908.               ok -%}{%- set ns.t = ns.t + [s] -%}{%- endfor -%}
  4909.  
  4910.               {{ states('sensor.pace_bms_bms6_system_status') or 'Normaal' }} ·
  4911.               {{ states('sensor.pace_bms_bms6_balancing_cells') }}{{ ' · ⚠️ ' ~
  4912.               (ns.t | join('; ')) if ns.t | count > 0 else '' }}
  4913.             icon: >-
  4914.               {% set soc = states('sensor.pace_bms_bms6_soc') | float(0) %}
  4915.  
  4916.               {% if soc >= 95 %}mdi:battery{% elif soc >= 85 %}mdi:battery-90{%
  4917.               elif soc >= 75 %}mdi:battery-80{% elif soc >= 65
  4918.               %}mdi:battery-70{% elif soc >= 55 %}mdi:battery-60{% elif soc >=
  4919.               45 %}mdi:battery-50{% elif soc >= 35 %}mdi:battery-40{% elif soc
  4920.               >= 25 %}mdi:battery-30{% elif soc >= 15 %}mdi:battery-20{% elif
  4921.               soc >= 5 %}mdi:battery-10{% else %}mdi:battery-alert{% endif %}
  4922.             color: >-
  4923.               {% set soc = states('sensor.pace_bms_bms6_soc') | float(0) %}
  4924.  
  4925.               {% if soc >= 75 %}green{% elif soc >= 50 %}amber{% elif soc >= 30
  4926.               %}orange{% else %}red{% endif %}
  4927.             badge_icon: >-
  4928.               {% set ok = ['', 'unknown', 'unavailable', 'none', 'normal', 'ok']
  4929.               %}{% if states('sensor.pace_bms_bms6_protection_status') | lower
  4930.               not in ok or states('sensor.pace_bms_bms6_fault_status') | lower
  4931.               not in ok %}mdi:alert{% endif %}
  4932.             badge_color: red
  4933.             tap_action:
  4934.               action: navigate
  4935.               navigation_path: bms-overzicht
  4936.             grid_options:
  4937.               columns: full
  4938.               rows: 1
  4939.           - type: tile
  4940.             entity: sensor.pace_bms_bms6_soc
  4941.             name: SOC
  4942.           - type: tile
  4943.             entity: sensor.coulomb_bms6_soc
  4944.             name: Coulomb SOC
  4945.             icon: mdi:battery-sync
  4946.           - type: tile
  4947.             entity: sensor.pace_bms_bms6_total_voltage
  4948.             name: Spanning
  4949.           - type: tile
  4950.             entity: sensor.pace_bms_bms6_current
  4951.             name: Stroom
  4952.           - type: tile
  4953.             entity: sensor.pace_bms_bms6_power
  4954.             name: Vermogen
  4955.           - type: tile
  4956.             entity: sensor.pace_bms_bms6_max_cell_differential
  4957.             name: Celverschil
  4958.             icon: mdi:arrow-expand-vertical
  4959.           - type: tile
  4960.             entity: sensor.pace_bms_bms6_full_capacity
  4961.             name: Capaciteit
  4962.           - type: tile
  4963.             entity: script.coulomb_herijk
  4964.             name: Herijk Coulomb
  4965.             icon: mdi:battery-sync
  4966.             tap_action:
  4967.               action: perform-action
  4968.               perform_action: script.coulomb_herijk
  4969.               data:
  4970.                 module: 6
  4971.               confirmation:
  4972.                 text: Coulomb-SOC van BMS 6 gelijkzetten aan de SOC van de BMS?
  4973.       - type: grid
  4974.         column_span: 2
  4975.         cards:
  4976.           - type: custom:apexcharts-card
  4977.             header:
  4978.               show: true
  4979.               title: Celspanningen
  4980.               show_states: false
  4981.             graph_span: 1min
  4982.             span:
  4983.               end: minute
  4984.             update_interval: 30s
  4985.             yaxis:
  4986.               - min: '|-0.005|'
  4987.                 max: '|+0.005|'
  4988.                 decimals: 3
  4989.                 apex_config:
  4990.                   tickAmount: 4
  4991.             apex_config:
  4992.               chart:
  4993.                 height: 330
  4994.               legend:
  4995.                 show: false
  4996.               xaxis:
  4997.                 labels:
  4998.                   show: false
  4999.                 axisTicks:
  5000.                   show: false
  5001.               plotOptions:
  5002.                 bar:
  5003.                   columnWidth: 80%
  5004.               dataLabels:
  5005.                 enabled: false
  5006.               tooltip:
  5007.                 x:
  5008.                   show: true
  5009.                   formatter: >
  5010.                    EVAL:function(val) { return 'Cel ' + Math.round((val %
  5011.                     60000) / 3500); }
  5012.             series:
  5013.               - entity: sensor.pace_bms_bms6_cel_01_voltage
  5014.                 name: Spanning
  5015.                 type: column
  5016.                 color: '#00BCD4'
  5017.                 float_precision: 3
  5018.                 unit: V
  5019.                 data_generator: >
  5020.                  const base = entity.entity_id.replace(/_cel_\d+_voltage$/,
  5021.                   '');
  5022.  
  5023.                   const t0 = start.getTime();
  5024.  
  5025.                   const out = [];
  5026.  
  5027.                   for (let i = 1; i <= 16; i++) {
  5028.                     const s = hass.states[`${base}_cel_${String(i).padStart(2, '0')}_voltage`];
  5029.                     const v = s ? parseFloat(s.state) : NaN;
  5030.                     if (!isNaN(v)) out.push([t0 + i * 3500, v]);
  5031.                   }
  5032.  
  5033.                   return out;
  5034.             grid_options:
  5035.               columns: full
  5036.       - type: grid
  5037.         column_span: 1
  5038.         cards:
  5039.           - type: markdown
  5040.             content: >
  5041.              {%- set p = 'sensor.pace_bms_bms6_cel_' -%}
  5042.  
  5043.               {%- set ns = namespace(v=[]) -%}
  5044.  
  5045.               {%- for i in range(1, 17) -%}
  5046.  
  5047.               {%- set ns.v = ns.v + [states(p ~ ('%02d' | format(i)) ~
  5048.               '_voltage') | float(0)] -%}
  5049.  
  5050.               {%- endfor -%}
  5051.  
  5052.               {%- set bal = states('sensor.pace_bms_bms6_balancing_status_raw')
  5053.               | int(0) -%}
  5054.  
  5055.               {%- set ok = ns.v | select('>', 0) | list -%}
  5056.  
  5057.               {%- if ok | count == 16 -%}
  5058.  
  5059.               {%- set vmin = ok | min -%}{%- set vmax = ok | max -%}{%- set avg
  5060.               = (ok | sum) / 16 -%}
  5061.  
  5062.               {%- macro c(i) -%}
  5063.  
  5064.               {%- set v = ns.v[i - 1] -%}
  5065.  
  5066.               {%- set d = ((v - avg) * 1000) | round(0) | int -%}
  5067.  
  5068.               {%- set s = '%.3f' | format(v) -%}
  5069.  
  5070.               {{ i }}{{ ' ⚖️' if (bal // (2 ** (i - 1))) % 2 == 1 else '' }} |
  5071.               {% if v == vmax %}<font color="#e53935">**{{ s }}**</font>{% elif
  5072.               v == vmin %}<font color="#1e88e5">**{{ s }}**</font>{% else %}{{ s
  5073.               }}{% endif %} | {{ '%+d' | format(d) }}
  5074.  
  5075.               {%- endmacro -%}
  5076.  
  5077.               Gem. **{{ '%.3f' | format(avg) }} V** · Δ **{{ ((vmax - vmin) *
  5078.               1000) | round(0) | int }} mV**
  5079.  
  5080.  
  5081.               | Cel | V | mV | Cel | V | mV |
  5082.  
  5083.               |:--|--:|--:|:--|--:|--:|
  5084.  
  5085.               {% for i in range(1, 9) -%}
  5086.  
  5087.               | {{ c(i) }} | {{ c(i + 8) }} |
  5088.  
  5089.               {% endfor %}
  5090.  
  5091.               <font color="#e53935">■</font> hoogste · <font
  5092.               color="#1e88e5">■</font> laagste · ⚖️ balanceert · mV t.o.v. gem.
  5093.  
  5094.               {%- else -%}
  5095.  
  5096.               Celdata (nog) niet beschikbaar.
  5097.  
  5098.               {%- endif %}
  5099.             grid_options:
  5100.               columns: full
  5101.       - type: grid
  5102.         column_span: 3
  5103.         cards:
  5104.           - type: entities
  5105.             title: Temperaturen
  5106.             grid_options:
  5107.               columns: 12
  5108.             entities:
  5109.               - entity: sensor.pace_bms_bms6_temperatuur_1
  5110.                 name: Celsensor 1
  5111.               - entity: sensor.pace_bms_bms6_temperatuur_2
  5112.                 name: Celsensor 2
  5113.               - entity: sensor.pace_bms_bms6_temperatuur_3
  5114.                 name: Celsensor 3
  5115.               - entity: sensor.pace_bms_bms6_temperatuur_4
  5116.                 name: Celsensor 4
  5117.               - entity: sensor.pace_bms_bms6_environment_temperature
  5118.                 name: Omgeving
  5119.           - type: entities
  5120.             title: Cellen
  5121.             grid_options:
  5122.               columns: 12
  5123.             entities:
  5124.               - entity: sensor.pace_bms_bms6_min_cell_voltage
  5125.                 name: Laagste cel
  5126.               - entity: sensor.pace_bms_bms6_avg_cell_voltage
  5127.                 name: Gemiddeld
  5128.               - entity: sensor.pace_bms_bms6_max_cell_voltage
  5129.                 name: Hoogste cel
  5130.               - entity: sensor.pace_bms_bms6_max_cell_differential
  5131.                 name: Verschil
  5132.               - entity: sensor.pace_bms_bms6_balancing_cells
  5133.                 name: Balancing
  5134.                 icon: mdi:scale-balance
  5135.           - type: vertical-stack
  5136.             grid_options:
  5137.               columns: 12
  5138.             cards:
  5139.               - type: markdown
  5140.                 title: Status
  5141.                 content: >+
  5142.                   | | Status | Ruw |
  5143.                   |:--|:--|--:|
  5144.  
  5145.                   | **Systeem** | {{
  5146.                   states('sensor.pace_bms_bms6_system_status') if
  5147.                   states('sensor.pace_bms_bms6_system_status') not in ['',
  5148.                   'unknown', 'unavailable'] else '–' }} | {{ '0x%04X' |
  5149.                  format(states('sensor.pace_bms_bms6_system_status_raw') |
  5150.                   int(0)) }} |
  5151.  
  5152.                   | **Waarschuwing** | {{
  5153.                   states('sensor.pace_bms_bms6_warning_status') if
  5154.                   states('sensor.pace_bms_bms6_warning_status') not in ['',
  5155.                   'unknown', 'unavailable'] else '–' }} | |
  5156.  
  5157.                   | **Bescherming** | {{
  5158.                   states('sensor.pace_bms_bms6_protection_status') if
  5159.                   states('sensor.pace_bms_bms6_protection_status') not in ['',
  5160.                   'unknown', 'unavailable'] else '–' }} | {{ '0x%04X' |
  5161.                   format(states('sensor.pace_bms_bms6_protection1_raw') |
  5162.                   int(0)) }} / {{ '0x%04X' |
  5163.                   format(states('sensor.pace_bms_bms6_protection2_raw') |
  5164.                   int(0)) }} |
  5165.  
  5166.                   | **Fout** | {{ states('sensor.pace_bms_bms6_fault_status') if
  5167.                   states('sensor.pace_bms_bms6_fault_status') not in ['',
  5168.                   'unknown', 'unavailable'] else '–' }} | {{ '0x%04X' |
  5169.                   format(states('sensor.pace_bms_bms6_fault_status_raw') |
  5170.                   int(0)) }} |
  5171.  
  5172.                   | **Balancing** | {{
  5173.                   states('sensor.pace_bms_bms6_balancing_status') if
  5174.                   states('sensor.pace_bms_bms6_balancing_status') not in ['',
  5175.                   'unknown', 'unavailable'] else '–' }} | {{ '0x%04X' |
  5176.                   format(states('sensor.pace_bms_bms6_balancing_status_raw') |
  5177.                   int(0)) }} |
  5178.  
  5179.                   | **Configuratie** | {{
  5180.                   states('sensor.pace_bms_bms6_configuration_status') if
  5181.                   states('sensor.pace_bms_bms6_configuration_status') not in
  5182.                   ['', 'unknown', 'unavailable'] else '–' }} | |
  5183.  
  5184.               - type: markdown
  5185.                 content: >
  5186.                  <details><summary><b>Hoe lees ik dit?</b></summary>
  5187.  
  5188.  
  5189.                   - **Status** is wat de BMS zelf rapporteert. Een – betekent:
  5190.                   niets actief.
  5191.  
  5192.                   - **Waarschuwing**: een waarde nadert een grens. Er wordt nog
  5193.                   niet ingegrepen.
  5194.  
  5195.                   - **Bescherming**: de BMS heeft ingegrepen, bijv. laden of
  5196.                   ontladen geblokkeerd bij te hoge of te lage cel­spanning, te
  5197.                   hoge stroom of een temperatuur buiten bereik. Dit heft
  5198.                   zichzelf meestal op zodra de waarde weer normaal is.
  5199.  
  5200.                   - **Fout**: een hardwareprobleem (meting, MOSFET,
  5201.                   communicatie). Dit verdwijnt meestal niet vanzelf. Blijft het
  5202.                   staan, neem dan contact op met de installateur.
  5203.  
  5204.                   - **Ruw** is de registerwaarde als bitmask. `0x0000` = niets
  5205.                   gezet. Een waarde ongelijk aan 0 terwijl de Status-kolom leeg
  5206.                   is, is een informatief bit (bijv. "volledig geladen") en geen
  5207.                   probleem.
  5208.  
  5209.                   - Wil je terugzien wanneer iets speelde, open dan de entiteit
  5210.                   (bijv. *BMS6 Protection Status*) via **Settings → Entities**
  5211.                   en bekijk de geschiedenis.
  5212.  
  5213.  
  5214.                   </details>
  5215.       - type: grid
  5216.         column_span: 3
  5217.         cards:
  5218.           - type: custom:apexcharts-card
  5219.             header:
  5220.               show: true
  5221.               title: Min / gem. / max cel (24 u)
  5222.               show_states: true
  5223.               colorize_states: true
  5224.             graph_span: 24h
  5225.             apex_config:
  5226.               chart:
  5227.                 height: 260
  5228.                 toolbar:
  5229.                   show: false
  5230.               legend:
  5231.                 show: false
  5232.                 fontSize: 11px
  5233.               tooltip:
  5234.                 shared: true
  5235.                 intersect: false
  5236.               xaxis:
  5237.                 tooltip:
  5238.                   enabled: false
  5239.             all_series_config:
  5240.               stroke_width: 1.5
  5241.               curve: smooth
  5242.               group_by:
  5243.                 func: avg
  5244.                 duration: 5min
  5245.                 fill: last
  5246.             series:
  5247.               - entity: sensor.pace_bms_bms6_min_cell_voltage
  5248.                 name: Min
  5249.                 float_precision: 3
  5250.                 color: '#1e88e5'
  5251.               - entity: sensor.pace_bms_bms6_avg_cell_voltage
  5252.                 name: Gem.
  5253.                 float_precision: 3
  5254.                 color: '#00BCD4'
  5255.               - entity: sensor.pace_bms_bms6_max_cell_voltage
  5256.                 name: Max
  5257.                 float_precision: 3
  5258.                 color: '#e53935'
  5259.             yaxis:
  5260.               - decimals: 3
  5261.             grid_options:
  5262.               columns: 18
  5263.           - type: custom:apexcharts-card
  5264.             header:
  5265.               show: true
  5266.               title: Celverschil (24 u)
  5267.               show_states: true
  5268.               colorize_states: true
  5269.             graph_span: 24h
  5270.             apex_config:
  5271.               chart:
  5272.                 height: 260
  5273.                 toolbar:
  5274.                   show: false
  5275.               legend:
  5276.                 show: false
  5277.                 fontSize: 11px
  5278.               tooltip:
  5279.                 shared: true
  5280.                 intersect: false
  5281.               xaxis:
  5282.                 tooltip:
  5283.                   enabled: false
  5284.             all_series_config:
  5285.               stroke_width: 1.5
  5286.               curve: smooth
  5287.               group_by:
  5288.                 func: avg
  5289.                 duration: 5min
  5290.                 fill: last
  5291.             series:
  5292.               - entity: sensor.pace_bms_bms6_max_cell_differential
  5293.                 name: Δ
  5294.                 float_precision: 0
  5295.                 transform: return x * 1000;
  5296.                 unit: mV
  5297.                 color: '#00BCD4'
  5298.             yaxis:
  5299.               - min: 0
  5300.                 decimals: 0
  5301.             grid_options:
  5302.               columns: 18
  5303.           - type: custom:apexcharts-card
  5304.             header:
  5305.               show: true
  5306.               title: Alle cellen (12 u)
  5307.               show_states: false
  5308.               colorize_states: true
  5309.             graph_span: 12h
  5310.             apex_config:
  5311.               chart:
  5312.                 height: 320
  5313.                 toolbar:
  5314.                   show: false
  5315.               legend:
  5316.                 show: true
  5317.                 fontSize: 11px
  5318.               tooltip:
  5319.                 shared: true
  5320.                 intersect: false
  5321.               xaxis:
  5322.                 tooltip:
  5323.                   enabled: false
  5324.             all_series_config:
  5325.               stroke_width: 1.5
  5326.               curve: smooth
  5327.               group_by:
  5328.                 func: avg
  5329.                 duration: 5min
  5330.                 fill: last
  5331.             series:
  5332.               - entity: sensor.pace_bms_bms6_cel_01_voltage
  5333.                 name: '1'
  5334.                 float_precision: 3
  5335.               - entity: sensor.pace_bms_bms6_cel_02_voltage
  5336.                 name: '2'
  5337.                 float_precision: 3
  5338.               - entity: sensor.pace_bms_bms6_cel_03_voltage
  5339.                 name: '3'
  5340.                 float_precision: 3
  5341.               - entity: sensor.pace_bms_bms6_cel_04_voltage
  5342.                 name: '4'
  5343.                 float_precision: 3
  5344.               - entity: sensor.pace_bms_bms6_cel_05_voltage
  5345.                 name: '5'
  5346.                 float_precision: 3
  5347.               - entity: sensor.pace_bms_bms6_cel_06_voltage
  5348.                 name: '6'
  5349.                 float_precision: 3
  5350.               - entity: sensor.pace_bms_bms6_cel_07_voltage
  5351.                 name: '7'
  5352.                 float_precision: 3
  5353.               - entity: sensor.pace_bms_bms6_cel_08_voltage
  5354.                 name: '8'
  5355.                 float_precision: 3
  5356.               - entity: sensor.pace_bms_bms6_cel_09_voltage
  5357.                 name: '9'
  5358.                 float_precision: 3
  5359.               - entity: sensor.pace_bms_bms6_cel_10_voltage
  5360.                 name: '10'
  5361.                 float_precision: 3
  5362.               - entity: sensor.pace_bms_bms6_cel_11_voltage
  5363.                 name: '11'
  5364.                 float_precision: 3
  5365.               - entity: sensor.pace_bms_bms6_cel_12_voltage
  5366.                 name: '12'
  5367.                 float_precision: 3
  5368.               - entity: sensor.pace_bms_bms6_cel_13_voltage
  5369.                 name: '13'
  5370.                 float_precision: 3
  5371.               - entity: sensor.pace_bms_bms6_cel_14_voltage
  5372.                 name: '14'
  5373.                 float_precision: 3
  5374.               - entity: sensor.pace_bms_bms6_cel_15_voltage
  5375.                 name: '15'
  5376.                 float_precision: 3
  5377.               - entity: sensor.pace_bms_bms6_cel_16_voltage
  5378.                 name: '16'
  5379.                 float_precision: 3
  5380.             yaxis:
  5381.               - min: '|-0.01|'
  5382.                 max: '|+0.01|'
  5383.                 decimals: 3
  5384.             grid_options:
  5385.               columns: full
  5386.           - type: custom:apexcharts-card
  5387.             header:
  5388.               show: true
  5389.               title: Stroom & SOC (24 u)
  5390.               show_states: true
  5391.               colorize_states: true
  5392.             graph_span: 24h
  5393.             apex_config:
  5394.               chart:
  5395.                 height: 260
  5396.                 toolbar:
  5397.                   show: false
  5398.               legend:
  5399.                 show: false
  5400.                 fontSize: 11px
  5401.               tooltip:
  5402.                 shared: true
  5403.                 intersect: false
  5404.               xaxis:
  5405.                 tooltip:
  5406.                   enabled: false
  5407.             all_series_config:
  5408.               stroke_width: 1.5
  5409.               curve: smooth
  5410.               group_by:
  5411.                 func: avg
  5412.                 duration: 5min
  5413.                 fill: last
  5414.             series:
  5415.               - entity: sensor.pace_bms_bms6_current
  5416.                 name: Stroom
  5417.                 float_precision: 1
  5418.                 yaxis_id: a
  5419.                 color: '#00BCD4'
  5420.               - entity: sensor.pace_bms_bms6_soc
  5421.                 name: SOC
  5422.                 float_precision: 0
  5423.                 yaxis_id: soc
  5424.                 color: '#9e9e9e'
  5425.               - entity: sensor.coulomb_bms6_soc
  5426.                 name: Coulomb SOC
  5427.                 float_precision: 1
  5428.                 yaxis_id: soc
  5429.                 color: '#00BCD4'
  5430.             yaxis:
  5431.               - id: a
  5432.                 decimals: 1
  5433.               - id: soc
  5434.                 opposite: true
  5435.                 min: 0
  5436.                 max: 100
  5437.                 decimals: 0
  5438.             grid_options:
  5439.               columns: 18
  5440.           - type: custom:apexcharts-card
  5441.             header:
  5442.               show: true
  5443.               title: Temperaturen (24 u)
  5444.               show_states: true
  5445.               colorize_states: true
  5446.             graph_span: 24h
  5447.             apex_config:
  5448.               chart:
  5449.                 height: 260
  5450.                 toolbar:
  5451.                   show: false
  5452.               legend:
  5453.                 show: false
  5454.                 fontSize: 11px
  5455.               tooltip:
  5456.                 shared: true
  5457.                 intersect: false
  5458.               xaxis:
  5459.                 tooltip:
  5460.                   enabled: false
  5461.             all_series_config:
  5462.               stroke_width: 1.5
  5463.               curve: smooth
  5464.               group_by:
  5465.                 func: avg
  5466.                 duration: 5min
  5467.                 fill: last
  5468.             series:
  5469.               - entity: sensor.pace_bms_bms6_temperatuur_1
  5470.                 name: T1
  5471.                 float_precision: 1
  5472.                 color: '#ef5350'
  5473.               - entity: sensor.pace_bms_bms6_temperatuur_2
  5474.                 name: T2
  5475.                 float_precision: 1
  5476.                 color: '#ffa726'
  5477.               - entity: sensor.pace_bms_bms6_temperatuur_3
  5478.                 name: T3
  5479.                 float_precision: 1
  5480.                 color: '#66bb6a'
  5481.               - entity: sensor.pace_bms_bms6_temperatuur_4
  5482.                 name: T4
  5483.                 float_precision: 1
  5484.                 color: '#42a5f5'
  5485.               - entity: sensor.pace_bms_bms6_environment_temperature
  5486.                 name: Omg.
  5487.                 float_precision: 1
  5488.                 color: '#9e9e9e'
  5489.             yaxis:
  5490.               - decimals: 1
  5491.             grid_options:
  5492.               columns: 18
  5493.  
Add Comment
Please, Sign In to add comment