Chia sẻ- YAML Dashboard HomeAssistant của TranBach

Các addon cần cài trên HACS
* Bubble Card
* Sunsink-power-flow-card
* Number-box
* Flexible Horseshoe card
Ngoài ra còn cần một số biến trợ giúp để hỗ trợ hiển thị, cái này các bạn tự tìm hiểu. Không dùng được kiểu của mình các bạn đọc tài liệu có thể tự custom kiểu khác cho chính bạn. bởi vì thực thể trong home assistant không ai giống ai.

Dưới đây là code YAML Dashboard

title: Solar Mobi
cards: []
visible:
  - user: 24ebe9c3cd5b46e38c4e0b67e26bbf7a
  - user: 045ec7a8ea5a449b8ac9a6fd8742cbb1
  - user: a12b7ed30ec448c0b17d1ac04c3e1886
icon: mdi:cellphone
type: sections
sections:
  - type: grid
    cards:
      - type: custom:sunsynk-power-flow-card
        cardstyle: full
        show_solar: true
        battery:
          shutdown_soc: 15
          show_daily: true
          shutdown_soc_offgrid: 14
          linear_gradient: false
          dynamic_colour: false
          animate: false
          show_remaining_energy: true
          invert_power: true
          auto_scale: false
          show_absolute: true
          colour:
            - 57
            - 210
            - 15
          charge_colour:
            - 70
            - 197
            - 2
          energy: 6240
          hide_soc: true
          count: 2
        solar:
          show_daily: true
          mppts: 2
          max_power: 6300
          auto_scale: false
          dynamic_colour: true
          display_mode: 2
          pv1_max_power: 3150
          pv2_max_power: 3150
        load:
          show_daily: true
          dynamic_colour: false
          essential_name: Nhà
          dynamic_icon: true
          colour:
            - 28
            - 167
            - 227
          auto_scale: false
          label_daily_load: Tiêu thụ
        grid:
          show_daily_buy: true
          show_daily_sell: true
          show_nonessential: false
          grid_name: EVN
          label_daily_grid_buy: Mua về
          auto_scale: false
          invert_grid: false
          label_daily_grid_sell: Đẩy lưới
          no_grid_colour:
            - 145
            - 145
            - 145
          colour:
            - 219
            - 15
            - 15
          grid_off_colour:
            - 135
            - 135
            - 135
          show_absolute: true
        entities:
          use_timer_248: switch.esp_inverter_toggle_system_timer
          priority_load_243: switch.esp_inverter_toggle_priority_load
          inverter_voltage_154: sensor.esp_inverter_inverter_voltage
          inverter_current_164: sensor.esp_inverter_inverter_current
          inverter_power_175: sensor.esp_inverter_inverter_power
          grid_connected_status_194: binary_sensor.esp_inverter_grid_connected_status
          inverter_status_59: sensor.esp_inverter_overall_state
          day_battery_charge_70: sensor.esp_inverter_day_battery_charge
          day_battery_discharge_71: sensor.esp_inverter_day_battery_discharge
          battery_voltage_183: sensor.jk_bms_total_voltage
          battery_power_190: sensor.jk_bms_power
          battery_current_191: sensor.jk_bms_current
          grid_power_169: sensor.esp_inverter_grid_power
          day_grid_import_76: sensor.esp_inverter_day_grid_import
          day_grid_export_77: sensor.esp_inverter_day_grid_export
          grid_ct_power_172: sensor.esp_inverter_grid_ct_power
          essential_power: sensor.esp_inverter_essential_power_1
          nonessential_power: sensor.esp_inverter_nonessential_power
          aux_power_166: sensor.esp_inverter_aux_power
          day_pv_energy_108: sensor.esp_inverter_day_pv_energy
          pv1_power_186: sensor.esp_inverter_pv1_power
          pv2_power_187: sensor.esp_inverter_pv2_power
          pv1_voltage_109: sensor.esp_inverter_pv1_voltage
          pv1_current_110: sensor.esp_inverter_pv1_current
          pv2_voltage_111: sensor.esp_inverter_pv2_voltage
          pv2_current_112: sensor.esp_inverter_pv2_current
          battery_temp_182: sensor.jk_bms_power_tube_temperature
          load_frequency_192: sensor.esp_inverter_grid_frequency
          dc_transformer_temp_90: sensor.esp_inverter_dc_transformer_temperature
          radiator_temp_91: sensor.esp_inverter_radiator_temperature
          prog1_time: sensor.esp_inverter_prog1_time
          prog1_capacity: number.esp_inverter_prog1_capacity
          day_load_energy_84: sensor.tong_tieu_thu
          load_power_L1: sensor.esp_inverter_load_l1_power
          grid_voltage: sensor.esp_inverter_grid_voltage
          prog1_charge: switch.esp_inverter_prog1_grid_charge
          prog2_time: sensor.esp_inverter_prog2_time
          prog3_time: sensor.esp_inverter_prog3_time
          prog4_time: sensor.esp_inverter_prog4_time
          prog5_time: sensor.esp_inverter_prog5_time
          prog6_time: sensor.esp_inverter_prog6_time
          prog6_charge: switch.esp_inverter_prog6_grid_charge
          prog6_capacity: number.esp_inverter_prog6_capacity
          prog5_capacity: number.esp_inverter_prog5_capacity
          prog4_capacity: number.esp_inverter_prog4_capacity
          prog3_capacity: number.esp_inverter_prog3_capacity
          prog2_capacity: number.esp_inverter_prog2_capacity
          prog2_charge: switch.esp_inverter_prog2_grid_charge
          prog3_charge: switch.esp_inverter_prog3_grid_charge
          prog4_charge: switch.esp_inverter_prog4_grid_charge
          prog5_charge: switch.esp_inverter_prog5_grid_charge
          grid_ct_power_total: sensor.esp_inverter_grid_ct_power
          remaining_solar: sensor.energy_production_today_remaining
          environment_temp: sensor.cam_bien_nhiet_do_2_nhi_t
          battery2_soc_184: sensor.jk_130_state_of_charge
          battery_soc_184: sensor.jk_bms_state_of_charge
          battery2_rated_capacity: sensor.jk_130_capacity_remaining
          battery_rated_capacity: sensor.jk_bms_capacity_remaining
          battery2_power_190: sensor.jk_130_power
          battery2_current_191: sensor.jk_130_current
          battery2_temp_182: sensor.jk_130_power_tube_temperature
          battery2_voltage_183: sensor.jk_130_total_voltage
        large_font: true
        panel_mode: true
        show_battery: true
        show_grid: true
        max_line_width: 20
        min_line_width: 3
        inverter:
          modern: false
          three_phase: false
          auto_scale: false
          autarky: power
          model: ces-battery-box
        title_colour:
          - 168
          - 52
          - 52
        title_size: "8"
        decimal_places: 0
        dynamic_line_width: false
        decimal_places_energy: 1
        wide: true
        grid_options:
          columns: 36
          rows: auto
        battery2:
          energy: 13400
          shutdown_soc: 15
          shutdown_soc_offgrid: 20
          colour:
            - 240
            - 178
            - 92
          charge_colour:
            - 240
            - 199
            - 51
          invert_power: true
          show_absolute: true
          dynamic_colour: false
          animate: false
          linear_gradient: false
      - type: vertical-stack
        cards:
          - type: markdown
            content: >+
              <ha-alert alert-type="info" title="Đến thời điểm này">*Sản lượng*
              điện hôm nay là **{{ states('sensor.esp_inverter_day_pv_energy')
              }}**/**{{ states('sensor.energy_production_today') | float |
              round(1) }}** kWh dự báo. *Tổng tiêu thụ* là **{{
              states('sensor.tong_tieu_thu')  | float | round(1)}}** kWh, trong
              đó:

              Tự dùng 🔅   | **{{ states('sensor.tu_su_dung') | float | round(2)
              }}**   | **{{ states('sensor.tu_dung_thang') | float | round(2)
              }}**       

              Sạc Pin ⚡️| **{{ states('sensor.esp_inverter_day_battery_charge')
              }}**   | **{{ states('sensor.sac_pin_thang') | float | round(2)
              }}**    

              Xả Pin 🪫    | **{{
              states('sensor.esp_inverter_day_battery_discharge') | float |
              round(2) }}**   | **{{ states('sensor.xa_pin_thang') | float |
              round(2) }}**  

              Mua về 💲 | **{{ states('sensor.esp_inverter_day_grid_import')
              }}**   | **{{ states('sensor.dien_mua_evn_ch') | float | round(2)
              }}**    

          - type: markdown
            content: >-
              <ha-alert alert-type="success">Bạn phải trả **{{
              states('sensor.hien_thi_tien_wo_solar') }} VNĐ**
              ({{states('sensor.tong_tieu_thu_thang_ct2') }} kWh) cho EVN nếu
              không tự sản xuất được sản lượng trị giá **{{
              states('sensor.hien_thi_tien') }} VNĐ**
              ({{states('sensor.tu_dung_xa_pin') }} kWh)

              Hiện tại bạn phải *trả EVN* tạm tính là **{{
              states('sensor.hien_thi_tien_evn') }} VNĐ** 

              (*TH:* **{{ states('sensor.pc10mm0900203_ecost_monthly_new') }}
              VNĐ** {{states('sensor.dien_mua_evn_th') | float | round(1) }} kWh
              | *CH:* **{{ states('sensor.pc10mm0965997_ecost_monthly_new') }}
              VNĐ** {{states('sensor.dien_mua_evn_ch') | float | round(1) }}
              kWh)

              Dự báo *hôm nay còn lại* **{{
              states('sensor.energy_production_today_remaining')  | float |
              round(1) }}** kW và *ngày mai* sản lượng đạt được **{{
              states('sensor.energy_production_tomorrow')  | float | round(1)
              }}** kWh </ha-alert>
        grid_options:
          columns: 12
          rows: auto
      - type: vertical-stack
        cards:
          - type: custom:apexcharts-card
            experimental:
              color_threshold: true
              brush: true
            graph_span: 3h
            brush:
              selection_span: 30m
              apex_config: null
            series:
              - entity: sensor.tong_pv
                color: blue
                type: area
                stroke_width: 1
                color_threshold:
                  - value: 4000
                    color: red
                  - value: 2500
                    color: yellow
                  - value: 1500
                    color: green
              - entity: sensor.tong_pv
                color: red
                stroke_width: 1
                float_precision: 0
                show:
                  in_brush: true
                  in_chart: false
            update_interval: 10s
        visibility:
          - condition: numeric_state
            entity: sensor.tong_pv
            above: 50
    column_span: 2
  - type: grid
    cards:
      - type: custom:weather-chart-card
        entity: weather.forecast_nha
        show_main: false
        show_temperature: false
        show_current_condition: false
        show_attributes: false
        show_time: false
        show_time_seconds: false
        show_day: false
        show_date: false
        show_humidity: false
        show_pressure: false
        show_wind_direction: false
        show_wind_speed: false
        show_sun: false
        show_feels_like: false
        show_dew_point: false
        show_wind_gust_speed: false
        show_visibility: false
        show_last_changed: false
        use_12hour_format: false
        icons_size: "50"
        animated_icons: true
        icon_style: style1
        autoscroll: false
        forecast:
          precipitation_type: rainfall
          show_probability: false
          labels_font_size: "11"
          precip_bar_size: "100"
          style: style2
          show_wind_forecast: true
          condition_icons: true
          round_temp: false
          type: daily
          number_of_forecasts: "0"
          disable_animation: true
        units:
          speed: ""
        humid: sensor.cam_bien_nhiet_do_2_m
        temp: sensor.cam_bien_nhiet_do_2_nhi_t
      - type: vertical-stack
        cards:
          - type: vertical-stack
            cards:
              - type: horizontal-stack
                cards:
                  - type: custom:flex-horseshoe-card
                    view_layout:
                      grid-area: g2
                    entities:
                      - entity: sensor.tong_pv
                        decimals: 0
                        unit: W
                        icon: false
                        name: PV
                      - entity: sensor.esp_inverter_day_pv_energy
                        decimals: 1
                        unit: SL
                      - entity: sensor.energy_production_today_remaining
                        decimals: 1
                        unit: Còn
                      - entity: input_text.trang_thai_solar
                        decimals: 0
                    show:
                      horseshoe_style: lineargradient
                    layout:
                      vlines:
                        - id: 0
                          xpos: 50
                          ypos: 60
                          length: 5
                          styles:
                            - opacity: 0.2;
                      states:
                        - id: 0
                          entity_index: 0
                          xpos: 50
                          ypos: 80
                          styles:
                            - font-size: 2em;
                            - opacity: 0.9;
                        - id: 1
                          entity_index: 1
                          xpos: 44
                          ypos: 63
                          styles:
                            - font-size: 1.3em;
                            - text-anchor: end;
                        - id: 2
                          entity_index: 2
                          xpos: 55
                          ypos: 63
                          styles:
                            - text-anchor: start;
                            - font-size: 1.3em;
                        - id: 3
                          entity_index: 3
                          xpos: 50
                          ypos: 48
                          styles:
                            - font-size: 5em;
                      names:
                        - id: 0
                          entity_index: 0
                          xpos: 50
                          ypos: 95
                          styles:
                            - font-size: 1.2em;
                    horseshoe_scale:
                      min: 0
                      max: 6500
                      width: 15
                    color_stops:
                      "10": green
                      "6500": orange
                    card_mod:
                      style: |
                        ha-card {
                          backdrop-filter: blur(10px);
                          box-shadow: none;
                          border: none
                        }
                  - type: custom:flex-horseshoe-card
                    view_layout:
                      grid-area: g2
                    entities:
                      - entity: sensor.abs_grid_power
                        decimals: 0
                        icon: mdi:transmission-tower
                        unit: W
                        name: Lưới
                      - entity: input_text.trang_thai_luoi
                        decimals: 0
                      - entity: sensor.esp_inverter_inverter_voltage
                        decimals: 0
                        unit: ÁP
                      - entity: sensor.esp_inverter_day_grid_import
                        decimals: 1
                        unit: mua
                    show:
                      horseshoe_style: lineargradient
                    layout:
                      states:
                        - id: 0
                          entity_index: 0
                          xpos: 50
                          ypos: 80
                          styles:
                            - font-size: 2em;
                            - opacity: 0.9;
                        - id: 1
                          entity_index: 1
                          xpos: 50
                          ypos: 21
                          styles:
                            - font-size: 1em;
                        - id: 2
                          entity_index: 2
                          xpos: 35
                          ypos: 63
                          styles:
                            - font-size: 1.3em;
                        - id: 3
                          entity_index: 3
                          xpos: 65
                          ypos: 63
                          styles:
                            - font-size: 1.3em;
                      names:
                        - id: 0
                          entity_index: 0
                          xpos: 50
                          ypos: 95
                          styles:
                            - font-size: 1.2em;
                      icons:
                        - id: 0
                          entity_index: 0
                          xpos: 50
                          ypos: 45
                          icon_size: 6
                          styles:
                            - color: rgb(235, 79, 52);
                    horseshoe_scale:
                      min: 0
                      max: 6500
                      width: 15
                    color_stops:
                      "10": green
                      "6500": orange
                    card_mod:
                      style: |
                        ha-card {
                          backdrop-filter: blur(10px);
                          box-shadow: none;
                          border: none
                        }
                    visibility:
                      - condition: state
                        entity: binary_sensor.esp_inverter_grid_connected_status
                        state: "on"
                  - type: custom:flex-horseshoe-card
                    view_layout:
                      grid-area: g2
                    entities:
                      - entity: sensor.abs_grid_power
                        decimals: 0
                        icon: mdi:transmission-tower-off
                        unit: W
                        name: OFF GRID
                      - entity: input_text.trang_thai_luoi
                        decimals: 0
                      - entity: binary_sensor.esp_inverter_grid_connected_status
                        decimals: 2
                        unit: EVN
                      - entity: sensor.esp_inverter_inverter_voltage
                        decimals: 0
                        unit: ÁP
                      - entity: sensor.esp_inverter_day_grid_import
                        decimals: 1
                        unit: mua
                    show:
                      horseshoe_style: lineargradient
                    layout:
                      states:
                        - id: 0
                          entity_index: 0
                          xpos: 50
                          ypos: 80
                          styles:
                            - font-size: 2em;
                            - opacity: 0.9;
                        - id: 1
                          entity_index: 1
                          xpos: 35
                          ypos: 200
                          styles:
                            - font-size: 2em;
                        - id: 2
                          entity_index: 2
                          xpos: 35
                          ypos: 63
                          styles:
                            - font-size: 1.3em;
                        - id: 3
                          entity_index: 3
                          xpos: 250
                          ypos: 63
                          styles:
                            - font-size: 1.3em;
                        - id: 4
                          entity_index: 4
                          xpos: 65
                          ypos: 63
                          styles:
                            - font-size: 1.3em;
                      names:
                        - id: 0
                          entity_index: 0
                          xpos: 50
                          ypos: 95
                          styles:
                            - font-size: 1.2em;
                        - id: 1
                          entity_index: 0
                          xpos: 50
                          ypos: 95
                          styles:
                            - font-size: 1.2em;
                      icons:
                        - id: 0
                          entity_index: 0
                          xpos: 50
                          ypos: 45
                          icon_size: 6
                          styles:
                            - color: gray;
                    horseshoe_scale:
                      min: 0
                      max: 6500
                      width: 15
                    color_stops:
                      "10": gray
                      "6500": gray
                    card_mod:
                      style: |
                        ha-card {
                          backdrop-filter: blur(10px);
                          box-shadow: none;
                          border: none
                        }
                    visibility:
                      - condition: state
                        entity: binary_sensor.esp_inverter_grid_connected_status
                        state: "off"
              - type: horizontal-stack
                cards:
                  - type: custom:flex-horseshoe-card
                    view_layout:
                      grid-area: g2
                    entities:
                      - entity: sensor.abs_battery
                        decimals: 0
                        unit: W
                        name: PIN
                      - entity: sensor.esp_inverter_day_battery_charge
                        decimals: 1
                        unit: SẠC
                      - entity: sensor.esp_inverter_battery_voltage
                        decimals: 1
                      - entity: sensor.soc_giao_tiep
                        decimals: 0
                      - entity: input_text.trang_thai_pin
                        decimals: 0
                      - entity: sensor.esp_inverter_battery_soc
                        decimals: 0
                      - entity: sensor.jk_130_state_of_charge
                        decimals: 0
                    show:
                      horseshoe_style: lineargradient
                    layout:
                      vlines:
                        - id: 0
                          xpos: 50
                          ypos: 60
                          length: 5
                          styles:
                            - opacity: 0.2;
                      states:
                        - id: 0
                          entity_index: 0
                          xpos: 50
                          ypos: 80
                          styles:
                            - font-size: 2em;
                            - opacity: 0.9;
                        - id: 1
                          entity_index: 1
                          xpos: 44
                          ypos: 63
                          styles:
                            - font-size: 1.3em;
                            - text-anchor: end;
                        - id: 2
                          entity_index: 2
                          xpos: 55
                          ypos: 63
                          styles:
                            - text-anchor: start;
                            - font-size: 1.3em;
                        - id: 3
                          entity_index: 3
                          xpos: 50
                          ypos: 18
                          styles:
                            - font-size: 1.5em;
                        - id: 4
                          entity_index: 4
                          xpos: 50
                          ypos: 48
                          styles:
                            - font-size: 5em;
                        - id: 5
                          entity_index: 5
                          xpos: 35
                          ypos: 45
                          styles:
                            - font-size: 1.3em;
                            - text-anchor: end;
                        - id: 6
                          entity_index: 6
                          xpos: 65
                          ypos: 45
                          styles:
                            - text-anchor: start;
                            - font-size: 1.3em;
                      names:
                        - id: 0
                          entity_index: 0
                          xpos: 50
                          ypos: 95
                          styles:
                            - font-size: 1.2em;
                      icons:
                        - id: 0
                          entity_index: 0
                          xpos: 50
                          ypos: 45
                          icon_size: 6
                          styles:
                            - color: rgb(105, 242, 31);
                    horseshoe_scale:
                      min: 0
                      max: 6500
                      width: 15
                    color_stops:
                      "10": green
                      "6500": orange
                    card_mod:
                      style: |
                        ha-card {
                          backdrop-filter: blur(10px);
                          box-shadow: none;
                          border: none
                        }
                  - type: custom:flex-horseshoe-card
                    view_layout:
                      grid-area: g2
                    entities:
                      - entity: sensor.esp_inverter_load_power
                        decimals: 0
                        icon: mdi:home-roof
                        unit: W
                        name: TẢI
                      - entity: sensor.esp_inverter_day_battery_discharge
                        decimals: 1
                        unit: XẢ
                      - entity: sensor.tong_tieu_thu
                        decimals: 1
                        unit: TỔNG
                      - entity: input_text.trang_thai_load
                        decimals: 0
                    show:
                      horseshoe_style: lineargradient
                    layout:
                      vlines:
                        - id: 0
                          xpos: 50
                          ypos: 60
                          length: 5
                          styles:
                            - opacity: 0.2;
                      states:
                        - id: 0
                          entity_index: 0
                          xpos: 50
                          ypos: 80
                          styles:
                            - font-size: 2em;
                            - opacity: 0.9;
                        - id: 1
                          entity_index: 1
                          xpos: 35
                          ypos: 63
                          styles:
                            - font-size: 1.3em;
                        - id: 2
                          entity_index: 2
                          xpos: 55
                          ypos: 63
                          styles:
                            - text-anchor: start;
                            - font-size: 1.3em;
                        - id: 3
                          entity_index: 3
                          xpos: 50
                          ypos: 48
                          styles:
                            - font-size: 3em;
                      names:
                        - id: 0
                          entity_index: 0
                          xpos: 50
                          ypos: 95
                          styles:
                            - font-size: 1.2em;
                      icons:
                        - id: 0
                          entity_index: 0
                          xpos: 50
                          ypos: 35
                          icon_size: 7
                    horseshoe_scale:
                      min: 0
                      max: 6500
                      width: 15
                    color_stops:
                      "10": green
                      "6500": orange
                    card_mod:
                      style: |
                        ha-card {
                          backdrop-filter: blur(10px); 
                          box-shadow: none;
                          border: none
                        }
      - type: custom:vertical-stack-in-card
        cards:
          - type: custom:local-conditional-card
            id: pin1
            default: show
            card:
              type: vertical-stack
              cards:
                - type: custom:paper-buttons-row
                  styles:
                    border-radius: 28px
                    justify-content: center
                    width: max-content
                    margin: 10px auto 12px auto
                  buttons:
                    - layout: name
                      name: Pin Tổng Quan
                      tap_action:
                        action: fire-dom-event
                        local_conditional_card:
                          action: set
                          ids:
                            - pin1: show
                            - pin2: hide
                      styles:
                        name:
                          color: black
                          padding: 0 22px 0
                        button:
                          background: orange
                          border-radius: 28px
                          height: 24px
                          display: flex
                    - layout: name
                      name: Cell Pin
                      tap_action:
                        action: fire-dom-event
                        local_conditional_card:
                          action: set
                          ids:
                            - pin1: hide
                            - pin2: show
                      styles:
                        name:
                          color: black
                          padding: 0 22px 0
                        button:
                          background: none
                          border-radius: 28px
                          height: 24px
                          display: flex
                - type: vertical-stack
                  cards:
                    - type: custom:bubble-card
                      card_type: button
                      button_type: state
                      card_layout: large-1-rows
                      name: Pack 280
                      icon: mdi:battery-charging
                      show_state: true
                      button_action:
                        tap_action:
                          action: navigate
                          navigation_path: "#energy"
                      sub_button:
                        - icon: mdi:lightning-bolt-outline
                          show_background: false
                          show_state: true
                          entity: sensor.jk_bms_current
                        - entity: sensor.jk_bms_delta_cell_voltage
                          show_background: false
                          show_state: true
                          icon: mdi:delta
                        - show_state: true
                          show_background: false
                          icon: mdi:battery-charging-90
                          entity: sensor.jk_bms_state_of_charge
                      styles: |-
                        .bubble-button-card-container {
                            background: rgba(27, 135, 207,0.8) !important;
                      entity: sensor.jk_bms_total_voltage
                      scrolling_effect: true
                      show_icon: false
                    - type: custom:bubble-card
                      card_type: button
                      button_type: state
                      card_layout: large-1-rows
                      name: Pack 130
                      icon: mdi:battery-charging
                      show_state: true
                      button_action:
                        tap_action:
                          action: navigate
                          navigation_path: "#energy"
                      sub_button:
                        - icon: mdi:lightning-bolt-outline
                          show_background: false
                          show_state: true
                          entity: sensor.jk_130_current
                        - entity: sensor.jk_130_delta_cell_voltage
                          show_background: false
                          show_state: true
                          icon: mdi:delta
                        - show_state: true
                          show_background: false
                          icon: mdi:battery-charging-90
                          entity: sensor.jk_130_state_of_charge
                      styles: |-
                        .bubble-button-card-container {
                            background: rgba(9, 79, 135,0.8) !important;
                      entity: sensor.jk_130_total_voltage
                      scrolling_effect: true
                      show_icon: false
          - type: custom:local-conditional-card
            id: pin2
            default: hide
            card:
              type: vertical-stack
              cards:
                - type: custom:paper-buttons-row
                  styles:
                    border-radius: 28px
                    justify-content: center
                    width: max-content
                    margin: 10px auto 12px auto
                  buttons:
                    - layout: name
                      name: Pin Tổng Quan
                      tap_action:
                        action: fire-dom-event
                        local_conditional_card:
                          action: set
                          ids:
                            - pin1: show
                            - pin2: hide
                      styles:
                        name:
                          color: black
                          padding: 0 22px
                        button:
                          background: none
                          border-radius: 28px
                          height: 24px
                          display: flex
                    - layout: name
                      name: Cell Pin
                      tap_action:
                        action: fire-dom-event
                        local_conditional_card:
                          action: set
                          ids:
                            - pin1: hide
                            - pin2: show
                      styles:
                        name:
                          color: black
                          padding: 0 22px 0
                        button:
                          background: orange
                          border-radius: 28px
                          height: 24px
                          display: flex
                - type: vertical-stack
                  cards:
                    - type: horizontal-stack
                      cards:
                        - type: custom:button-card
                          name: Cell Voltage Delta
                          size: 25%
                          entity: sensor.jk_bms_delta_cell_voltage
                          show_icon: true
                          show_name: true
                          show_state: false
                          show_label: true
                          label: |
                            [[[
                              return '280: ' + 
                                     (states['sensor.jk_bms_delta_cell_voltage'] ? Number.parseFloat(states['sensor.jk_bms_delta_cell_voltage'].state).toFixed(3) + ' V' : 'N/A') + 
                                     '<br>' + // Sử dụng <br> để xuống dòng
                                     '130: ' + 
                                     (states['sensor.jk_130_delta_cell_voltage'] ? Number.parseFloat(states['sensor.jk_130_delta_cell_voltage'].state).toFixed(3) + ' V' : 'N/A');
                            ]]]
                          icon: mdi:delta
                          styles:
                            icon:
                              - color: |
                                  [[[
                                    if (entity.state < 0.010) return 'darkgreen';
                                    if (entity.state < 0.020) return 'darkorange';
                                    else return 'red';
                                  ]]]
                            card:
                              - font-size: 12px
                              - height: 100px
                              - padding: 10px
                              - white-space: normal;
                              - text-align: left;
                        - type: custom:button-card
                          name: Pack Voltage
                          size: 25%
                          entity: sensor.jk_bms_total_voltage
                          show_icon: true
                          show_name: true
                          show_state: false
                          show_label: true
                          label: |
                            [[[ 
                              return '280: ' + 
                                     (states['sensor.jk_bms_total_voltage'] ? Number.parseFloat(states['sensor.jk_bms_total_voltage'].state).toFixed(2) + ' V' : 'N/A') + 
                                     '<br>' + // Sử dụng <br> để xuống dòng
                                     '130: ' + 
                                     (states['sensor.jk_130_total_voltage'] ? Number.parseFloat(states['sensor.jk_130_total_voltage'].state).toFixed(2) + ' V' : 'N/A'); 
                            ]]]
                          icon: mdi:server
                          styles:
                            icon:
                              - color: |
                                  [[[
                                    if (entity.state > 48) return 'darkgreen';
                                    if (entity.state > 52) return 'darkorange';
                                    else return 'red';
                                  ]]]
                            card:
                              - font-size: 12px
                              - height: 100px
                              - padding: 10px
                              - white-space: normal;
                              - text-align: left;
                        - type: custom:button-card
                          name: |
                            [[[
                              if (entity.state < 0) return "Discharging";
                              else
                                return "Charging";
                            ]]]
                          size: 25%
                          entity: sensor.jk_bms_power
                          show_icon: true
                          show_name: true
                          show_state: false
                          show_label: true
                          label: |
                            [[[ 
                              return '280: ' + 
                                     (states['sensor.jk_bms_power'] ? Number.parseFloat(states['sensor.jk_bms_power'].state).toFixed(1) + ' W' : 'N/A') + 
                                     '<br>' + // Sử dụng <br> để xuống dòng
                                     '130: ' + 
                                     (states['sensor.jk_130_power'] ? Number.parseFloat(states['sensor.jk_130_power'].state).toFixed(1) + ' W' : 'N/A'); 
                            ]]]
                          icon: |
                            [[[
                              if (entity.state < 0) return "mdi:battery-arrow-down-outline";
                              else
                                return "mdi:battery-arrow-up-outline";
                            ]]]
                          styles:
                            icon:
                              - color: |
                                  [[[
                                    if (entity.state > 5000) return 'darkred';
                                    if (entity.state > 1000) return 'darkorange';
                                    if (entity.state < -5000) return 'darkred';
                                    if (entity.state < -1000) return 'darkorange';
                                    else return 'darkgreen';
                                  ]]]
                            card:
                              - font-size: 12px
                              - height: 100px
                              - padding: 10px
                              - white-space: normal;
                              - text-align: left;
                    - type: horizontal-stack
                      cards:
                        - type: custom:button-card
                          name: SOC
                          size: 25%
                          entity: sensor.jk_bms_state_of_charge
                          show_icon: true
                          show_name: true
                          show_state: false
                          show_label: true
                          label: |
                            [[[ 
                              return '280: ' + 
                                     (states['sensor.jk_bms_state_of_charge'] ? Number.parseFloat(states['sensor.jk_bms_state_of_charge'].state).toFixed(1) + ' %' : 'N/A') + 
                                     '<br>' + // Sử dụng <br> để xuống dòng
                                     '130: ' + 
                                     (states['sensor.jk_130_state_of_charge'] ? Number.parseFloat(states['sensor.jk_130_state_of_charge'].state).toFixed(1) + ' %' : 'N/A'); 
                            ]]]
                          icon: |
                            [[[
                              if (entity.state > 90) return "mdi:battery";
                              if (entity.state > 80) return "mdi:battery-90";
                              if (entity.state > 70) return "mdi:battery-80";
                              if (entity.state > 60) return "mdi:battery-70";
                              if (entity.state > 50) return "mdi:battery-60";
                              if (entity.state > 40) return "mdi:battery-50";
                              if (entity.state > 30) return "mdi:battery-40";
                              if (entity.state > 20) return "mdi:battery-30";
                              if (entity.state > 10) return "mdi:battery-20";
                              else return "mdi:battery-alert-variant-outline";
                            ]]]
                          styles:
                            icon:
                              - color: |
                                  [[[
                                    if (entity.state > 30 ) return 'darkgreen';
                                    if (entity.state > 15 ) return 'yellow';
                                    else return 'red';
                                  ]]]
                            card:
                              - font-size: 12px
                              - height: 100px
                              - padding: 10px
                              - white-space: normal;
                              - text-align: left;
                        - type: custom:button-card
                          name: Dung Lượng
                          size: 25Ah
                          entity: sensor.jk_bms_capacity_remaining
                          show_icon: true
                          show_name: true
                          show_state: false
                          show_label: true
                          label: |
                            [[[ 
                              return '280: ' + 
                                     (states['sensor.jk_bms_capacity_remaining'] ? Number.parseFloat(states['sensor.jk_bms_capacity_remaining'].state).toFixed(0) + ' Ah' : 'N/A') + 
                                     '<br>' + // Sử dụng <br> để xuống dòng
                                     '130: ' + 
                                     (states['sensor.jk_130_capacity_remaining'] ? Number.parseFloat(states['sensor.jk_130_capacity_remaining'].state).toFixed(0) + ' Ah' : 'N/A'); 
                            ]]]
                          icon: |
                            [[[
                              if (entity.state > 99) return "mdi:check-circle";
                              if (entity.state > 95) return "mdi:alert-circle";
                              else return "mdi:cancel";
                            ]]]
                          styles:
                            icon:
                              - color: |
                                  [[[
                                    if (entity.state > 99) return 'darkgreen';
                                    if (entity.state > 95) return 'darkorange';
                                    else return 'red';
                                  ]]]
                            card:
                              - font-size: 12px
                              - height: 100px
                              - padding: 10px
                              - white-space: normal;
                              - text-align: left;
                        - type: custom:button-card
                          name: |
                            [[[
                              if (entity.state < 0) return "Discharging";
                              else
                                return "Charging";
                            ]]]
                          size: 25%
                          entity: sensor.jk_bms_current
                          show_icon: true
                          show_name: true
                          show_state: false
                          show_label: true
                          label: |
                            [[[ 
                              return '280: ' + 
                                     (states['sensor.jk_bms_current'] ? Number.parseFloat(states['sensor.jk_bms_current'].state).toFixed(1) + ' A' : 'N/A') + 
                                     '<br>' + // Sử dụng <br> để xuống dòng
                                     '130: ' + 
                                     (states['sensor.jk_130_current'] ? Number.parseFloat(states['sensor.jk_130_current'].state).toFixed(1) + ' A' : 'N/A'); 
                            ]]]
                          icon: |
                            [[[
                              if (entity.state < 0) return "mdi:battery-arrow-down-outline";
                              else
                                return "mdi:battery-arrow-up-outline";
                            ]]]
                          styles:
                            icon:
                              - color: |
                                  [[[
                                    if (entity.state > 5000) return 'darkred';
                                    if (entity.state > 1000) return 'darkorange';
                                    if (entity.state < -5000) return 'darkred';
                                    if (entity.state < -1000) return 'darkorange';
                                    else return 'darkgreen';
                                  ]]]
                            card:
                              - font-size: 12px
                              - height: 100px
                              - padding: 10px
                              - white-space: normal;
                              - text-align: left;
                    - type: custom:bar-card
                      direction: up
                      columns: 8
                      decimal: 3
                      max: 3.45
                      min: 3
                      height: 80px
                      severity:
                        - color: darkred
                          from: 3.45
                          to: 4
                        - color: darkorange
                          from: 3.4
                          to: 3.45
                        - color: rgb(189, 164, 66)
                          from: 3.1
                          to: 3.4
                        - color: darkred
                          from: 2.5
                          to: 3.1
                      positions:
                        icon: "off"
                        indicator: inside
                        name: outside
                      card_mod:
                        style: |-
                          bar-card-value {
                            margin-right: auto;
                            margin-left: auto;
                            margin-bottom: 35px;
                            font-size: 10px;
                            font-weight: normal;
                            text-shadow: 1px 1px #0005;
                          }
                          bar-card-name {
                            margin-right: auto;
                            margin-left: auto;
                            margin-bottom: 0px;
                            font-size: 10px;
                            font-weight: normal;
                            text-shadow: 1px 1px #0005;
                          }
                      entities:
                        - entity: sensor.jk_bms_cell_voltage_1
                          name: Cell 01
                        - entity: sensor.jk_bms_cell_voltage_2
                          name: Cell 02
                        - entity: sensor.jk_bms_cell_voltage_3
                          name: Cell 03
                        - entity: sensor.jk_bms_cell_voltage_4
                          name: Cell 04
                        - entity: sensor.jk_bms_cell_voltage_5
                          name: Cell 05
                        - entity: sensor.jk_bms_cell_voltage_6
                          name: Cell 06
                        - entity: sensor.jk_bms_cell_voltage_7
                          name: Cell 07
                        - entity: sensor.jk_bms_cell_voltage_8
                          name: Cell 08
                        - entity: sensor.jk_bms_cell_voltage_9
                          name: Cell 09
                        - entity: sensor.jk_bms_cell_voltage_10
                          name: Cell 10
                        - entity: sensor.jk_bms_cell_voltage_11
                          name: Cell 11
                        - entity: sensor.jk_bms_cell_voltage_12
                          name: Cell 12
                        - entity: sensor.jk_bms_cell_voltage_13
                          name: Cell 13
                        - entity: sensor.jk_bms_cell_voltage_14
                          name: Cell 14
                        - entity: sensor.jk_bms_cell_voltage_15
                          name: Cell 15
                        - entity: sensor.jk_bms_cell_voltage_16
                          name: Cell 16
                    - type: custom:bar-card
                      direction: up
                      columns: 8
                      decimal: 3
                      max: 3.45
                      min: 3
                      height: 80px
                      severity:
                        - color: darkred
                          from: 3.45
                          to: 4
                        - color: darkorange
                          from: 3.4
                          to: 3.45
                        - color: rgb(9, 122, 214)
                          from: 3.1
                          to: 3.4
                        - color: darkred
                          from: 2.5
                          to: 3.1
                      positions:
                        icon: "off"
                        indicator: inside
                        name: outside
                      card_mod:
                        style: |-
                          bar-card-value {
                            margin-right: auto;
                            margin-left: auto;
                            margin-bottom: 35px;
                            font-size: 10px;
                            font-weight: normal;
                            text-shadow: 1px 1px #0005;
                          }
                          bar-card-name {
                            margin-right: auto;
                            margin-left: auto;
                            margin-bottom: 0px;
                            font-size: 10px;
                            font-weight: normal;
                            text-shadow: 1px 1px #0005;
                          }
                      entities:
                        - entity: sensor.jk_130_cell_voltage_1
                          name: Cell 01
                        - entity: sensor.jk_130_cell_voltage_2
                          name: Cell 02
                        - entity: sensor.jk_130_cell_voltage_3
                          name: Cell 03
                        - entity: sensor.jk_130_cell_voltage_4
                          name: Cell 04
                        - entity: sensor.jk_130_cell_voltage_5
                          name: Cell 05
                        - entity: sensor.jk_130_cell_voltage_6
                          name: Cell 06
                        - entity: sensor.jk_130_cell_voltage_7
                          name: Cell 07
                        - entity: sensor.jk_130_cell_voltage_8
                          name: Cell 08
                        - entity: sensor.jk_130_cell_voltage_9
                          name: Cell 09
                        - entity: sensor.jk_130_cell_voltage_10
                          name: Cell 10
                        - entity: sensor.jk_130_cell_voltage_11
                          name: Cell 11
                        - entity: sensor.jk_130_cell_voltage_12
                          name: Cell 12
                        - entity: sensor.jk_130_cell_voltage_13
                          name: Cell 13
                        - entity: sensor.jk_130_cell_voltage_14
                          name: Cell 14
                        - entity: sensor.jk_130_cell_voltage_15
                          name: Cell 15
                        - entity: sensor.jk_130_cell_voltage_16
                          name: Cell 16
        card_mod:
          style: |
            ha-card {
              backdrop-filter: blur(10px);
              box-shadow: none;
              border: none
            }
      - type: custom:slider-button-card
        entity: input_boolean.sac_nhanh
        slider:
          direction: left-right
          background: gradient
          use_state_color: true
          use_percentage_bg_opacity: false
          show_track: false
          toggle_on_click: true
          force_square: false
          show_attribute: false
        show_name: true
        show_state: false
        compact: true
        icon:
          show: true
          use_state_color: true
          tap_action:
            action: more-info
          icon: ""
        action_button:
          mode: toggle
          icon: mdi:power
          show: true
          show_spinner: true
          tap_action:
            action: toggle
        show_attribute: true
      - type: custom:bubble-card
        card_type: button
        entity: input_boolean.uu_tien_sac_khong_xa
        force_icon: false
        show_name: true
        show_state: false
        show_last_changed: false
        show_attribute: false
        tap_action:
          action: none
        sub_button:
          - entity: input_boolean.uu_tien_sac_khong_xa
            show_background: false
            show_icon: false
            show_name: false
            show_state: true
            show_last_changed: true
  - type: grid
    cards:
      - type: heading
        icon: mdi:meter-electric-outline
        heading_style: subtitle
        badges:
          - type: entity
            show_state: true
            show_icon: true
            entity: sensor.esp_inverter_dc_transformer_temperature
            icon: mdi:current-dc
          - type: entity
            show_state: true
            show_icon: false
            entity: input_text.temp_dc
            color: red
          - type: entity
            show_state: true
            show_icon: true
            entity: sensor.esp_inverter_radiator_temperature
            icon: mdi:current-ac
          - type: entity
            show_state: true
            show_icon: false
            entity: input_text.temp_ac
          - type: entity
            show_state: false
            show_icon: true
            entity: fan.fan_controller_12v_fan
            color: deep-orange
            visibility:
              - condition: state
                entity: fan.fan_controller_12v_fan
                state: "on"
        heading: Nhiệt độ Inverter
      - type: vertical-stack
        cards:
          - type: horizontal-stack
            cards:
              - type: custom:slider-button-card
                entity: media_player.lg_webos_smart_tv
                slider:
                  direction: left-right
                  background: gradient
                  use_state_color: true
                  use_percentage_bg_opacity: false
                  show_track: true
                  toggle_on_click: true
                  force_square: false
                  show_attribute: true
                  attribute: media_title
                show_name: true
                show_state: true
                compact: false
                icon:
                  show: true
                  use_state_color: true
                  tap_action:
                    action: toggle
                  icon: mdi:television
                action_button:
                  mode: toggle
                  icon: mdi:power
                  show: true
                  show_spinner: true
                  tap_action:
                    action: toggle
                show_attribute: true
              - type: custom:slider-button-card
                entity: switch.dung_evn_switch_1
                slider:
                  direction: left-right
                  background: gradient
                  use_state_color: true
                  use_percentage_bg_opacity: false
                  show_track: false
                  toggle_on_click: true
                  force_square: false
                  show_attribute: false
                show_name: true
                show_state: false
                compact: false
                icon:
                  show: true
                  use_state_color: true
                  tap_action:
                    action: toggle
                  icon: mdi:transmission-tower-import
                action_button:
                  mode: toggle
                  icon: mdi:power
                  show: true
                  show_spinner: true
                  tap_action:
                    action: toggle
                show_attribute: true
                name: Dùng CT2
              - type: custom:slider-button-card
                entity: switch.may_bom_switch_1
                slider:
                  direction: left-right
                  background: gradient
                  use_state_color: true
                  use_percentage_bg_opacity: false
                  show_track: false
                  toggle_on_click: true
                  force_square: false
                  show_attribute: false
                show_name: true
                show_state: false
                compact: false
                icon:
                  show: true
                  use_state_color: true
                  tap_action:
                    action: toggle
                  icon: mdi:water-pump
                action_button:
                  mode: toggle
                  icon: mdi:power
                  show: true
                  show_spinner: true
                  tap_action:
                    action: toggle
                show_attribute: true
                name: Máy bơm
          - type: horizontal-stack
            cards:
              - type: custom:slider-button-card
                entity: switch.man_led_switch_1
                slider:
                  direction: left-right
                  background: gradient
                  use_state_color: true
                  use_percentage_bg_opacity: false
                  show_track: false
                  toggle_on_click: true
                  force_square: false
                  show_attribute: false
                show_name: true
                show_state: false
                compact: false
                icon:
                  show: true
                  use_state_color: true
                  tap_action:
                    action: toggle
                  icon: mdi:led-on
                action_button:
                  mode: toggle
                  icon: mdi:power
                  show: true
                  show_spinner: true
                  tap_action:
                    action: toggle
                show_attribute: true
                name: Màn hình LED
              - type: custom:slider-button-card
                entity: switch.led_50w_switch_1
                slider:
                  direction: left-right
                  background: gradient
                  use_state_color: true
                  use_percentage_bg_opacity: false
                  show_track: false
                  toggle_on_click: true
                  force_square: false
                  show_attribute: false
                show_name: true
                show_state: false
                compact: false
                icon:
                  show: true
                  use_state_color: true
                  tap_action:
                    action: toggle
                  icon: mdi:spotlight
                action_button:
                  mode: toggle
                  icon: mdi:power
                  show: true
                  show_spinner: true
                  tap_action:
                    action: toggle
                show_attribute: true
                name: Đèn LED sân
              - type: custom:slider-button-card
                entity: switch.tu_lanh_switch_1
                slider:
                  direction: left-right
                  background: gradient
                  use_state_color: true
                  use_percentage_bg_opacity: false
                  show_track: false
                  toggle_on_click: true
                  force_square: false
                  show_attribute: false
                show_name: true
                show_state: false
                compact: false
                icon:
                  show: true
                  use_state_color: true
                  tap_action:
                    action: toggle
                  icon: mdi:fridge
                action_button:
                  mode: toggle
                  icon: mdi:power
                  show: true
                  show_spinner: true
                  tap_action:
                    action: toggle
                show_attribute: true
                name: Tủ lạnh
      - type: vertical-stack
        cards:
          - type: horizontal-stack
            cards:
              - graph: line
                type: sensor
                entity: sensor.tong_pv
                detail: 2
                name: Công suất PV
                theme: Metro Orange
                hours_to_show: 2
              - graph: line
                type: sensor
                entity: sensor.esp_inverter_grid_ct_power
                detail: 2
                name: Lưới EVN
                theme: Metro Red
                hours_to_show: 2
          - type: horizontal-stack
            cards:
              - graph: line
                type: sensor
                entity: sensor.abs_battery
                detail: 2
                name: Pin Đang Sạc
                theme: Metro Green
                hours_to_show: 2
                visibility:
                  - condition: numeric_state
                    entity: sensor.esp_inverter_battery_power
                    below: 0
                icon: mdi:power-plug-battery-outline
              - graph: line
                type: sensor
                entity: sensor.esp_inverter_battery_power
                detail: 2
                name: Pin Đang Xả
                theme: Metro Green
                hours_to_show: 2
                visibility:
                  - condition: numeric_state
                    entity: sensor.esp_inverter_battery_power
                    above: 0
              - graph: line
                type: sensor
                entity: sensor.esp_inverter_load_power
                detail: 2
                name: Tải nhà
                theme: Metro Blue
                hours_to_show: 2
        visibility:
          - condition: state
            entity: input_boolean.5_giay_hien_thi
            state: "on"
      - type: vertical-stack
        cards:
          - type: horizontal-stack
            cards:
              - graph: line
                type: sensor
                entity: sensor.esp_inverter_day_pv_energy
                detail: 1
                name: Sản lượng
                icon: mdi:solar-power
                unit: kWh
                theme: Metro Orange
                hours_to_show: 24
              - graph: line
                type: sensor
                entity: sensor.esp_inverter_day_grid_import
                detail: 1
                icon: mdi:transmission-tower
                theme: Metro Blue
                unit: kWh
                name: Điện mua
                hours_to_show: 24
          - type: horizontal-stack
            cards:
              - graph: line
                type: sensor
                entity: sensor.esp_inverter_day_battery_charge
                detail: 1
                name: Sạc pin
                icon: mdi:power-plug-battery-outline
                theme: Metro Green
                unit: kWh
                visibility:
                  - condition: numeric_state
                    entity: sensor.esp_inverter_battery_power
                    below: 0
              - graph: line
                type: sensor
                entity: sensor.esp_inverter_day_battery_discharge
                detail: 1
                name: Xả pin
                icon: mdi:battery-minus-outline
                theme: Metro Green
                unit: kWh
                visibility:
                  - condition: numeric_state
                    entity: sensor.esp_inverter_battery_power
                    above: 0
              - graph: line
                type: sensor
                entity: sensor.tong_tieu_thu
                detail: 1
                name: Tiêu thụ
                icon: mdi:home-lightbulb-outline
                theme: Metro Purple
                unit: kWh
                hours_to_show: 24
        visibility:
          - condition: state
            entity: input_boolean.5_giay_hien_thi
            state: "off"
      - type: vertical-stack
        cards:
          - type: horizontal-stack
            cards:
              - graph: none
                type: sensor
                entity: sensor.than_tiet_kiem
                detail: 1
                name: Than tiết kiệm
                icon: mdi:grill
                unit: Tấn
                theme: ios-dark-mode-dark-blue
              - graph: none
                type: sensor
                entity: sensor.co2_tiet_giam
                detail: 1
                icon: mdi:molecule-co2
                name: CO2
                theme: ios-dark-mode-dark-blue
                unit: Tấn
          - type: horizontal-stack
            cards:
              - graph: none
                type: sensor
                entity: sensor.cay_xanh
                detail: 1
                name: Cây xanh
                icon: mdi:forest-outline
                theme: ios-dark-mode-dark-blue
                unit: Cây
              - graph: none
                type: sensor
                entity: sensor.tien
                detail: 1
                name: Gánh được
                icon: mdi:cash-100
                theme: ios-dark-mode-dark-blue
                unit: Triệu đồng
        grid_options:
          columns: full
      - type: vertical-stack
        cards:
          - type: vertical-stack
            cards:
              - type: markdown
                content: " **{{ states('sensor.esp_inverter_time_slot_1') }} đến {{ states('sensor.esp_inverter_time_slot_2') }}**"
                card_mod:
                  style: |
                    ha-card {
                      backdrop-filter: blur(10px);
                      box-shadow: none;
                      border: none
                    }
              - type: horizontal-stack
                cards:
                  - type: custom:numberbox-card
                    border: false
                    entity: number.esp_inverter_prog1_capacity
                    icon: none
                    initial: 5
                    min: 16
                    max: 100
                    toggle_entity: switch.esp_inverter_prog1_grid_charge
                    step: 2
                    icon_plus: mdi:plus-circle
                    icon_minus: mdi:minus-circle
                    name: false
                    unit: false
                    speed: 200
                    card_mod:
                      style: |
                        ha-card {
                           height: 52px; 
                           display: flex;
                           flex-direction: column;
                           justify-content: center;
                           }
                  - type: custom:numberbox-card
                    border: false
                    entity: number.esp_inverter_prog1_power
                    icon: none
                    initial: 5
                    min: 100
                    max: 5000
                    step: 100
                    icon_plus: mdi:plus-circle
                    icon_minus: mdi:minus-circle
                    name: false
                    unit: false
                    speed: 200
                    card_mod:
                      style: |
                        ha-card {
                           height: 52px; 
                           display: flex;
                           flex-direction: column;
                           justify-content: center;
                           }
            layout_options:
              grid_columns: 8
              grid_rows: auto
            visibility:
              - condition: state
                entity: binary_sensor.time_1
                state: "on"
          - type: vertical-stack
            cards:
              - type: markdown
                content: " **{{ states('sensor.esp_inverter_time_slot_2') }} đến {{ states('sensor.esp_inverter_time_slot_3') }}**"
                card_mod:
                  style: |
                    ha-card {
                      backdrop-filter: blur(10px);
                      box-shadow: none;
                      border: none
                    }
              - type: horizontal-stack
                cards:
                  - type: custom:numberbox-card
                    border: false
                    entity: number.esp_inverter_prog2_capacity
                    icon: none
                    initial: 5
                    min: 16
                    max: 100
                    toggle_entity: switch.esp_inverter_prog2_grid_charge
                    step: 2
                    icon_plus: mdi:plus-circle
                    icon_minus: mdi:minus-circle
                    name: false
                    unit: false
                    speed: 200
                    card_mod:
                      style: |
                        ha-card {
                           height: 52px; 
                           display: flex;
                           flex-direction: column;
                           justify-content: center;
                           }
                  - type: custom:numberbox-card
                    border: false
                    entity: number.esp_inverter_prog2_power
                    icon: none
                    initial: 5
                    min: 100
                    max: 5000
                    step: 100
                    icon_plus: mdi:plus-circle
                    icon_minus: mdi:minus-circle
                    name: false
                    unit: false
                    speed: 200
                    card_mod:
                      style: |
                        ha-card {
                           height: 52px; 
                           display: flex;
                           flex-direction: column;
                           justify-content: center;
                           }
            layout_options:
              grid_columns: 8
              grid_rows: auto
            visibility:
              - condition: state
                entity: binary_sensor.time_2
                state: "on"
          - type: vertical-stack
            cards:
              - type: markdown
                content: " **{{ states('sensor.esp_inverter_time_slot_3') }} đến {{ states('sensor.esp_inverter_time_slot_4') }}**"
                card_mod:
                  style: |
                    ha-card {
                      backdrop-filter: blur(10px);
                      box-shadow: none;
                      border: none
                    }
              - type: horizontal-stack
                cards:
                  - type: custom:numberbox-card
                    border: false
                    entity: number.esp_inverter_prog3_capacity
                    icon: none
                    initial: 5
                    min: 16
                    max: 100
                    toggle_entity: switch.esp_inverter_prog3_grid_charge
                    step: 2
                    icon_plus: mdi:plus-circle
                    icon_minus: mdi:minus-circle
                    name: false
                    unit: false
                    speed: 200
                    card_mod:
                      style: |
                        ha-card {
                           height: 52px; 
                           display: flex;
                           flex-direction: column;
                           justify-content: center;
                           }
                  - type: custom:numberbox-card
                    border: false
                    entity: number.esp_inverter_prog3_power
                    icon: none
                    initial: 5
                    min: 100
                    max: 5000
                    step: 100
                    icon_plus: mdi:plus-circle
                    icon_minus: mdi:minus-circle
                    name: false
                    unit: false
                    speed: 200
                    card_mod:
                      style: |
                        ha-card {
                           height: 52px; 
                           display: flex;
                           flex-direction: column;
                           justify-content: center;
                           }
            layout_options:
              grid_columns: 8
              grid_rows: auto
            visibility:
              - condition: state
                entity: binary_sensor.time_3
                state: "on"
          - type: vertical-stack
            cards:
              - type: markdown
                content: " **{{ states('sensor.esp_inverter_time_slot_4') }} đến {{ states('sensor.esp_inverter_time_slot_5') }}**"
                card_mod:
                  style: |
                    ha-card {
                      backdrop-filter: blur(10px);
                      box-shadow: none;
                      border: none
                    }
              - type: horizontal-stack
                cards:
                  - type: custom:numberbox-card
                    border: false
                    entity: number.esp_inverter_prog4_capacity
                    icon: none
                    initial: 5
                    min: 16
                    max: 100
                    toggle_entity: switch.esp_inverter_prog4_grid_charge
                    step: 2
                    icon_plus: mdi:plus-circle
                    icon_minus: mdi:minus-circle
                    name: false
                    unit: false
                    speed: 200
                    card_mod:
                      style: |
                        ha-card {
                           height: 52px; 
                           display: flex;
                           flex-direction: column;
                           justify-content: center;
                           }
                  - type: custom:numberbox-card
                    border: false
                    entity: number.esp_inverter_prog4_power
                    icon: none
                    initial: 5
                    min: 100
                    max: 5000
                    step: 100
                    icon_plus: mdi:plus-circle
                    icon_minus: mdi:minus-circle
                    name: false
                    unit: false
                    speed: 200
                    card_mod:
                      style: |
                        ha-card {
                           height: 52px; 
                           display: flex;
                           flex-direction: column;
                           justify-content: center;
                           }
            layout_options:
              grid_columns: 8
              grid_rows: auto
            visibility:
              - condition: state
                entity: binary_sensor.time_4
                state: "on"
          - type: vertical-stack
            cards:
              - type: markdown
                content: " **{{ states('sensor.esp_inverter_time_slot_5') }} đến {{ states('sensor.esp_inverter_time_slot_6') }}**"
                card_mod:
                  style: |
                    ha-card {
                      backdrop-filter: blur(10px);
                      box-shadow: none;
                      border: none
                    }
              - type: horizontal-stack
                cards:
                  - type: custom:numberbox-card
                    border: false
                    entity: number.esp_inverter_prog5_capacity
                    icon: none
                    initial: 5
                    min: 16
                    max: 100
                    toggle_entity: switch.esp_inverter_prog5_grid_charge
                    step: 2
                    icon_plus: mdi:plus-circle
                    icon_minus: mdi:minus-circle
                    name: false
                    unit: false
                    speed: 200
                    card_mod:
                      style: |
                        ha-card {
                           height: 52px; 
                           display: flex;
                           flex-direction: column;
                           justify-content: center;
                           }
                  - type: custom:numberbox-card
                    border: false
                    entity: number.esp_inverter_prog5_power
                    icon: none
                    initial: 5
                    min: 100
                    max: 5000
                    step: 100
                    icon_plus: mdi:plus-circle
                    icon_minus: mdi:minus-circle
                    name: false
                    unit: false
                    speed: 200
                    card_mod:
                      style: |
                        ha-card {
                           height: 52px; 
                           display: flex;
                           flex-direction: column;
                           justify-content: center;
                           }
            layout_options:
              grid_columns: 8
              grid_rows: auto
            visibility:
              - condition: state
                entity: binary_sensor.time_5
                state: "on"
          - type: vertical-stack
            cards:
              - type: markdown
                content: " **{{ states('sensor.esp_inverter_time_slot_6') }} đến {{ states('sensor.esp_inverter_time_slot_1') }}**"
                card_mod:
                  style: |
                    ha-card {
                      backdrop-filter: blur(10px);
                      box-shadow: none;
                      border: none
                    }
              - type: horizontal-stack
                cards:
                  - type: custom:numberbox-card
                    border: false
                    entity: number.esp_inverter_prog6_capacity
                    icon: none
                    initial: 5
                    min: 16
                    max: 100
                    toggle_entity: switch.esp_inverter_prog6_grid_charge
                    step: 2
                    icon_plus: mdi:plus-circle
                    icon_minus: mdi:minus-circle
                    name: false
                    unit: false
                    speed: 200
                    card_mod:
                      style: |
                        ha-card {
                           height: 52px; 
                           display: flex;
                           flex-direction: column;
                           justify-content: center;
                           }
                  - type: custom:numberbox-card
                    border: false
                    entity: number.esp_inverter_prog6_power
                    icon: none
                    initial: 5
                    min: 100
                    max: 5000
                    step: 100
                    icon_plus: mdi:plus-circle
                    icon_minus: mdi:minus-circle
                    name: false
                    unit: false
                    speed: 200
                    card_mod:
                      style: |
                        ha-card {
                           height: 52px; 
                           display: flex;
                           flex-direction: column;
                           justify-content: center;
                           }
            layout_options:
              grid_columns: 8
              grid_rows: auto
            visibility:
              - condition: state
                entity: binary_sensor.time_6
                state: "on"
        grid_options:
          columns: 24
          rows: 2
  - type: grid
    cards:
      - type: custom:myjdownloader-card
        display_mode: compact
        list_mode: packages
        hide_instance: true
        hide_title: false
        hide_play: false
        hide_pause: false
        hide_stop: false
        hide_speed_limit: false
        visibility:
          - condition: numeric_state
            entity: sensor.jdownloader_plex_download_speed
            above: 1
max_columns: 4
dense_section_placement: true

Để lại một bình luận

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *