Thanks, I Will check. Finally I made te modbus tcp work with wifi USB adapter. I Connect the wifi to inverter AP and I can conect to inverter at 192.168.200.1
Tomorrow I Will compare this two solutions
Yes I checked the phone to be sure it wasn’t connected to the ssid.
I’ve had a look at dmesg but nothing really useful.
You can see the repeated connections happening, but no mention of the disconnects.
<6>[ 519.020000] wlan0: associate with c0:ff:a8:25:xx:xx (try 1/3)
<6>[ 519.020000] wlan0: RX AssocResp from c0:ff:a8:25:xx:xx(capab=0x631 status=0 aid=3)
<6>[ 519.030000] wlan0: associated
<6>[ 525.780000] wlan0: authenticate with c0:ff:a8:25:xx:xx
<6>[ 525.800000] wlan0: send auth to c0:ff:a8:25:xx:xx (try 1/3)
<6>[ 526.240000] wlan0: authenticated
<6>[ 526.270000] wlan0: associate with c0:ff:a8:25:xx:xx (try 1/3)
<6>[ 526.270000] wlan0: RX AssocResp from c0:ff:a8:25:xx:xx (capab=0x631 status=0 aid=3)
<6>[ 526.280000] wlan0: associated
<6>[ 536.740000] wlan0: authenticate with c0:ff:a8:25:xx:xx
<6>[ 536.760000] wlan0: send auth to c0:ff:a8:25:xx:xx (try 1/3)
<6>[ 537.200000] wlan0: authenticated
<6>[ 537.230000] wlan0: associate with c0:ff:a8:25:xx:xx (try 1/3)
<6>[ 537.230000] wlan0: RX AssocResp from c0:ff:a8:25:xx:xx (capab=0x631 status=0 aid=3)
<6>[ 537.240000] wlan0: associated
I’m going to give another old router a go.
Hi Rafal, how do you get this card? I only get 7 sensors.
I need more data from inverter. For example instant grid exported and instant grid acumulated in watt.
You can use https://github.com/wlcrs/huawei_solar to have more sensors or use template sensor to create entity from SUN2000-3KTL attributes (i think it is Emilv2 integration you are using now). There is no sensor for instant grid exported and instant grid acumulated in watt, but you can read value of power_meter_active_power from smart meter, if it’s negative then you are importing energy if it’s positive then you are exporting energy.
I will try to do a template with this attribute:
I’ve seen today the wlcrs integration in HACS. What is better to use?
Should I change to this integration?
And how do you do this card whith all this icons and lines? could you share?
Thanks Rafal
It was already posted in this topic, but It had been 1,5 year ago so I post it again.
elements:
- entity: sensor.power_meter_active_power
style:
left: 27%
top: 7%
type: state-label
- entity: sensor.active_grid_a_power
style:
left: 52%
top: 16%
type: state-label
- entity: sensor.active_grid_b_power
style:
left: 52%
top: 19%
type: state-label
- entity: sensor.active_grid_c_power
style:
left: 52%
top: 22%
type: state-label
- entity: sensor.m_grid_a_voltage
style:
left: 38%
top: 16%
type: state-label
- entity: sensor.m_grid_b_voltage
style:
left: 38%
top: 19%
type: state-label
- entity: sensor.m_grid_c_voltage
style:
left: 38%
top: 22%
type: state-label
- entity: sensor.m_grid_exporterd_energy
style:
left: 68%
top: 7%
suffix: ' >>> '
type: state-label
- entity: sensor.m_grid_accumulated_energy
prefix: ' <<< '
style:
left: 68%
top: 13%
type: state-label
- entity: sensor.energy_used
style:
left: 68%
top: 31%
suffix: ' >>> '
type: state-label
- entity: sensor.daily_yield
prefix: 'Dzisiaj '
style:
left: 40%
top: 37%
type: state-label
- entity: sensor.total_yield
prefix: 'Total '
style:
left: 68%
top: 37%
type: state-label
- entity: sensor.sun2000_8ktl_m0
style:
left: 20%
top: 37%
type: state-label
- entity: sensor.phase_a_current
style:
left: 40%
top: 46%
type: state-label
- entity: sensor.phase_a_voltage
style:
left: 26%
top: 46%
type: state-label
- entity: sensor.phase_b_current
style:
left: 40%
top: 49%
type: state-label
- entity: sensor.phase_b_voltage
style:
left: 26%
top: 49%
type: state-label
- entity: sensor.phase_c_current
style:
left: 40%
top: 52%
type: state-label
- entity: sensor.phase_c_voltage
style:
left: 26%
top: 52%
type: state-label
- entity: sensor.device_status
style:
left: 60%
top: 62%
type: state-label
- entity: sensor.pv_input_power
style:
left: 20%
top: 62%
type: state-label
- entity: sensor.pv_01_voltage
style:
left: 40%
top: 70%
type: state-label
- entity: sensor.pv_01_current
style:
left: 60%
top: 70%
type: state-label
- entity: sensor.pv_02_voltage
style:
left: 40%
top: 88%
type: state-label
- entity: sensor.pv_02_current
style:
left: 60%
top: 88%
type: state-label
image: /local/sun2000e.png
title: Sun2000-8KTL-M0
type: picture-elements
it is only this card:
I think wlcrs is better.
Sorted now. I moved away from the router approach.
I had a raspberry pi running Octopi near a network switch so I changed it to connect to lan via ethernet and inverter network on it’s wifi. Then setup the NAT on it which is working fine. Well it did once I remembered to enable nat in the kernel config.
So working fine with raspberry pi doing NAT to inverter ssid and latest firmware on the inverter.
Hello all, how do you upgrade the dongle? I always have an error
I used the “sun2000” app on Android from Huawei market place
I think I used this guide:
In the above guide is also an email address to Huawei support where you can request firmware if you don’t have it, it only took a couple of hours before they sent it to me.
Yes of course, sorry for the delay with my answer.
Configuration of openwrt to act as bridge connecting to the inverter AP:
1 - Connect to the inverter as client. Here the configuration wireless connections, you must access with “Mode Client” to the inverter AP network:
2- Config the Bridge device, WLAN and Ethernet and interfaces as follow:
Bridge ports: eth0 (your ethernet interface)
The interfaces:
3- Firewall configuration and the most important “Port Forwarding”:
Here I show two rules, with the modbus port 502 for the case old inverter firmware and other rule with the new modbus port 6607, depend on which version you have.
Example how to config the Forward Port rule:
To connect the HA integration to the SUN2000L inverter to set as “host” the LAN IP of the openwrt router and the correct port depend on the version of the inverter firmware ( port 502 or 6607)
That’s all…
Thought I check back and post progress.
I have set up a dashboard with metrics I find interesting to track on a daily basis.
I have also set up 6 automations that controls the battery usage based on forecast and electric prices.
I am using TOU and have set a schedule that allows charge during the night and discharge during the entire day (excess PV output gos to the battery). I will check back with the results of this behaviour.
I have struggled to be able to make it 100% dynamic based on the automations…
- UPDATE - It seems to work fine, as long as you are fine with limiting yourself to charge-from-grid only at nighttime and hence not discharge the battery at night
I have two questions:
- What Operating mode are you using on the Luna in order to fully automate the discharge/charge based on energy prices?
- Has anyone set up a card like https://github.com/reptilex/tesla-style-solar-power-card that shows the current energy flows similar to what is shown in the fusionSolar App? I would particularly be interested in a blueprint of Template sensors that can support the different entities in the card, such as generation_to_grid_entity.
That’s a very nice looking dashboard! Congrats!
As to your first question: it’s very dependent on the country/location where you live which Operating mode makes most sense. Many of us are still experimenting with what mode makes most (economical) sense
@wlcrs I’m having some issues with the latest beta release (1.0.0a3).
2022-03-02 10:05:22 INFO (MainThread) [pymodbus.client.asynchronous.async_io] Connected to 192.168.8.1:502.
2022-03-02 10:05:23 INFO (MainThread) [custom_components.huawei_solar.config_flow] Successfully connected to inverter SUN2000-6KTL-M0 with SN HV1970006XXX
2022-03-02 10:05:23 INFO (MainThread) [pymodbus.client.asynchronous.async_io] Protocol lost connection.
2022-03-02 10:05:23 INFO (MainThread) [pymodbus.client.asynchronous.async_io] Protocol made connection.
2022-03-02 10:05:23 INFO (MainThread) [pymodbus.client.asynchronous.async_io] Connected to 192.168.8.1:502.
2022-03-02 10:05:25 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SUN2000-6KTL-M0' for huawei_solar integration not ready yet: Could not update HV1970006XXX v
alues: Got error while reading from register 37760 with length 28: Exception Response(131, 3, IllegalAddress); Retrying in background
2022-03-02 10:05:25 INFO (MainThread) [pymodbus.client.asynchronous.async_io] Protocol lost connection.
It looks like it tries to read the register for the battery soc, but I don’t have a battery.
I’ve created a GitHub issue as well.
Thanks,
eicosan
I live in sweden and I am paying the hourly rate that is VERY volatile.
I have found out the following:
- Set the TOU to charge 00:00-23:59
In HASS create an automation that based on electric price sets
- the working mode to TOU
- Allow grid charge swith to true
- Grid charge power to an appropriate value
And then create another HASS automation that based on electric price sets
- The working mode to MaximiseSelfConsumption
- The Allow discharge power to an appropriate value
This allows for full control and full automation.
Has anyone a good example of a template sensor that calculates the Daily Solar Yield?
I think I also need some instructions on how to use the sensor (I am completely new to HASS).
- What to put in which .yaml? (To create the sensor)
- How to reference it from an entity card?
I have tried adding some sensors to configuration,yaml (and the config is valid) but I cannot find the sensor in a lovelace entity card e.g.
wlcrs integration has an sensor for daily solar yield out of the box.
It can be used in the energy panel straight away.
Not if you have a battery. But there are posts above which suggest how the yield can be calculated in this case.
I am confused right now if I can use integration from WLCRS to connect with my inverter.
I’ve connected to SUN2000 AP and change Modbus settings
Here is my devices firmware:
Inverter: V100R001C00SPC140
Dongle: V100R001C00SPC124
I try to ping dongle which is in my network and its possible also a port 502.
When I put this IP into config I have “Connection Error”
I am using only HA Core because of using Docker version of HA.
I think you must be connected directly to invertor via wifi:
you must ping in 192.168.200.1
Quick update on the calculation of the daily PV yield based on the numbers which can be retrieved from the integration/Modbus TCP:
I have been in contact with Huawei support on how to calculate the PV yield to match the numbers in Fusionsolar. They have confirmed that the formula
PV yield = daily yield from inverter + battery day charge – battery day discharge
is correct to calculate the PV yield as a raw figure. However, the calculation of the PV yield in Fusionsolar is slightly different, because they also include the energy consumed by the inverter. So the Fusionsolar formula is:
PV yield = daily yield from inverter + battery day charge – battery day discharge – energy absorbed by inverter
Based on this I tried to reverse engineer the Fusionsolar numbers and found the following: The closest I get to the Fusionsolar numbers is by using the formula and when the PV is producing energy (and only then!) subtracting approx. 0.11 kWh per hour for the energy consumption of the inverter. The energy consumption of the system when the PV is not producing, is already covered by the fact that the battery discharge number is typically higher than the increase of the daily yield from the inverter, resulting in a negative PV yield number. So those negative PV yield numbers are correct from a total energy produced/consumed point of view. Of course, if you don’t like to see the negative values then just set the result to 0 whenever the calculation leads to a negative number. This is also how it’s done in Fusionsolar.
If replicating the Fusionsolar numbers is not that important, then just use the first formula to get the raw numbers and then the inverter consumption (during the times when the PV is producing energy) will be included in your total energy consumption.