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
214 stars 57 forks source link

Add support for SolaX Power Inverter #176

Closed matomatusov closed 11 months ago

matomatusov commented 11 months ago

Is there an existing issue for this?

Current Behavior

Hi, Add support for SolaX Power Inverter. Could it be added?

Thanks

Steps To Reproduce

No response

Expected behaviour

Add additional inverters

Card Version

4.5.1

Home Assistant Version

2023.12.2

Configuration

No response

Relevant log output

No response

slipx06 commented 11 months ago

Hi. The card can be used with any inverter if you are able to map the required sensors. What integration method are you using?

matomatusov commented 11 months ago

Hi, I am used integration method modbus RS485.

slipx06 commented 11 months ago

What is not working?

richsimpson commented 11 months ago

I have it working on Solax, be great if it worked by default to make it simpler. I can share my code if you like? I think I have created a couple of the sensors manually actually. But majority will be there as a starter.

richsimpson commented 11 months ago

image

type: custom:sunsynk-power-flow-card cardstyle: compact show_solar: true show_grid: true show_battery: true battery: energy: 17600 shutdown_soc: 11 show_daily: true invert_power: true max_power: 3750 auto_scale: false show_absolute: false hide_soc: false solar: show_daily: true mppts: 1 max_power: 7000 display_mode: 2 animation_speed: 9 dynamic_colour: false load: show_daily: true max_power: 15000 show_aux: false show_nonessential: true additional_loads: 2 load1_name: Water load2_name: EV load1_icon: mdi:thermometer-water load2_icon: mdi:ev-station animation_speed: 9 grid: show_daily_buy: true show_daily_sell: true show_nonessential: false animation_speed: 9 auto_scale: false export_colour:

matomatusov commented 11 months ago

Hi, I don't know why the inverter doesn't want to show me the correct status.

status

Pho3niX90 commented 11 months ago

Hi, I don't know why the inverter doesn't want to show me the correct status.

status

Do you have example data of what that sensor returns? Will probably need a code addition for this, as well as the solax inverter image

richsimpson commented 11 months ago

There is a Run Mode with these options:

Normal Mode Idle Mode Checking

image

image image

matomatusov commented 11 months ago

Pho3niX90

this sensor is returning:

Pho3niX90 commented 11 months ago

If you know how to change the js file without hacs, you can test the PR #179 to make sure everything was considered before the merge. It would include deleting the files in www/community/sunsynk-power-flow-card and adding the dist/sunsynk-power-flow-card.js into that folder

The statuses were grouped as follows:

solax: {
        normal: {states: ['normal mode'], color: 'green', message: localize('common.normal')},
        standby: {states: ['waiting', 'checking', 'idle mode', 'standby'], color: 'blue', message: localize('common.standby')},
        selftest: {states: ['self test'], color: 'yellow', message: localize('common.selftest')},
        offgrid: {states: ['off-grid waiting', 'off-grid', 'eps mode'], color: 'green', message: localize('common.offgrid')},
        fault: {states: ['permanent fault mode', 'fault'], color: 'red', message: localize('common.fault')},
        check: {states: ['checking', 'update mode', 'eps check mode'], color: 'orange', message: localize('common.check')},
    }

And the image: image

matomatusov commented 11 months ago

Hi, and where can the file be downloaded? dist/sunsynk-power-flow-card.js

Thanks

Pho3niX90 commented 11 months ago

From here https://github.com/slipx06/sunsynk-power-flow-card/pull/179/files

matomatusov commented 11 months ago

somehow the Solax doesn't appear there.

12

Pho3niX90 commented 11 months ago

Be sure to remove the both the .js and .js.gz file from the folder, before adding the new js, then you need to clear your browser cache, or, use incognito mode

matomatusov commented 11 months ago

I don't know where I'm doing wrong, but it doesn't appear there. Solax is in the file.

13

Pho3niX90 commented 11 months ago

I don't know where I'm doing wrong, but it doesn't appear there. Solax is in the file.

13

If using chrome, open dev tools (F12), right click on the reload button, and click hard reload.

Sometimes Cntrl + Shift + R also works

This is probably just a cache issue.

slipx06 commented 11 months ago

Thanks @Pho3niX90 tested and everything looks good

slipx06 commented 11 months ago

@matomatusov once you have tested please check that the provided example is still correct.

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

matomatusov commented 11 months ago

Hi, slipx06

Wrong status is displayed. Inverter is status Idle. inverter status

slipx06 commented 11 months ago

HI. That is the correct mapping

The following states 'waiting', 'checking', 'idle mode', 'standby will all may to Standby.

solax: {
        normal: {states: ['normal mode'], color: 'green', message: localize('common.normal')},
        standby: {states: ['waiting', 'checking', 'idle mode', 'standby'], color: 'blue', message: localize('common.standby')},
        selftest: {states: ['self test'], color: 'yellow', message: localize('common.selftest')},
        offgrid: {states: ['off-grid waiting', 'off-grid', 'eps mode'], color: 'green', message: localize('common.offgrid')},
        fault: {states: ['permanent fault mode', 'fault'], color: 'red', message: localize('common.fault')},
        check: {states: ['checking', 'update mode', 'eps check mode'], color: 'orange', message: localize('common.check')},
    }
matomatusov commented 11 months ago

Hi, I was not expecting that.

Thanks

TomaszBon commented 10 months ago

Hi, could anyone share the function for calculating the sensor.powerflow_today_house_load for entity 84?

matomatusov commented 10 months ago

Hi, SolaX does not have this entity. It must be assembled from the following entities. today_import_energy + today_solar_energy + battery_output - today_export_energy - battery_input

richsimpson commented 10 months ago

Hi, could anyone share the function for calculating the sensor.powerflow_today_house_load for entity 84?

I set up a sensor for this. I reference this one in my Sunsynk Power Flow Card Configuration day_load_energy_84: sensor.powerflow_today_house_load

And that is created as a sensor as follows:

  powerflow_today_house_load:
    friendly_name: "powerflow_today_house_load"
    unit_of_measurement: "kW"
    value_template: "{{ (states('sensor.solax_today_s_import_energy')| float(0) / 1 + states('sensor.solax_today_s_solar_energy')| float(0) / 1 + states('sensor.solax_battery_output_energy_today') | float(0) / 1) - states('sensor.solax_battery_input_energy_today') | float(0) / 1 - states('sensor.solax_today_s_export_energy') | float(0) / 1  | round(1) }}"

Formatted like this: image