slipx06 / sunsynk-power-flow-card

⚡A customizable Home Assistant card to emulate the Sunsynk System flow that's displayed on the Inverter screen.
MIT License
184 stars 53 forks source link

Resize by hieght does not seem to work in panel mode #381

Closed B00t4me closed 5 months ago

B00t4me commented 5 months ago

Is there an existing issue for this?

Current Behavior

When the card is in Panel mode and set the height by percentage the card does nto resize. However if I use width it does.

Steps To Reproduce

  1. Core 2024.4.3 Supervisor 2024.04.0 Operating System 12.2 Frontend 20240404.2
  2. Change the code for hieght tried chnaging to 10% but it did not affect the card but it does with width.

Expected behaviour

When I say card_height: 90% the card will resize to 90% of the screen available.

Card Version

3.30.0

Home Assistant Version

2024.4.3

Configuration

type: custom:sunsynk-power-flow-card
cardstyle: full
panel_mode: true
show_solar: 'yes'
battery:
  energy: 50000
  shutdown_soc: 20
  show_daily: true
  show_absolute: false
  linear_gradient: true
  auto_scale: false
  dynamic_colour: false
  invert_power: true
solar:
  show_daily: true
  mppts: 4
  auto_scale: false
load:
  show_daily: true
  dynamic_colour: false
  auto_scale: false
  essential_name: Home
grid:
  show_daily_buy: true
  show_daily_sell: true
  show_nonessential: false
  auto_scale: false
modern: true
entities:
  load_frequency_192: sensor.sunsynk_output_frequency_192
  nonessential_power: none
  pv1_power_186: sensor.deye_sunsynk_sol_ark_x_2_inverter_1_pv_power_1
  pv2_power_187: sensor.deye_sunsynk_sol_ark_x_2_inverter_1_pv_power_2
  pv3_power_188: sensor.deye_sunsynk_sol_ark_x_2_inverter_2_pv_power_1
  pv4_power_189: sensor.deye_sunsynk_sol_ark_x_2_inverter_2_pv_power_2
  day_pv_energy_108: sensor.deye_sunsynk_sol_ark_x_2_pv_energy
  pv1_voltage_109: sensor.deye_sunsynk_sol_ark_x_2_inverter_1_pv_voltage_1
  pv2_voltage_111: sensor.deye_sunsynk_sol_ark_x_2_inverter_1_pv_voltage_2
  pv3_voltage_113: sensor.deye_sunsynk_sol_ark_x_2_inverter_2_pv_voltage_1
  pv4_voltage_115: sensor.deye_sunsynk_sol_ark_x_2_inverter_2_pv_voltage_2
  pv1_current_110: ' sensor.deye_sunsynk_sol_ark_x_2_inverter_1_pv_current_1'
  pv2_current_112: ' sensor.deye_sunsynk_sol_ark_x_2_inverter_1_pv_current_2'
  pv3_current_114: sensor.deye_sunsynk_sol_ark_x_2_inverter_2_pv_current_1
  pv4_current_116: sensor.deye_sunsynk_sol_ark_x_2_inverter_2_pv_current_2
  pv_total: sensor.deye_sunsynk_sol_ark_x_2_pv_power
  environment_temp: sensor.inewar64_temperature
  battery_power_190: sensor.deye_sunsynk_sol_ark_x_2_battery_power
  day_battery_discharge_71: sensor.deye_sunsynk_sol_ark_x_2_battery_energy_out
  battery_soc_184: sensor.deye_sunsynk_sol_ark_x_2_battery_state_of_charge
  day_battery_charge_70: sensor.deye_sunsynk_sol_ark_x_2_battery_energy_in
  battery_current_191: sensor.sa_batteryampcombained
  battery_voltage_183: sensor.deye_sunsynk_sol_ark_x_2_inverter_2_battery_voltage
  inverter_voltage_154: sensor.deye_sunsynk_sol_ark_x_2_inverter_1_grid_voltage
  inverter_voltage_L2: sensor.deye_sunsynk_sol_ark_x_2_inverter_2_grid_voltage
  inverter_power_175: sensor.deye_sunsynk_sol_ark_x_2_load_power
  day_load_energy_84: sensor.deye_sunsynk_sol_ark_x_2_load_energy
  essential_power: sensor.deye_sunsynk_sol_ark_x_2_load_power
  day_grid_import_76: sensor.deye_sunsynk_sol_ark_x_2_grid_energy_in
  day_grid_export_77: sensor.deye_sunsynk_sol_ark_x_2_grid_energy_out
  grid_ct_power_172: sensor.deye_sunsynk_sol_ark_x_2_grid_power
  grid_power_169: sensor.deye_sunsynk_sol_ark_x_2_grid_power
  battery_temp_182: sensor.deye_sunsynk_sol_ark_x_2_battery_temperature
inverter:
  model: sunsynk
  modern: true
  auto_scale: false
  autarky: 'no'
show_battery: true
show_grid: true
large_font: true
decimal_places: 2
card_height: 10%
card_mod:
  style: |
    ha-card {
      --ha-card-background: #111111;
    }

Relevant log output

No response

slipx06 commented 5 months ago

Hi. Yes this is by design and has to do with scaling the SVG portal and viewbox. In panel mode you need to change the width to set card height in order to maintain the correct proportions and scaling. Its noted in the documentation.

card_height: | Optional | 396px | Only used when panel_mode: false. Sets the card height in pixels. Specify the value i.e. 400px or provide a sensor i.e. input.numer_height card_width: | Optional | 100% | Only used when panel_mode: true. Sets the card width in pixels or percentage 400px or 80%. For adjustments when using the Panel(1 card) view types or grid layouts