Integration Solar inverter huawei 2000L

More over it’s a security issue.

They can know what you do , when you do, know if you’re at home or not just by analyzing your power consumption…

1 Like

That’s why i remove it… I guess some companies dont care about RPGD

And if they complain with it, they just have to shut up

In fact, i’v order a 2nd battery and you will instal on monday

Already read the installation manual and it’s “almost” plug and play…

1 Like

And what is happen if the install company close forever? Who will control my system?

1 Like

of course… they have to remove your system from company’s account

Hi , is it possible to share your complete configuration? I’m facing about the same issues as you had.

1 Like

Sure

configuration.yaml

template:

  • sensor:
    • name: “House power Consumption”
      unique_id: “house_power_consumption”
      unit_of_measurement: “W”
      device_class: power
      state_class: measurement
      state: >
      {% set meter_power = states(‘sensor.power_meter_active_power’) | float %}
      {% set inverter_power = states(‘sensor.inverter_active_power’) | float %}
      {{ (inverter_power - meter_power ) | float(0) }}
  • sensor:
    • name: “Overproduction Company Injection”
      unique_id: “solar_power_Overproduction”
      unit_of_measurement: “W”
      device_class: power
      state_class: measurement
      state: >
      {% set meter_power = states(‘sensor.house_power_consumption’) | float %}
      {% set inverter_power = states(‘sensor.inverter_input_power’) | float %}
      {% set battery = states(‘sensor.battery_charge_discharge_power’) | float %}
      {{ (inverter_power - meter_power - battery ) | float(0) }}
  • sensor:
    • name: “Companny import”
      unique_id: “Companny import”
      unit_of_measurement: “W”
      device_class: power
      state_class: measurement
      state: >
      {% set consumo_rede_edp = states(‘sensor.power_meter_active_power’) | float %}
      {{ (consumo_rede_edp * (-1) ) | float(0) }}

the “Company import” i had to multply by -1 to give me a positve value

so with this:

then in lovelace

image

type: gauge
entity: sensor.house_power_consumption
min: 0
max: 6000
name: House power Consumption
unit: W
theme: Google Light Theme
needle: true
severity:
green: 0
yellow: 2500
red: 4000

image

type: gauge
entity: sensor.overproduction_companny_injection_2
min: 0
max: 5000
name: Overproduction Company Injection
unit: W
theme: Google Light Theme
needle: true
severity:
green: 0
yellow: 1500
red: 3200

image

type: gauge
entity: sensor.consumo_edp
min: -5750
max: 5750
name: Companny import
unit: W
theme: Google Light Theme
needle: true
severity:
green: -5750
yellow: 0
red: 0

Also have a “power-distribution-card” (you must change the values for your sensors)

type: custom:power-distribution-card
title: Diagrama Rede
entities:

  • decimals: 2
    display_abs: true
    name: Casa
    unit_of_display: W
    icon: mdi:home
    entity: sensor.house_power_consumption
    preset: home
    invert_value: true
    icon_color:
    bigger: blue
    equal: blue
    smaller: blue
    arrow_color:
    bigger: blue
    equal: blue
    smaller: blue
  • decimals: 2
    display_abs: true
    name: Solar
    unit_of_display: W
    icon: mdi:solar-power
    producer: true
    entity: sensor.inverter_input_power
    preset: solar
    invert_value: false
    icon_color:
    bigger: orange
    equal: orange
    smaller: orange
    arrow_color:
    bigger: orange
    equal: orange
    smaller: orange
  • decimals: 2
    display_abs: true
    name: Bateria
    unit_of_display: W
    consumer: true
    icon: mdi:battery-outline
    producer: true
    entity: sensor.battery_charge_discharge_power
    preset: battery
    invert_value: true
    secondary_info_replace_name: false
    icon_color:
    bigger: green
    equal: green
    smaller: green
    arrow_color:
    bigger: purple
    equal: purple
    smaller: green
    battery_percentage_entity: sensor.battery_state_of_capacity
  • decimals: 2
    display_abs: true
    name: EDP
    unit_of_display: W
    icon: mdi:transmission-tower
    entity: sensor.consumo_edp
    preset: grid
    icon_color:
    bigger: red
    equal: red
    smaller: red
    arrow_color:
    bigger: red
    equal: black
    smaller: green
    grid_buy_entity: sensor.power_meter_consumption
    grid_sell_entity: sensor.power_meter_exported
  • decimals: ‘0’
    display_abs: true
    name: Bateria
    unit_of_display: ‘%’
    consumer: true
    icon: ‘’
    producer: true
    entity: sensor.battery_status
    preset: battery
    invert_value: true
    secondary_info_replace_name: true
    hide_arrows: true
    secondary_info_entity: sensor.battery_state_of_capacity
    icon_color:
    bigger: green
    equal: green
    smaller: green
    center:
    type: card
    content:
    type: glance
    icon: null
    entities:
    • weather.accuweather
      animation: slide

Overall

2 Likes

Cool, thanks man. :wink:

Hi,

i have a huawei SUN2000-4.6KTL-L1 with powermeter and battery. I’m using the tesla power card GitHub - reptilex/tesla-style-solar-power-card: Home assistant power card mimicking the one tesla provides for the powerwall app. to view the values of my solar , house usage and battery.

