Integration Solar inverter huawei 2000L

Hi Guys, I’m using this integration for a while through WiFi -but readings are inconsistent (some values are zeros). I was wondering, as my Inverter is 30meters away i installed AP station and have now inverter connected via LAN on 192.168.200.1 IP address, my normal network pule is 192.168.8.x, can i use second LAN card (TP-Link USB) and connect this network to HA? I have it installed on PROXMOX?

Got it working! I have to setup CPE Bridge on Mikrotik Router (mAP) required config it attached…as address in integration you have to use bottom address (in my case 192.168.8.55)

off topic. what kind of graph card you’ve used for inverter/battery state?

I was also very curious about those graphs, and figured out that these are ApexCharts.

My config:

type: custom:apexcharts-card
header:
  show: true
  title: Power
  show_states: true
  colorize_states: true
all_series_config:
  type: area
  opacity: 0.1
  stroke_width: 1
  group_by:
    func: last
    duration: 5m
series:
  - entity: sensor.input_power
    color: lightgreen
  - entity: sensor.active_power
    color: blue
  - entity: sensor.charge_discharge_power
    name: Battery Charge
    transform: return Math.max(0,x);
    color: orange
  - entity: sensor.charge_discharge_power
    name: Battery Discharge
    color: '#800080'
    transform: return -Math.min(0,x);
  - entity: sensor.grid_active_power
    name: Grid Export
    transform: return Math.max(0,x);
    color: lime
  - entity: sensor.grid_active_power
    name: Grid Import
    color: red
    transform: return -Math.min(0,x);

gives you:

and

type: custom:apexcharts-card
header:
  show: true
  title: Battery Status
  show_states: true
  colorize_states: true
all_series_config:
  type: area
  opacity: 0.1
  stroke_width: 1
  group_by:
    func: avg
    duration: 15m
  show:
    in_header: false
series:
  - entity: sensor.battery_state_of_capacity
    type: line
    yaxis_id: pct
    opacity: 1
    stroke_width: 3
    group_by:
      func: last
      duration: 15m
    show:
      in_header: true
  - entity: sensor.charge_discharge_power
    name: Battery Charge
    transform: return Math.max(0,x);
    color: darkgreen
    yaxis_id: watts
  - entity: sensor.charge_discharge_power
    name: Battery Discharge
    color: '#800080'
    transform: return -Math.min(0,x);
    yaxis_id: watts
yaxis:
  - id: pct
    show: true
    opposite: true
    decimals: 0
    max: 100
    min: 15
  - id: watts
    show: true
    decimals: 0
    align_to: 250


gives you:

image

5 Likes

Yes, as @ligeza said it is “normal”. Efficiency of 655.35% is the read register with value 0xFFFF - It just means that the inverter is not working and efficiency is not calculated. The integration should probably just strip those values out… what you think @wlcrs ?

I’m not inclined to add such logic in the library. For me this is a bug on the inverter-side, not on the library side. I don’t want to create a precedent for having to support quirks like these, because this can get out of hand quickly, and I rather invest my time in other features like reading the optimizer data.

You can of course create template sensors yourself that fix the reading for your specific situation.

1 Like

I have installed openwrt on the raspberry, I connect to the device through LAN connection from my desktop (I have disabled the master wifi on openwrt) and homeassistant get the information through LAN too. As you can see the brigde is between Wifi cliente and LAN interface. If you don’t have possibility to connect with LAN and need to use the master wifi, I think it could be poissible but increase a little more the configuration dificulty. I don’t understand very well your question about save and update configuration. I click on “save” after modified the configuration on every screen, and I saved a backup file of the router configuration after succesfully finalize the whole configuration of the reouter.
To connect your Homeassistant integration to the sun2000L you need to put into the integration as host the IP (LAN IP) of the openwrt router and the port according your configuration for port forwarding in openwrt router.

Continuing the discussion from Integration Solar inverter huawei 2000L:

Hi all!
I am a new user on this forum…So please dont be ungry because i can not read this long forum :frowning:
So I have a Huawei Solar 8ktl-m1 inverter and it is connecting to the net via ethernet.
The droid app and the huawei website is working and i can monitor the datas.
But!
I can not read the datas with HA :frowning: I configured the inverter and i set the modbus to rs485 but i can not connect ot iverter.
:frowning:
Plase help me! I can ping the inverter but i can not read the datas just only in the app.
what is my mistake ?
how can i set the inverter ? please give me informaton step by step …
just only in the settings! I can login into the inverter setup.
I read somewhere that i can read the datas only just one app… It is true?
thank you very much to everybody

