Inverter Power Flow Card

Hi. There is a sensor that you can use. inverter_status_59: It displays a small coloured dot on the lite card and prints out a message on the full card. You would just need to create a template sensor to map your specific sensor to one of the expected values i.e. normal and standby

1 Like

v3.2.1
:bug: Patches & Bug Fixes

  • fix: alignment of icons for additional essential loads
  • fix: #107
2 Likes

First of all, great job, impressive, thanks for your work and continued engagement.

Is it possible to have a decimal place rounding? My display has lots of different numbers displayed to differing precisions. Even though I have adjusted the “display precison” in individual sensors, they seem to be shown here is longer length formats.

image

The battery also seems to appear “empty” even when 30% full, on a 4-100% scale.

Is it possible to have the grid colour (red on my screenshot) change when exporting to the grid?

Is it possible to change the colour of the grid depending on what kind of tariff is in use eg a dark red when importing on off peak, and a bright red when importing on peak tariffs?

Is it possible to have a battery or PV string “grey out” the colour if it has 0 V or some other sensor condition we could create, indicating a fault?

How about room for a carbon intensity sensor for how green the grid power is?

Just a couple of ideas, I look forward to where you take the project.

@RB0 the way I got around it was by creating template sensors -

- platform: template
  sensors:  

    convert_grid_power:
      unique_id: convert_grid_power
      friendly_name: "Grid Power Watts"
      value_template: "{{ states('sensor.solarnet_power_grid') | float * 1000 | round(2) }}"
  

This is to convert the to watts and then round to 2 decimal places.

Wondering if any one can help adjust a template sensor:

As I live in the very north, in winter it gets dark during the day. As a result my photovoltaics sensor after some time becomes “unavailable” when there is no solar energy being produced.

I had created a template sensor to convert it from KW to W as on the panel it would not show if it was below a certain value.

    convert_power_photovoltaics:
      unique_id: convert_power_photovoltaics
      friendly_name: "Power Photovoltaics W"
      value_template: "{{ states('sensor.solarnet_power_photovoltaics') | float * 1000 | round(2) }}"

The problem I now have is that when it goes “unavailable” all the calculated values such as essential load all display “NaN”

Is there a way to adjust the value_template to keep the calculation I have but to also go to zero if the state of the sensor is “unavailable”?

The built in “autoscale” option in this integration should cover the changes between W and kW:

solar:
  show_daily: true
  mppts: 2
  auto_scale: true  
  max_power: 3600
  display_mode: 2

As for replacing “unavailable” then it’s time to make a template, and these guys discussed something very similar to your issue here:

      state: >
        {% if states('sensor.solarnet_power_photovoltaics')|is_number 
        %}
          {{ states('sensor.solarnet_power_photovoltaics') | float * 1000 | round(2) }}
        {% else %}       
          {{ 0 }}
        {% endif %}   

image

@RB0 The autoscale doesn’t always work for my solar panel system, that’s why I had to resort to template. It would change and a few minutes later change back.

Thanks for all the great ideas. I see what the issue is with rounding of additional essential loads when using auto_scale. I’ll fix that.

For the battery icon have you set the full_capacity: and empty_capacity: attributes. e.g. ff you only want the battery to show empty when 10% set empty_capacity: 10

1 Like

Ah, now that I’ve played with those capacities, it looks a lot better. I’ll check during tomorrow’s battery cycle but that is probably the reason.
Just for clarity, I had tried using “decimal_places: 2” as per the full config example, but it doesn’t seem to work at all. I tried it in various places, as a component under solar etc but to no effect.

Yes there was a problem with the code. I’ve pushed a new version to fix that.

v3.3.0

:rocket: Exciting New Features

  • feat: display Goodwe inverter status. Set inverter model to goodwe closes #108
  • feat: display Goodwe battery status. See entity battery_status closes #108

image

:bug: Patches & Bug Fixes

  • fix: rounding of additional load values when auto_scale: true and value is less than 1000W
  • docs: add Goodwe example. Thanks @mamo-nick
  • docs: update Lux example

Full Changelog: Comparing v3.2.1...v3.3.0 · slipx06/sunsynk-power-flow-card · GitHub

1 Like

Hi,
in goodwe template, please correct sensor in battery_status
battery_status: input_number.test_number

Right sensor:
battery_status: sensor.battery_mode_code

