You don’t need pv_active_power becouse it is the same as value from sensor.sun2000_8ktl_m0 entity.
From HA 0.115 you don’t add entity_id in template. This is example of template sensor:
Potrzebujesz miernika dodatkowo zaraz za głównym licznikiem. Ja mam DTSU666-H bo taki jest podawany w katalogu. Podobno jest jakiś chiński zamiennik który również współpracuje z tym falownikiem (kiedyś widziałem na elektrodzie wpis o tym). Sam falownik żadnej firmy nie mam możliwości mierzenia energii przepływającej między domem a licznikiem, gdyż ta energia omija falownik. Jak się sprawuje instalacją? Mam do Jasła 60km prawie po sąsiedzku.
And I wanted to clarify one thing, because for some newbies (like me) it was not obvious.
There are four interfaces on Sun2000 when you have internet dongle plugged in (or just two without it):
built-in wifi access-point (internal) that exposes the data we need for HAss under the SSID SUN2000-HV… or when you use FusionSolar app when directly connected to wifi of Sun2000.
built-in serial interface you may use probably to get such info as well (the big plug below inverter).
dongle-ethernet and dongle-wifi - AFAIK those two are just to connect to internet using existing network connection. No simple way to get data from it. It’s used by inverter to send data to fusion-solar cloud, or any other configured provider for service/maintenance/data statistics. You get data about your PV from that cloud when you use fusionSolar app outside your home-network wifi.
Easiest option is to connect to the first one: built-in wifi AP as a client (with RaspberryPi or router like Rafał did) and use it to connect to Huawei Sun2000 device (usually its on IP: 192.168.8.1/24).
There is also another option - to grab those data from FusionSolar cloud using Kiosk option mentioned above. It has some drawbacks (like you expose your data a bit more while enabling Kiosk mode, you rely on internet connection and third party cloud services). For this option to work, you need to use web POST method to get data instead of modbus TCP (with resource: https://eu5.fusionsolar.huawei.com/kiosk/getRealTimeKpi) - See Frans’ post above for details.
Hope this is putting all methods in one post for clarification.
You will need to have a power meter installed if you want to know the net power delivered to the grid (production of the inverter - consumption of your house). If you only want the power generated by the inverter, that’s the state value of the sensor.
The second one is easier to set up and looks better integrated but you database will get ~3x as big (if you’re using the current default of 10 days) which might become an issue. If you want to look at longer trends, let’s say months or years then can only go with InfluxDB or Prometheus.
I hope HA will move one day to Prometheus so that long term data and graphs can be first class citizens in Home Assistant.
Right now this is not possible with the huawei-solar package. I didn’t implement writing values because I did not need it and because it seemed safer to (start with) read-only. You could use the modbus switch, if you’re not afraid of messing things up.
Did you also have had the problem that you can’t connect your inverter in Python? I’m having a SUN2000-6KTL-MO but it’s giving me this ‘false’ reaction. Even why I try to scan on open ports on my invert, it giving null open ports.
>>> import pymodbus
>>> import time
>>> from pymodbus.client.sync import ModbusTcpClient
>>> client = ModbusTcpClient('192.168.2.14', '502')
>>> client.connect()
False