What firmware version do you have in smart dongle? For me the best is 123 because it has opened port for LAN. In newer firmware you have to set permission in inverter settings to connect to smart dongle. With lan cable you should set slave=1 and port 502 (with newest firmware you can try 6607 and sometimes slave may be a higher number, probably it is written somewhere in the inverter settings ).
Only one connection is possible to smart dongle to read data, but app on phone is not connected directly to inverter but read statistics from internet. So with right firmware and correct settings it should work.

Thanks

Now looks like the firmware version of my dongle i:V100R001C00SPC119
Than is it not good for me?
Now here is night… So tomorrow moorning i will try to update te dongle.
Can i do it in the setup of the inverte? With android app?
Thx
Regards

You can change to unrestricted and then it should work on current firmware.

Moorning
So I can not see the dongle update in the inverter setup… :frowning:
The modbus is enable ( unrestricted) and now?
Now looks like i do something wrong.
I put information in to configuration yaml
Nothing
I see the sensor but no information

Please help me…
Thx

modbus:

  • name: Solar
    type: tcp
    host: 192.168.1.195
    port: 502
  • name: RS485
    type: serial
    baudrate: 9600
    bytesize: 8
    method: rtu
    parity: N
    port: /dev/ttyUSB0
    stopbits: 1
    delay: 5
    timeout: 3

sensor solar:

  • platform: huawei_solar
    host: 192.168.1.195
    port: 502
    optimizers: false
    battery: false

  • platform: template
    sensors:
    pv_input_power:
    friendly_name: “Solar Production”
    #entity_id: sensor.sun2000_8ktl_m1
    unit_of_measurement: ‘W’
    icon_template: mdi:solar-power
    value_template: “{{ state_attr(‘sensor.sun2000_8ktl_m1’, ‘input_power’) }}”

  • platform: template
    sensors:
    pv_daily_yield:
    friendly_name: “Daily Yield”
    #entity_id: sensor.sun200í0_8ktl_m1
    unit_of_measurement: ‘kWh’
    icon_template: mdi:solar-power
    value_template: “{{ state_attr(‘sensor.sun2000_8ktl_m1’, ‘daily_yield’) }}”

  • platform: template
    sensors:
    pv_total_yield:
    friendly_name: “Total Yield”
    #entity_id: sensor.sun2000_8ktl_m1
    unit_of_measurement: ‘kWh’
    icon_template: mdi:solar-power
    value_template: “{{ state_attr(‘sensor.sun2000_8ktl_m1’, ‘total_yield’) }}”

  • platform: template
    sensors:
    pv_string_01_voltage:
    friendly_name: “Pv String 01 Voltage”
    #entity_id: sensor.sun2000_8ktl_m1
    unit_of_measurement: ‘V’
    icon_template: mdi:solar-power
    value_template: “{{ state_attr(‘sensor.sun2000_8ktl_m1’, ‘pv_string_01_voltage’) }}”

  • platform: template
    sensors:
    pv_string_01_current:
    friendly_name: “PV String 01 Current”
    #entity_id: sensor.sun2000_8ktl_m1
    unit_of_measurement: ‘A’
    icon_template: mdi:solar-power
    value_template: “{{ state_attr(‘sensor.sun2000_8ktl_m1’, ‘pv_string_01_current’) }}”

  • platform: template
    sensors:
    pv_string_02_voltage:
    friendly_name: “PV String 02 Voltage”
    #entity_id: sensor.sun2000_8ktl_m1
    unit_of_measurement: ‘V’
    icon_template: mdi:solar-power
    value_template: “{{ state_attr(‘sensor.sun2000_8ktl_m1’, ‘pv_string_02_voltage’) }}”

  • platform: template
    sensors:
    pv_string_02_current:
    friendly_name: “PV String 02 Current”
    #entity_id: sensor.sun2000_8ktl_m1
    unit_of_measurement: ‘A’
    icon_template: mdi:solar-power
    value_template: “{{ state_attr(‘sensor.sun2000_8ktl_m1’, ‘pv_string_02_current’) }}”

  • platform: template
    sensors:
    pv_active_power:
    friendly_name: “Power Meter Active Power”
    #entity_id: sensor.sun2000_8ktl_m1
    unit_of_measurement: ‘kW’
    icon_template: mdi:solar-power
    value_template: “{{ state_attr(‘sensor.sun2000_8ktl_m1’, ‘power_meter_active_power’) }}”

  • platform: template
    sensors:
    consumption:
    friendly_name: “Consumption”
    unit_of_measurement: ‘kW’
    icon_template: mdi:solar-power
    value_template: ‘{{ states(“sensor.sun2000_8ktl_m1”) |float - states(“sensor.pv_active_power”) | float }}’

  • platform: template
    sensors:
    pv_device_status:
    friendly_name: “Device Status”
    #entity_id: sensor.sun2000_8ktl_m1
    icon_template: mdi:solar-power
    value_template: “{{ state_attr(‘sensor.sun2000_8ktl_m1’, ‘device_status’) }}”

  • platform: template
    sensors:
    pv_string_02_power:
    friendly_name: “PV String 02 Power”
    unit_of_measurement: ‘kW’
    icon_template: mdi:solar-power
    value_template: ‘{{ states(“sensor.pv_string_02_voltage”) |float * states(“sensor.pv_string_02_current”) | float / 1000|round(2) }}’

  • platform: template
    sensors:
    pv_string_01_power:
    friendly_name: “PV String 01 Power”
    unit_of_measurement: ‘kW’
    icon_template: mdi:solar-power
    value_template: ‘{{ states(“sensor.pv_string_01_voltage”) |float * states(“sensor.pv_string_01_current”) | float / 1000|round(2) }}’

  • platform: template
    sensors:
    pv_efficiency:
    friendly_name: “Solar Efficiency”
    #entity_id: sensor.sun2000_8ktl_m1
    unit_of_measurement: ‘%’
    icon_template: mdi:solar-power
    value_template: “{{ state_attr(‘sensor.sun2000_8ktl_m1’, ‘efficiency’) }}”