Everything was fine when i did’t have the battery , but now from when the battery is installed , i get wrong values. Who can help me figure this out?

These are the sensors i get from the integration that are important to me:

battery:

sensor.battery_charge_discharge_power

inverter:

sensor.daily_yield
sensor.active_power
sensor.input_power

power meter:

sensor.grid_active_power

I need the correct templates to use them in the power card. But there must be something wrong with the templates i’m using.

This is my config i use :

sensor:

  • platform: template
    sensors:

    sensor used to show power flow from Panels to Grid, but shows a negative at night

    template_grid_feed_in:
    friendly_name: “Solar 2 Grid”
    unit_of_measurement: “W”
    device_class: power
    value_template: >
    {% if states(‘sensor.grid_active_power’) | int > 0 %}
    {{ states(‘sensor.grid_active_power’) }}
    {% else -%}
    0
    {% endif %}

    sensor used to show power flow from grid to house and doesn’t allow it to show a negative number only positive numbers

    template_grid_consumption:
    friendly_name: “net naar huis”
    unit_of_measurement: “W”
    device_class: power
    value_template: >
    {% if states(‘sensor.grid_active_power’) | int > 0 %}
    0
    {% else -%}
    {{ (states(‘sensor.grid_active_power’) | int) | abs }}
    {% endif %}

    shows the solar power being fed to the house and doesn’t allow it to show a negative number only positive numbers

    template_curent_solar_consumption:
    friendly_name: “curent solar consumption”
    unit_of_measurement: “W”
    device_class: power
    value_template: >-
    {% if states(‘sensor.template_grid_consumption’) | float > 0 %}
    {{ states(‘sensor.active_power’) }}
    {% else -%}
    {{ (states(‘sensor.active_power’)| float - states(‘sensor.template_grid_feed_in’)| float) }}
    {% endif %}

    shows live usage for the house

    template_live_verbruik:
    friendly_name: “verbruik huis live”
    unit_of_measurement: “W”
    device_class: power
    value_template: >-
    {% set val1 = states(‘sensor.active_power’)| float(0) %}
    {% set val2 = states(‘sensor.grid_active_power’)| float(0) %}
    {{ iif(val1 >= val2, val1 - val2, this.state) }}

    shows own usage

    template_own_usage:
    friendly_name: “eigen opwekking”
    unit_of_measurement: “kWh”
    device_class: power
    value_template: >-
    {{ (states(‘sensor.daily_yield’)| float - states(‘sensor.grid_export_solar_daily_energy’)| float) }}

    shows usage per day

    template_usage_per_day:
    friendly_name: “verbruik per dag”
    unit_of_measurement: “kWh”
    device_class: power
    value_template: >-
    {{ (states(‘sensor.template_own_usage’)| float + states(‘sensor.grid_import_solar_daily_energy’)| float) }}

    template_solar_to_battery:
    friendly_name: “from solar to battery”
    unit_of_measurement: “W”
    device_class: power
    value_template: >
    {% if states(‘sensor.battery_charge_discharge_power’) | int > 0 %}
    {{ states(‘sensor.battery_charge_discharge_power’) }}
    {% else -%}
    0
    {% endif %}

    template_battery_to_house:
    friendly_name: “from battery to house”
    unit_of_measurement: “W”
    device_class: power
    value_template: >
    {% if states(‘sensor.battery_charge_discharge_power’) | int > 0 %}
    0
    {% else -%}
    {{ (states(‘sensor.battery_charge_discharge_power’) | int) | abs }}
    {% endif %}

  • platform: integration
    source: sensor.boiler_power
    name: boiler energie
    unit_prefix: k
    round: 2

  • platform: integration
    source: sensor.vriezer_power
    name: vriezer energie
    method: left
    unit_prefix: k
    round: 2

  • platform: integration
    source: sensor.koelkast_power
    name: koelkast energie
    method: left
    unit_prefix: k
    round: 2

  • platform: integration
    source: sensor.wasmachine_power
    name: wasmachine energie
    method: left
    unit_prefix: k
    round: 2

  • platform: integration
    source: sensor.vaatwas_power
    method: left
    name: vaatwas energie
    unit_prefix: k
    round: 2

  • platform: integration
    source: sensor.koffiezet_power
    method: left
    name: koffiezet energie
    unit_prefix: k
    round: 2

  • platform: integration
    source: sensor.ender_5_plus_power
    method: left
    name: ender 5 plus energie
    unit_prefix: k
    round: 2

  • platform: integration
    source: sensor.pomp_zwembad_power
    method: left
    name: pomp zwembad energie
    unit_prefix: k
    round: 2

utility_meter:
grid_import_solar_daily_energy:
source: sensor.grid_consumption
cycle: daily
grid_export_solar_daily_energy:
source: sensor.grid_exported
cycle: daily

3 Likes

I am trying to setup the integration using a Waveshare RS485 to WiFi/Ethernet Module, Rail-Mount Serial Server, RS485 to WIFI/Ethernet Module, Modbus MQTT Gateway | RS485 TO WIFI/ETH without success. I want to use Ethernet, not Wifi. Has anyone tried this with success?