Updated. Thanks

1 Like

Hi, it is possible add new value near grid side? I have virtual battery from energy distributor and I would like show this value in. Thanks
image

1 Like

another update :slight_smile: v3.4.0

What’s Changed

:rocket: Exciting New Features

  • feat: display a different colour when exporting (selling) energy to the grid. See the export_colour: attribute under the grid section
  • locale: update German translation. Thanks @svenopdehipt

Full Changelog: Comparing v3.3.0...v3.4.0 · slipx06/sunsynk-power-flow-card · GitHub

When I have following code,

export const batteryStatusGroups = {
    goodwe: { 
        noBattery: { states: ['0'], color: 'yellow', message: 'No Battery' },
        standby: { states: ['1'], color: 'blue', message: 'Standby' },
        discharging: { states: ['2'], color: 'red', message: 'Discharging' },
		charging: { states: ['3'], color: 'green', message: 'Charging' },
		waiting: { states: ['4','5'], color: 'yellow', message: 'Waiting' },
    }

   }

I get the following error.

Configuration errors detected:
can not read a block mapping entry; a multiline key may not be an implicit key (86:11)

 84 |   total_pv_generation: sensor.srne_accumu ...
 85 |   export const batteryStatusGroups = {
 86 |     goodwe: { 
----------------^
 87 |         noBattery: { states: ['0'], color ...
 88 |         standby: { states: ['1'], color:  ...

What is the problem here?

What version do you have? I have had similar issue at 3.3.0. Ver 3.4.0. resolved it.

I have the latest 3.5.0

Still have the error.

May be it’s bad indentation.

This is the full code. Can someone please correct it?

type: custom:sunsynk-power-flow-card
cardstyle: full
panel_mode: false
large_font: true
show_solar: true
card_height: 760px
auto_scale: false
inverter:
  model: goodwe
  modern: true
  colour: grey
temp_unit: C
decimal_places: 2
battery:
  energy: 8000
  auto_scale: true
  shutdown_soc: 20
  invert_power: true
  colour: pink
  show_daily: true
  animation_speed: 6
  max_power: 4700
  full_capacity: 100
  empty_capacity: 20
  warn_color: Red
solar:
  display_mode: 3
  colour: orange
  show_daily: true
  auto_scale: true
  mppts: 1
  animation_speed: 9
  max_power: 3300
load:
  colour: '#5fb6ad'
  auto_scale: true
  show_daily: true
  invert_aux: true
  animation_speed: 8
  max_power: 4700
grid:
  colour: '#5490c2'
  show_daily_buy: true
  show_daily_sell: false
  no_grid_colour: '#a40013'
  show_nonessential: false
  auto_scale: true
  invert_grid: true
  nonessential_name: Non Essential
  nonessential_icon: oven
  additional_loads: two
  animation_speed: 8
  max_power: 4700
entities:
  priority_load_243: switch.sunsynk_toggle_priority_load
  inverter_voltage_154: sensor.srne_inverter_voltage
  load_frequency_192: sensor.srne_inverter_frequency
  inverter_current_164: sensor.sunsynk_inverter_current
  inverter_power_175: sensor.srne_current_load_power
  grid_connected_status_194: switch.ac_input_breaker_switch
  inverter_status_59: sensor.state_now
  day_battery_charge_70: sensor.daily_battery_charge
  day_battery_discharge_71: sensor.daily_battery_discharge
  battery_voltage_183: sensor.jk_bms_total_voltage
  battery_soc_184: sensor.jk_bms_state_of_charge
  battery_power_190: sensor.jk_bms_power
  battery_current_191: sensor.jk_bms_current
  grid_power_169: sensor.grid_load_in_w
  day_grid_import_76: sensor.daily_usage_from_grid
  day_grid_export_77: none
  grid_ct_power_172: sensor.grid_load_in_w
  day_load_energy_84: sensor.daily_usage_with_inverter
  essential_power: sensor.srne_current_load_power
  nonessential_power: none
  aux_power_166: sensor.srne_current_load_power
  day_pv_energy_108: sensor.daily_generation_with_inverter_w
  pv1_power_186: sensor.srne_pv_power
  pv1_voltage_109: sensor.srne_pv_voltage
  pv1_current_110: sensor.srne_pv_current
  remaining_solar: sensor.solcast_pv_forecast_forecast_remaining_today
  energy_cost_buy: sensor.electricity_bill
  total_pv_generation: sensor.srne_accumulated_solar_generation
  export const batteryStatusGroups = {
      goodwe: {
          noBattery: { states: ['0'], color: 'yellow', message: 'No Battery' },
          standby: { states: ['1'], color: 'blue', message: 'Standby' },
          discharging: { states: ['2'], color: 'red', message: 'Discharging' },
  		  charging: { states: ['3'], color: 'green', message: 'Charging' },
	  	  waiting: { states: ['4','5'], color: 'yellow', message: 'Waiting' },
      }

  };

Hi there is a problem with your configuration… Here is an example you can use

https://slipx06.github.io/sunsynk-power-flow-card/examples/goodwe.html

You seem to have some custom attributes in your config that are not part of the official release. I’ve removed them from your config below. You also need to specify your own sensor for battery_status

type: custom:sunsynk-power-flow-card
cardstyle: full
panel_mode: false
large_font: true
show_solar: true
card_height: 760px
decimal_places: 2
inverter:
  model: goodwe
  modern: true
  colour: grey
  auto_scale: false
battery:
  energy: 8000
  auto_scale: true
  shutdown_soc: 20
  invert_power: true
  colour: pink
  show_daily: true
  animation_speed: 6
  max_power: 4700
  full_capacity: 100
  empty_capacity: 20
solar:
  display_mode: 3
  colour: orange
  show_daily: true
  auto_scale: true
  mppts: 1
  animation_speed: 9
  max_power: 3300
load:
  colour: '#5fb6ad'
  auto_scale: true
  show_daily: true
  invert_aux: true
  animation_speed: 8
  max_power: 4700
grid:
  colour: '#5490c2'
  show_daily_buy: true
  show_daily_sell: false
  no_grid_colour: '#a40013'
  show_nonessential: false
  auto_scale: true
  invert_grid: true
  nonessential_name: Non Essential
  nonessential_icon: oven
  additional_loads: two
  animation_speed: 8
  max_power: 4700
entities:
  priority_load_243: switch.sunsynk_toggle_priority_load
  inverter_voltage_154: sensor.srne_inverter_voltage
  load_frequency_192: sensor.srne_inverter_frequency
  inverter_current_164: sensor.sunsynk_inverter_current
  inverter_power_175: sensor.srne_current_load_power
  grid_connected_status_194: switch.ac_input_breaker_switch
  inverter_status_59: sensor.state_now
  day_battery_charge_70: sensor.daily_battery_charge
  day_battery_discharge_71: sensor.daily_battery_discharge
  battery_voltage_183: sensor.jk_bms_total_voltage
  battery_soc_184: sensor.jk_bms_state_of_charge
  battery_power_190: sensor.jk_bms_power
  battery_current_191: sensor.jk_bms_current
  grid_power_169: sensor.grid_load_in_w
  day_grid_import_76: sensor.daily_usage_from_grid
  day_grid_export_77: none
  grid_ct_power_172: sensor.grid_load_in_w
  day_load_energy_84: sensor.daily_usage_with_inverter
  essential_power: sensor.srne_current_load_power
  nonessential_power: none
  aux_power_166: sensor.srne_current_load_power
  day_pv_energy_108: sensor.daily_generation_with_inverter_w
  pv1_power_186: sensor.srne_pv_power
  pv1_voltage_109: sensor.srne_pv_voltage
  pv1_current_110: sensor.srne_pv_current
  remaining_solar: sensor.solcast_pv_forecast_forecast_remaining_today
  energy_cost_buy: sensor.electricity_bill
  total_pv_generation: sensor.srne_accumulated_solar_generation
  battery_status: sensor.battery_mode_code
  

1 Like

Thanks. But how to add the following part if I can get sensor.battery_mode_code?

export const batteryStatusGroups = {
      goodwe: {
          noBattery: { states: ['0'], color: 'yellow', message: 'No Battery' },
          standby: { states: ['1'], color: 'blue', message: 'Standby' },
          discharging: { states: ['2'], color: 'red', message: 'Discharging' },
  		  charging: { states: ['3'], color: 'green', message: 'Charging' },
	  	  waiting: { states: ['4','5'], color: 'yellow', message: 'Waiting' },
      }

  };