You doing it wrong. You can’t use two different integration to connect to smart dongle because it is only one connection possible at the time. As I said before you have to add in config slave=1 (or sometimes it could be other number ).
I suggest you to delete all this config you posted and use this integration:

On this site you have manual how to install it. Try port 502 and slave=1

Hi

I did it many times
here is te resault:
2022-03-13 07:31:42 ERROR (SyncWorker_0) [pymodbus.client.sync] Connection to (192.168.1.195, 502) failed: [Errno 111] Connection refused
2022-03-13 07:31:46 ERROR (MainThread) [homeassistant.components.sensor] The huawei_solar platform for the sensor integration does not support platform setup. Please remove it from your config.

Now?
I dontn know
:frowning:

Hello farkas16,

Try with this first. If it works you can add more sensors (or the integration) :

Use port 6607 or 502. But actually you should connect to the Inverter AP and use 192.168.200.1.

# Modbus
modbus:
  name: SolarSun2000
  type: tcp
  host: 192.168.1.195
  port: 6607
  delay: 10
  close_comm_on_error: true
  retry_on_empty: true
  retries: 10
  sensors:
    - name: Input Power
      device_class: power
      unit_of_measurement: kW
      count: 2
      address: 32064
      data_type: int32
      scale: 0.001
      precision: 3

PS:

  • If you use the Inverter AP, make sure nothing else (eg APP Phone) is connected to it
  • To update dongle with the APP, you need to connect to the Dongle AP directly with the phone.
    When you unplug the Dongle from the Inverter (usb) and plug it back in (after 1 min), it will broadcast its SSID for a while. Connect to it with the APP (scan QR-code or manually select) and update.

Thx…
Not work…
I try to update the dongle… I see the update but now can you send me a link where is the latest or working firmware?
Thank you so much

You can also update from the portal (if your accounts allows it) or request it from :
[email protected]

To visualize the Modbus TCP connection :

  • Port 6607 or 502 depends on your current firmware of the inverter.
    But If you can connect with the latested APP to the inverter, then it will be 6607.
  • Update the Inverter AND Dongle to the latest firmware/software currently available
  • Activate Unrestricted Modbus TCP mode in the settings for Dongle communication in the Inverter

People without Dongle :


For Option A or without Dongle, HA needs to be connect to your Home Network (eg 192.168.1.X) AND Inverter AP (192.168.200.101).

So HA needs to run on a Host with 2 network interfaces
(eg RPI : LAN = Home Network / Wifi = Inverter AP)

Or you need to Bridge the 2 Networks together (eg router/AP), so HA can access both at the same time.

Thx… No if i connect directly to Inverter there is open port 6607 fine…
But i can not connect with dongle… I enabled in the inverte but nothing.
If i go into the dongle setup i can not see the new firmware

Option A is the preferred/most stable one…
So forget about connecting to the dongle and make HA accessible to both your Home Network and Inverter AP…problem solved (and preferred one)