Hello to all

is there any way to get data every second? I have resources and storage for all the data…

i can only get 10s interval

1 Like

Hi there,

I’m using the Huawei SUN2000 with a Luna 2000 battery in combination with the wlcrs/huawei_solar HA plugin. I was wondering if more people with this kind of configuration have issues with the Force Charge/Discharge Battery service calls.

It the moment I am not able to force any charging of the battery. My goal is to charge my battery at night when sum of my average daily power usage AND tomorrows forecast is lower than the capacity of my battery (I have tested this with a static value as well but no luck).

I do this by using an automation to:
“Turn on Battery Charge from grid”
“Change Battery Working Mode” option to “Time of Use” (I have read this is mandatory, is this true?)
Select a “Forcible Charge to a SoC level”.

I have tested the automation by using the “Run” command and the configuration of my battery does indeed change to “Turn on Battery Charge from grid” and “Time of Use”, but I cannot confirm a change in “Forcible Charge to a SoC level” since no charge is being added to my battery.

Am I forgetting something crucial here or does anyone has some tips in getting this automation to work?

3 Likes

Hello to all

i’ve manage to take Data every SECOND !!

Make a backup!!!

change this values to what you want (this is the fetching data time)

in /config/custom_components/huawei_solar/const.py

change

UPDATE_INTERVAL = timedelta(seconds=30)

to

UPDATE_INTERVAL = timedelta(seconds=1)

then in /config/custom_components/huawei_solar/init.py

NOTE: there are 2 ou 3 lines with this value!!

update_interval: timedelta | None = None,

to

update_interval: timedelta(seconds=1),

UPDATE:

the value is only update, if changes…

for example… if the battery is at "100% for an hour, it will say “updated 1 hour ago” despite getting the value each second

5 Likes

For the past few days, I have been unable to connect to my inverter from my LAN ip address (192.168.1.x)
Ports 502 and 6607 are closed (tried with telnet)
I can only connect from its wifi network (192.168.200.x)
Would you know how to help me?

After restarting HA (I restarted the HA many times and restarted the VM), it takes a very long time to start wlcrs/huawei_solar (about 10 minutes). After 10 minutes, everything works ok.
Dongle: V100R001C00SPC132
Inverter: V100R001C00SPC141
Home Assistant 2022.9.7
Supervisor 2022.09.1
Operating System 9.0
Errors:

image

I experience the same, I think that the difference between battery discharge and daily yield is that battery discharge is how much energy is consumed from the actual battery capacity (e.g. if a 10 KWh battery goes from 90% to 80%, it discharges 1 KWh), whereas the daily yield (at night) is the energy the inverter really provided to your house. The difference between the two values can be the sum of battery electrochemical performance looses, inverter DC to AC looses and inverter+battery electronics consumption. If your house is using just a few watts, the looses can be more than what you get.

I think that it may be useful to be able to turn off the inverter from Home Assistant (if it maintains the WiFi connection active) so we can switch it off instead of setting the discharge power to zero. In Fusion Solar app when connected to the inverter WiFi, there is an option to turn off the inverter. Do you think it’s possible to expose that as a toggle? Also in the app there is an option to hibernate at night, but I’ve never tried that.

Can you share some screenshots of the toggles in FusionSolar that you are referring to? I’m not sure to what you are referring.

Hi all,

I am trying to setup the Huawei_solar integration via Hacs. Once installed I try to set it up and I get a “Reading from the inverter failed.” I am trying to connect via modbus-tcp.

I have a serial485 to wifi setup and working. I have node red reading from the serial in the inverter via tcp so this is working fine as you can see:

but I am still getting and error.

From the log files I see

File “/usr/local/lib/python3.10/asyncio/tasks.py”, line 458, in wait_for

raise exceptions.TimeoutError() from exc

asyncio.exceptions.TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py”, line 150, in create

await huawei_solar._initialize()

File “/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py”, line 115, in _initialize

self.time_zone = (await self.get(rn.TIME_ZONE)).value

File “/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py”, line 245, in get

return (await self.get_multiple([name], slave))[0]

File “/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py”, line 287, in get_multiple

response = await self._read_registers(

File “/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py”, line 378, in _read_registers

result = await _do_read()

File “/usr/local/lib/python3.10/site-packages/backoff/_async.py”, line 141, in retry

await _call_handlers(on_giveup, *details)

File “/usr/local/lib/python3.10/site-packages/backoff/_async.py”, line 34, in _call_handlers

await hdlr(details)

File “/usr/local/lib/python3.10/site-packages/backoff/_async.py”, line 16, in f

return coro_or_func(*args, **kwargs)

File “/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py”, line 323, in backoff_giveup

raise ReadException(

huawei_solar.exceptions.ReadException: Failed to read register 43006 after 5 tries

Any Idea what i can check??

thanks

My experience is that you cannot combine reading over serial with reading via Modbus-TCP and still have reliable readings. I suspect that both communication channels are connected internally to the core processor in such a way that they interfere with each other.

it only allow one connection

Tecnically I am only reading via Serial.