Integration Solar inverter huawei 2000L

yes I have already stolen this from you !! :slight_smile: works good.

but what I want is the amount of power im using which I can work out by subtracting
“{{ state_attr(‘sensor.sun2000_8ktl_m0’, ‘power_meter_active_power’) | float(0) }}”’

from how much power is being generated which I thought would be
“{{ states(‘sensor.sun2000_8ktl_m0’) | float(0) }}”’

so I thought it would be:
“{{ state_attr(‘sensor.sun2000_8ktl_m0’, ‘power_meter_active_power’) | float(0) - states(‘sensor.sun2000_8ktl_m0’) | float(0)}}”’

but when I do this it breaks all my atttributes…

and also - for the one that does work “{{ state_attr(‘sensor.sun2000_8ktl_m0’, ‘power_meter_active_power’)}}" - how do I add this value to the energy dashboard for the ‘return to grid’ value - doesnt have anything except daily_yield and total_yield

In HA you have developer tools → template and you can check if it’s working. It could be mistake in yaml file (to many spaces or something similar).

Return to grid that mean energy sent to grid in kWh so you need

grid_exported_energy

edit:
I read again your post and

and I think correctly will be adding not subtracting, because energy used from grid is negative and energy generated from inverter is positive so if you are using eg: 1000 W and generating 3000W you should count it : -1000 + 3000 = 2000
English is not my primary language and I hope you will understand what I have on mind.

ok ill try and show you what it says.

I know about the grid.exported attribute that I templated using your code. but how do I make it show up in the energy dashboard to be able to select from the dropdown for return to grid?

{{ state_attr(‘sensor.SUN2000-5KTL-L1_HV2150011134’, ‘power_meter_active_power’) | float(0) - states(‘sensor.SUN2000-5KTL-L1_HV2150011134’) | float(0) }}

Answer:

Result type: number
0
This template listens for the following state changed events:

Entity: sensor.SUN2000-5KTL-L1_HV2150011134

should not be zero…?

It was written in this topic that if you want to see entity in energy tab it must have some attributes:

oh ok, where do I put those? in the individual template sensors: ??

I’m using it in this way and it’s working for me, but you can also change it in entity customize.

So, seems like my odyssey is still far away to be solved. Today I found my Dongle updated to version 124 and this blocked communication with HA integration. I checked port 502 and it appears closed and I don’t have any option in FusionSolar to open it.

Good afternoon

I am configuring my Huawei SUN2000-5KTL-L1 inverter with the Modbus module integrated in Home Assisant. So far so good, although I am putting more records from the datasheet.

I have a question about the registration with address 32066 with title Power grid voltage / Line voltage between phases A and B. It tells me that "When the output mode is L / N, L1 / L2 / N, or L1 / L2, Power grid voltage is used ". The question is, that in my case, would the first option be (Power grid voltage) instead of the second (Line voltage between phases A and B) since I BELIEVE my inverter is single phase so my mode is L / N?

Also, would the Line voltage between phases B and C and Line voltage between phases C and B registers not be valid?

In the same way, since my measurement equipment is single phase (single phase ddsu666-h). Therefore, the signals A, B, C phase voltage and A, B, C phase current and A-B line voltage, B-C line
voltage, AC line voltage and A, B, C phase active power, won’t they serve me either?

Thank you

I have found using the developer tools for template that state_attr(‘sensor.SUN2000-5KTL-L1_HV2150011134’, ‘power_meter_active_power’)|float = 0

which it should be -1400w. So I think thats why its breaking, not sure why it isnt working because it does on the dashboards…

Perfect, thanks!

Hi guys,
Today I upgraded my FE-Dongle from V100R001C00SPC122 to new firmware V100R001C00SPC124.
After the upgrade the TCP ModBus port (502) was CLOSED.

PORT    STATE  SERVICE
502/tcp closed mbap

It was not working at all - disabled, connection refused !!!
Note: I am using LAN cable (not wifi)

I had to downgrade to V100R001C00SPC123 and now it is working back again!
So - be careful with this.
Why huawei had disabled this feature ?!

Is was already written about it in this topic. It is only disabled connection in spc124. You can enable it in setting if you also have newest firmware in inverter.

Rafał @ligeza,
Big thanks for this (I was searching this thread for the whole version string and now i know why I did not find it :wink: )
Can I ask you what version you have in you inverter and dongle? Did you enabled this exactly as mentioned in the post you referenced?

I am asking because according to the huawei’s note:

Firmware2: SUN2000MA V100R001C00SPC139 is released for the SUN2000M1/M2 series inverters.

The V100R001C00SPC139 is for SUN2000MA but I have SUN2000-6KTL-M0 - so it is M0, not M1/M2 series…
I have a plenty of firmware versions available from fusionsolar (not only compatible/available for my inverter) which is very misleading…

I have spc136 in inverter and spc123 in dongle. I don’t upgrade because I don’t need to (everything is working perfectly for me).
I checked release notes and I see SUN2000-6KTL-M0 in the list.

When I try to check it myself it always end up with a login page saying “Sign In with Uniportal ID” :frowning:
You have an account there?

Yes, you can add your device (by serial number) to you account and you will have access to some files. But the firmware files are old on their website.

Thanks heaps, the power consumption is working now.

But where do I put the fields device_class: energy
state_class: total_increasing
??

Do I put it in configuration.yaml? Under “- template:” or “-platform” … not sure whre to put that code block starting with ‘name’?

From HA template example:

template:
  - sensor:
      - name: "Transmission Down Speed"
        unit_of_measurement: "kB/s"
        state: "{{ states('sensor.transmission_down_speed')|float * 1024 }}"

      - name: "Transmission Up Speed"
        unit_of_measurement: "kB/s"
        state: "{{ states('sensor.transmission_up_speed')|float * 1024 }}"