找回密码
 立即注册

微信扫码登录

搜索
楼主: norikohxb

[技术探讨] 刀片电池光伏储能希望听到大家的意见

[复制链接]

1

主题

38

回帖

458

积分

中级会员

积分
458
金钱
419
HASS币
0
发表于 2025-6-20 17:51:29 | 显示全部楼层
drj 发表于 2025-6-16 12:03
保护板用的基站拓邦的电池用的拆机宁德时代来玩阿

大佬,请问一下,哪个光伏 发电的 有五个圆圈的那个图代码能不能贴一下?我都不知道叫啥名字
回复

使用道具 举报

drj 手机认证

0

主题

8

回帖

119

积分

注册会员

积分
119
金钱
111
HASS币
0
发表于 2025-7-6 19:09:32 | 显示全部楼层
威风八面小怪兽 发表于 2025-6-20 17:51
大佬,请问一下,哪个光伏 发电的 有五个圆圈的那个图代码能不能贴一下?我都不知道叫啥名字 ...

type: vertical-stack
cards:
  - type: horizontal-stack
    cards:
      - type: gauge
        entity: sensor.boqiang_ems_group
        needle: true
        severity:
          green: 80
          yellow: 40
          red: 0
        name: 拓邦
      - type: custom:button-card
        entity: sensor.boqiang_ems_group
        aspect_ratio: 1/1
        name: " "
        styles:
          card:
            - border-radius: 10%
            - padding: 10%
            - font-size: 10px
            - text-transform: capitalize
          grid:
            - grid-template-areas: >-
                "i state" "n n" "voltage voltage" "current current" "power
                power"
            - grid-template-columns: 1fr 1fr
            - grid-template-rows: 1fr min-content min-content min-content min-content
          name:
            - font-weight: bold
            - font-size: 20px
            - align-self: middle
            - justify-self: start
            - padding-bottom: 4px
          img_cell:
            - justify-content: start
            - align-items: start
            - margin: none
          icon:
            - width: 50%
            - margin-top: "-10%"
          custom_fields:
            state:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 18px
            voltage:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 16px
            current:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 16px
              - "--text-color-sensor": >-
                  [[[ if (states["sensor.boqiang_ems_group_current"].state >= 60
                  || states["sensor.boqiang_ems_group_current"].state <= -60 )
                  return "red"; else if
                  (states["sensor.boqiang_ems_group_current"].state >= 30 ||
                  states["sensor.boqiang_ems_group_current"].state <= -30 )
                  return "orange"; ]]]
            power:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 16px
        custom_fields:
          state: |
            [[[
              return `<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_group_state'].state}</span>`
            ]]]
          voltage: |
            [[[
              return `<ha-icon
                  icon="mdi:sine-wave"
                  style="width: 16px; height: 16px; color: deepskyblue;">
                  </ha-icon><span>电压:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_group_voltage'].state} V</span></span>`
            ]]]
          current: |
            [[[
              return `<ha-icon
                  icon="mdi:current-dc"
                  style="width: 16px; height: 16px; color: deepskyblue;">
                  </ha-icon><span>电流:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_group_current'].state} A</span></span>`
            ]]]
          power: |
            [[[
              return `<ha-icon
                  icon="mdi:lightning-bolt"
                  style="width: 16px; height: 16px; color: deepskyblue;">
                  </ha-icon><span>功率:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_group_power'].state} W</span></span>`
            ]]]
  - square: false
    type: grid
    cards:
      - type: custom:button-card
        entity: sensor.boqiang_ems_pack1
        aspect_ratio: 1/1.8
        name: 1#电池
        styles:
          card:
            - border-radius: 10%
            - padding: 10%
            - font-size: 10px
            - text-transform: capitalize
          grid:
            - grid-template-areas: >-
                "i capacity" "n n" "state state" "current current" "voltage
                voltage" "cellmaxv cellmaxv" "cellminv cellminv" "celldifv
                celldifv"
            - grid-template-columns: 1fr 1fr
            - grid-template-rows: 1fr min-content min-content min-content min-content
          name:
            - font-weight: bold
            - font-size: 14px
            - align-self: middle
            - justify-self: start
            - padding-bottom: 4px
          img_cell:
            - justify-content: start
            - align-items: start
            - margin: none
          icon:
            - color: |
                [[[
                  if (entity.state >= 80) return 'green'; else
                  if (entity.state >= 40) return 'orange'; else
                  return 'red';
                ]]]
            - width: 70%
            - margin-top: "-10%"
          custom_fields:
            capacity:
              - align-self: start
              - justify-self: end
              - font-size: 18px
            state:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
            current:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
              - "--text-color-sensor": >-
                  [[[ if (states["sensor.boqiang_ems_pack1_current"] >= 20 ||
                  states["sensor.boqiang_ems_pack1_current"] <= -20 ) return
                  "red"; else if
                  (states["sensor.boqiang_ems_pack1_current"].state >= 15 ||
                  states["sensor.boqiang_ems_pack1_current"].state <= -15 )
                  return "orange"; ]]]
            voltage:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
            cellmaxv:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
            cellminv:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
            celldifv:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
        custom_fields:
          capacity: |
            [[[
              return `<span>${entity.state}%</span>`
            ]]]
          state: |
            [[[
              return `<span>状态:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack1_state'].state}</span></span>`
            ]]]
          current: |
            [[[
              return `<ha-icon
              icon="mdi:current-dc"
              style="width: 13px; height: 13px; color: deepskyblue;">
              </ha-icon><span>电流:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack1_current'].state}A</span></span>`
            ]]]
          voltage: |
            [[[
              return `<ha-icon
              icon="mdi:sine-wave"
              style="width: 12px; height: 12px; color: deepskyblue;">
              </ha-icon><span>电压:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack1_voltage'].state}V</span></span>`
            ]]]
          cellmaxv: |
            [[[
              return `<ha-icon
              icon="mdi:sine-wave"
              style="width: 12px; height: 12px; color: deepskyblue;">
              </ha-icon><span>maxV:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack1_cellmaxv'].state}mV</span></span>`
            ]]]
          cellminv: |
            [[[
              return `<ha-icon
              icon="mdi:sine-wave"
              style="width: 12px; height: 12px; color: deepskyblue;">
              </ha-icon><span>minV:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack1_cellminv'].state}mV</span></span>`
            ]]]
          celldifv: |
            [[[
              return `<ha-icon
              icon="mdi:sine-wave"
              style="width: 12px; height: 12px; color: deepskyblue;">
              </ha-icon><span>ΔV:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack1_celldifv'].state}mV</span></span>`
            ]]]
      - type: custom:button-card
        entity: sensor.boqiang_ems_pack2
        aspect_ratio: 1/1.8
        name: 2#电池
        styles:
          card:
            - border-radius: 10%
            - padding: 10%
            - font-size: 10px
            - text-transform: capitalize
          grid:
            - grid-template-areas: >-
                "i capacity" "n n" "state state" "current current" "voltage
                voltage" "cellmaxv cellmaxv" "cellminv cellminv" "celldifv
                celldifv"
            - grid-template-columns: 1fr 1fr
            - grid-template-rows: 1fr min-content min-content min-content min-content
          name:
            - font-weight: bold
            - font-size: 14px
            - align-self: middle
            - justify-self: start
            - padding-bottom: 4px
          img_cell:
            - justify-content: start
            - align-items: start
            - margin: none
          icon:
            - color: |
                [[[
                  if (entity.state >= 80) return 'green'; else
                  if (entity.state >= 40) return 'orange'; else
                  return 'red';
                ]]]
            - width: 70%
            - margin-top: "-10%"
          custom_fields:
            capacity:
              - align-self: start
              - justify-self: end
              - font-size: 18px
            state:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
            current:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
              - "--text-color-sensor": >-
                  [[[ if (states["sensor.boqiang_ems_pack2_current"] >= 20 ||
                  states["sensor.boqiang_ems_pack2_current"] <= -20 ) return
                  "red"; else if
                  (states["sensor.boqiang_ems_pack2_current"].state >= 15 ||
                  states["sensor.boqiang_ems_pack2_current"].state <= -15 )
                  return "orange"; ]]]
            voltage:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
            cellmaxv:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
            cellminv:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
            celldifv:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
        custom_fields:
          capacity: |
            [[[
              return `<span>${entity.state}%</span>`
            ]]]
          state: |
            [[[
              return `<span>状态:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack2_state'].state}</span></span>`
            ]]]
          current: |
            [[[
              return `<ha-icon
              icon="mdi:current-dc"
              style="width: 13px; height: 13px; color: deepskyblue;">
              </ha-icon><span>电流:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack2_current'].state}A</span></span>`
            ]]]
          voltage: |
            [[[
              return `<ha-icon
              icon="mdi:sine-wave"
              style="width: 13px; height: 13px; color: deepskyblue;">
              </ha-icon><span>电压:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack2_voltage'].state}V</span></span>`
            ]]]
          cellmaxv: |
            [[[
              return `<ha-icon
              icon="mdi:sine-wave"
              style="width: 12px; height: 12px; color: deepskyblue;">
              </ha-icon><span>maxV:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack2_cellmaxv'].state}mV</span></span>`
            ]]]
          cellminv: |
            [[[
              return `<ha-icon
              icon="mdi:sine-wave"
              style="width: 12px; height: 12px; color: deepskyblue;">
              </ha-icon><span>minV:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack2_cellminv'].state}mV</span></span>`
            ]]]
          celldifv: |
            [[[
              return `<ha-icon
              icon="mdi:sine-wave"
              style="width: 12px; height: 12px; color: deepskyblue;">
              </ha-icon><span>ΔV:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack2_celldifv'].state}mV</span></span>`
            ]]]
      - type: custom:button-card
        entity: sensor.boqiang_ems_pack3
        aspect_ratio: 1/1.8
        name: 3#电池
        styles:
          card:
            - border-radius: 10%
            - padding: 10%
            - font-size: 10px
            - text-transform: capitalize
          grid:
            - grid-template-areas: >-
                "i capacity" "n n" "state state" "current current" "voltage
                voltage" "cellmaxv cellmaxv" "cellminv cellminv" "celldifv
                celldifv"
            - grid-template-columns: 1fr 1fr
            - grid-template-rows: 1fr min-content min-content min-content min-content
          name:
            - font-weight: bold
            - font-size: 14px
            - align-self: middle
            - justify-self: start
            - padding-bottom: 4px
          img_cell:
            - justify-content: start
            - align-items: start
            - margin: none
          icon:
            - color: |
                [[[
                  if (entity.state >= 80) return 'green'; else
                  if (entity.state >= 40) return 'orange'; else
                  return 'red';
                ]]]
            - width: 70%
            - margin-top: "-10%"
          custom_fields:
            capacity:
              - align-self: start
              - justify-self: end
              - font-size: 18px
            state:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
            current:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
              - "--text-color-sensor": >-
                  [[[ if (states["sensor.boqiang_ems_pack3_current"] >= 20 ||
                  states["sensor.boqiang_ems_pack3_current"] <= -20 ) return
                  "red"; else if
                  (states["sensor.boqiang_ems_pack3_current"].state >= 15 ||
                  states["sensor.boqiang_ems_pack3_current"].state <= -15 )
                  return "orange"; ]]]
            voltage:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
            cellmaxv:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
            cellminv:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
            celldifv:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
        custom_fields:
          capacity: |
            [[[
              return `<span>${entity.state}%</span>`
            ]]]
          state: |
            [[[
              return `<span>状态:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack3_state'].state}</span></span>`
            ]]]
          current: |
            [[[
              return `<ha-icon
              icon="mdi:current-dc"
              style="width: 13px; height: 13px; color: deepskyblue;">
              </ha-icon><span>电流:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack3_current'].state}A</span></span>`
            ]]]
          voltage: |
            [[[
              return `<ha-icon
              icon="mdi:sine-wave"
              style="width: 13px; height: 13px; color: deepskyblue;">
              </ha-icon><span>电压:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack3_voltage'].state}V</span></span>`
            ]]]
          cellmaxv: |
            [[[
              return `<ha-icon
              icon="mdi:sine-wave"
              style="width: 12px; height: 12px; color: deepskyblue;">
              </ha-icon><span>maxV:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack3_cellmaxv'].state}mV</span></span>`
            ]]]
          cellminv: |
            [[[
              return `<ha-icon
              icon="mdi:sine-wave"
              style="width: 12px; height: 12px; color: deepskyblue;">
              </ha-icon><span>minV:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack3_cellminv'].state}mV</span></span>`
            ]]]
          celldifv: |
            [[[
              return `<ha-icon
              icon="mdi:sine-wave"
              style="width: 12px; height: 12px; color: deepskyblue;">
              </ha-icon><span>ΔV:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack3_celldifv'].state}mV</span></span>`
            ]]]
      - type: custom:button-card
        entity: sensor.boqiang_ems_pack4
        aspect_ratio: 1/1.8
        name: 4#电池
        styles:
          card:
            - border-radius: 10%
            - padding: 10%
            - font-size: 10px
            - text-transform: capitalize
          grid:
            - grid-template-areas: >-
                "i capacity" "n n" "state state" "current current" "voltage
                voltage" "cellmaxv cellmaxv" "cellminv cellminv" "celldifv
                celldifv"
            - grid-template-columns: 1fr 1fr
            - grid-template-rows: 1fr min-content min-content min-content min-content
          name:
            - font-weight: bold
            - font-size: 14px
            - align-self: middle
            - justify-self: start
            - padding-bottom: 4px
          img_cell:
            - justify-content: start
            - align-items: start
            - margin: none
          icon:
            - color: |
                [[[
                  if (entity.state >= 80) return 'green'; else
                  if (entity.state >= 40) return 'orange'; else
                  return 'red';
                ]]]
            - width: 70%
            - margin-top: "-10%"
          custom_fields:
            capacity:
              - align-self: start
              - justify-self: end
              - font-size: 18px
            state:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
            current:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
              - "--text-color-sensor": >-
                  [[[ if (states["sensor.boqiang_ems_pack4_current"] >= 20 ||
                  states["sensor.boqiang_ems_pack4_current"] <= -20 ) return
                  "red"; else if
                  (states["sensor.boqiang_ems_pack4_current"].state >= 15 ||
                  states["sensor.boqiang_ems_pack4_current"].state <= -15 )
                  return "orange"; ]]]
            voltage:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
            cellmaxv:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
            cellminv:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
            celldifv:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
        custom_fields:
          capacity: |
            [[[
              return `<span>${entity.state}%</span>`
            ]]]
          state: |
            [[[
              return `<span>状态:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack4_state'].state}</span></span>`
            ]]]
          current: |
            [[[
              return `<ha-icon
              icon="mdi:current-dc"
              style="width: 13px; height: 13px; color: deepskyblue;">
              </ha-icon><span>电流:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack4_current'].state}A</span></span>`
            ]]]
          voltage: |
            [[[
              return `<ha-icon
              icon="mdi:sine-wave"
              style="width: 13px; height: 13px; color: deepskyblue;">
              </ha-icon><span>电压:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack4_voltage'].state}V</span></span>`
            ]]]
          cellmaxv: |
            [[[
              return `<ha-icon
              icon="mdi:sine-wave"
              style="width: 12px; height: 12px; color: deepskyblue;">
              </ha-icon><span>maxV:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack4_cellmaxv'].state}mV</span></span>`
            ]]]
          cellminv: |
            [[[
              return `<ha-icon
              icon="mdi:sine-wave"
              style="width: 12px; height: 12px; color: deepskyblue;">
              </ha-icon><span>minV:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack4_cellminv'].state}mV</span></span>`
            ]]]
          celldifv: |
            [[[
              return `<ha-icon
              icon="mdi:sine-wave"
              style="width: 12px; height: 12px; color: deepskyblue;">
              </ha-icon><span>ΔV:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack4_celldifv'].state}mV</span></span>`
            ]]]
      - type: custom:button-card
        entity: sensor.boqiang_ems_pack5
        aspect_ratio: 1/1.8
        name: 5#电池
        styles:
          card:
            - border-radius: 10%
            - padding: 10%
            - font-size: 10px
            - text-transform: capitalize
          grid:
            - grid-template-areas: >-
                "i capacity" "n n" "state state" "current current" "voltage
                voltage" "cellmaxv cellmaxv" "cellminv cellminv" "celldifv
                celldifv"
            - grid-template-columns: 1fr 1fr
            - grid-template-rows: 1fr min-content min-content min-content min-content
          name:
            - font-weight: bold
            - font-size: 14px
            - align-self: middle
            - justify-self: start
            - padding-bottom: 4px
          img_cell:
            - justify-content: start
            - align-items: start
            - margin: none
          icon:
            - color: |
                [[[
                  if (entity.state >= 80) return 'green'; else
                  if (entity.state >= 40) return 'orange'; else
                  return 'red';
                ]]]
            - width: 70%
            - margin-top: "-10%"
          custom_fields:
            capacity:
              - align-self: start
              - justify-self: end
              - font-size: 18px
            state:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
            current:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
              - "--text-color-sensor": >-
                  [[[ if (states["sensor.boqiang_ems_pack5_current"] >= 20 ||
                  states["sensor.boqiang_ems_pack5_current"] <= -20 ) return
                  "red"; else if
                  (states["sensor.boqiang_ems_pack5_current"].state >= 15 ||
                  states["sensor.boqiang_ems_pack5_current"].state <= -15 )
                  return "orange"; ]]]
            voltage:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
            cellmaxv:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
            cellminv:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
            celldifv:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
        custom_fields:
          capacity: |
            [[[
              return `<span>${entity.state}%</span>`
            ]]]
          state: |
            [[[
              return `<span>状态:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack5_state'].state}</span></span>`
            ]]]
          current: |
            [[[
              return `<ha-icon
              icon="mdi:current-dc"
              style="width: 13px; height: 13px; color: deepskyblue;">
              </ha-icon><span>电流:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack5_current'].state}A</span></span>`
            ]]]
          voltage: |
            [[[
              return `<ha-icon
              icon="mdi:sine-wave"
              style="width: 13px; height: 13px; color: deepskyblue;">
              </ha-icon><span>电压:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack5_voltage'].state}V</span></span>`
            ]]]
          cellmaxv: |
            [[[
              return `<ha-icon
              icon="mdi:sine-wave"
              style="width: 12px; height: 12px; color: deepskyblue;">
              </ha-icon><span>maxV:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack5_cellmaxv'].state}mV</span></span>`
            ]]]
          cellminv: |
            [[[
              return `<ha-icon
              icon="mdi:sine-wave"
              style="width: 12px; height: 12px; color: deepskyblue;">
              </ha-icon><span>minV:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack5_cellminv'].state}mV</span></span>`
            ]]]
          celldifv: |
            [[[
              return `<ha-icon
              icon="mdi:sine-wave"
              style="width: 12px; height: 12px; color: deepskyblue;">
              </ha-icon><span>ΔV:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack5_celldifv'].state}mV</span></span>`
            ]]]
      - type: custom:button-card
        entity: sensor.boqiang_ems_pack6
        aspect_ratio: 1/1.8
        name: 6#电池
        styles:
          card:
            - border-radius: 10%
            - padding: 10%
            - font-size: 10px
            - text-transform: capitalize
          grid:
            - grid-template-areas: >-
                "i capacity" "n n" "state state" "current current" "voltage
                voltage" "cellmaxv cellmaxv" "cellminv cellminv" "celldifv
                celldifv"
            - grid-template-columns: 1fr 1fr
            - grid-template-rows: 1fr min-content min-content min-content min-content
          name:
            - font-weight: bold
            - font-size: 14px
            - align-self: middle
            - justify-self: start
            - padding-bottom: 4px
          img_cell:
            - justify-content: start
            - align-items: start
            - margin: none
          icon:
            - color: |
                [[[
                  if (entity.state >= 80) return 'green'; else
                  if (entity.state >= 40) return 'orange'; else
                  return 'red';
                ]]]
            - width: 70%
            - margin-top: "-10%"
          custom_fields:
            capacity:
              - align-self: start
              - justify-self: end
              - font-size: 18px
            state:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
            current:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
              - "--text-color-sensor": >-
                  [[[ if (states["sensor.boqiang_ems_pack6_current"] >= 20 ||
                  states["sensor.boqiang_ems_pack6_current"] <= -20 ) return
                  "red"; else if
                  (states["sensor.boqiang_ems_pack6_current"].state >= 15 ||
                  states["sensor.boqiang_ems_pack6_current"].state <= -15 )
                  return "orange"; ]]]
            voltage:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
            cellmaxv:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
            cellminv:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
            celldifv:
              - padding-bottom: 2px
              - align-self: middle
              - justify-self: start
              - font-size: 13px
        custom_fields:
          capacity: |
            [[[
              return `<span>${entity.state}%</span>`
            ]]]
          state: |
            [[[
              return `<span>状态:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack6_state'].state}</span></span>`
            ]]]
          current: |
            [[[
              return `<ha-icon
              icon="mdi:current-dc"
              style="width: 13px; height: 13px; color: deepskyblue;">
              </ha-icon><span>电流:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack6_current'].state}A</span></span>`
            ]]]
          voltage: |
            [[[
              return `<ha-icon
              icon="mdi:sine-wave"
              style="width: 13px; height: 13px; color: deepskyblue;">
              </ha-icon><span>电压:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack6_voltage'].state}V</span></span>`
            ]]]
          cellmaxv: |
            [[[
              return `<ha-icon
              icon="mdi:sine-wave"
              style="width: 12px; height: 12px; color: deepskyblue;">
              </ha-icon><span>maxV:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack6_cellmaxv'].state}mV</span></span>`
            ]]]
          cellminv: |
            [[[
              return `<ha-icon
              icon="mdi:sine-wave"
              style="width: 12px; height: 12px; color: deepskyblue;">
              </ha-icon><span>minV:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack6_cellminv'].state}mV</span></span>`
            ]]]
          celldifv: |
            [[[
              return `<ha-icon
              icon="mdi:sine-wave"
              style="width: 12px; height: 12px; color: deepskyblue;">
              </ha-icon><span>ΔV:<span style="color: var(--text-color-sensor);">${states['sensor.boqiang_ems_pack6_celldifv'].state}mV</span></span>`
            ]]]
    columns: 3
回复

使用道具 举报

drj 手机认证

0

主题

8

回帖

119

积分

注册会员

积分
119
金钱
111
HASS币
0
发表于 2025-7-6 19:10:38 | 显示全部楼层
zhmw09 发表于 2025-6-20 16:20
你好,我一直想把我的电池和逆变器接入HA,但一直没找到方案,今天看了你这个,很有兴趣,想加个好友,请 ...

1475140134🐧
回复

使用道具 举报

10

主题

61

回帖

1493

积分

金牌会员

积分
1493
金钱
1422
HASS币
0
发表于 7 天前 | 显示全部楼层
极空保护板:https://github.com/txubelaxu/esphome-jk-bms/
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian ( 晋ICP备17001384号-1 )

GMT+8, 2025-7-16 14:54 , Processed in 0.079003 second(s), 9 queries , MemCached On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表