@trevee Remember to use a new templates format when creating those sensors, the one I posted was in the old format, just convert those to the new format.
I think we should update the sensors to new templates
My HA server is quite far from the inverter (25m). After I read details of the integration, Iâm curious that can it use ESP32 with RS-485 module (using MODBUS component of ESPHome) instead of using RS-485 to USB and using long wire to HA server or not?
if that is possible, that will be the cheapest and most reliable method.
You can certainly create a ModbusRTU to ModbusTCP bridge with an ESP32+RS485 module. However, ESPHome does not support such a thing. My 2 minutes of Googling showed the following interesting option: https://github.com/zivillian/esp32-modbus-gateway .
If you still need to buy the hardware, I would suggest an M5Stack ATOM RS485, which I already have lying around myself. It packages an ESP8266 + RS485-to-tll module together in a nice package.
Everything I say here is untested, so try at your own risk
Anyone facing this error in HA logs
Logger: homeassistant.components.sensor.recorder
Source: components/sensor/recorder.py:396
Integration: Sensor (documentation, issues)
First occurred: 10:30:10 PM (2 occurrences)
Last logged: 10:30:10 PM
sensor.grid_reactive_power has unit var which is unsupported for device_class power
sensor.grid_reactive_power_2 has unit kVarh which is unsupported for device_class energy
Hi guyz, new here at Huawei 2000L, please can somebody point me to right direction?
Using githubs custom component from https://github.com/Emilv2/huawei_solar
And i am confused as what to put where at energy tab.
This is my screenshots and with cloud graphs also.
Hi. I have a solar inverter huawey without âdongle wifiâ(i use directly wifi interface of inverter to connect it into my router).
My inverter provider updated my inverter firmware from V200R001C00SPC109 to SPC123⊠but with version firmware tcp modbus port doesnât work⊠My provider inverter havenât a backup of SPC109 firmware and from huawey I canât download scp109(it is removed).
What is the last firmware version that support tcp modbus port by wifi without dongle???
Somebody can send me the zip package of that firmware??
Hi, I quote last reply and I would ask to be sure:
If I have SD Dongle as well and upgrade inverter to latest firmware (App propose to install SPC141, currently I have SPC135) the 502 (or 6607) will still be open? With SPC135 it is but I saw some discordant messages in the post and I want to be sure that my integration will not be disconnected if I upgrade
THANKS !!
Did you change the setting using the installer account for modbus?
Thank you very much for a reply, but itâs giving me errors, will try with different settingsâŠor report to github
Logger: homeassistant.config_entries
Source: custom_components/huawei_solar/number.py:33
Integration: Huawei Solar
First occurred: 8:02:35 PM (1 occurrences)
Last logged: 8:02:35 PM
Error setting up entry SUN2000-10KTL-M1SUN2000-12 for number
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 313, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/usr/src/homeassistant/homeassistant/components/number/__init__.py", line 81, in async_setup_entry
return await component.async_setup_entry(entry)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 147, in async_setup_entry
platform = await async_prepare_setup_platform(
File "/usr/src/homeassistant/homeassistant/setup.py", line 309, in async_prepare_setup_platform
platform = integration.get_platform(domain)
File "/usr/src/homeassistant/homeassistant/loader.py", line 530, in get_platform
cache[full_name] = self._import_platform(platform_name)
File "/usr/src/homeassistant/homeassistant/loader.py", line 535, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/config/custom_components/huawei_solar/number.py", line 33, in <module>
HuaweiSolarNumberEntityDescription(
TypeError: __init__() got an unexpected keyword argument 'native_min_value'
Unable to prepare setup for platform huawei_solar.sensor: Platform not found (cannot import name 'POWER_VOLT_AMPERE_REACTIVE' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)).
Thank you very much, now no error, waiting for few hours to feed the data Connection is active
I had old HAOS, updatedâŠ
Hopefully, it is working fine now.
I have updated the instructions according to the new features introduced by wlcrs
Summary
So to summarize, I did this. Note Huawei inverter is on another subnet that is 192.168.200.0.
- Flash Openwrt on the router
- Setup your router as a dumb AP. [OpenWrt Wiki] Wireless Access Point / Dumb Access Point
- Connect it to your ISP router via ethernet. This will change the IP to something in the routerâs subnet range. e.g if your ISPâs router Ip is 192.168.1.1 then your OpenWrtâs router IP will be 192.168.1.24 (anything in between 192.168.1.2 to 192.168.1.100)
- Connect to your Huwaei Sun2000 inverterâs wifi as a client via 2.4Ghz radio.
-
Network â Wireless
-
click scan
-
connect to SUN2000-HVxxxxxxxx
-
Use password âChangemeâ
-
Wireless security WPA2-PSK
Check the connection between OpenWrt and router by ping 192.168.200.1 (in most cases but in some cases it will be 192.168.199.1) -
Network â Diagnostics
Step 2
This step is unique for each user, depending on your ISP modem/ router.
Set up a static route in ISP router/modem/
e.g
On F@st 5366
- Open 192.168.1.1 (again depending on your Isp router Ip address)
- follow these instructions to open the static route page. Route - SAGEMCOM Swan F5366s User Manual [Page 19] | ManualsLib
- enter the following setting
- IP address 192.168.200.0 (in your case 192.168.199.0)
- Gateway IP address 192.168.1.2 (whatever your OpenWRT router Ip address is)
- Interface IP_BR_LAN (in my case it was br0)
- Subnet mask 255.255.255.0 (if there is a field for subnet mask)
- Save and reboot both your ISP modem/router and OpenWrt router.
This will complete step 2.
Step 3
- Download and install the latest Winscp from WinSCP:: Official Site:: Download
- Run WinScp
- select Scp as protocol.
- login with your OpenWrtâs ssh credentials e.g
- accept the terms etc etc
- You will be presented with these windows with OpenWRT folders.double click on three dots icons
you will be presented with
- Navigate to the first file by double-clicking etc and then config. Here you will find all the three files ânetworkâ âwirelessâ and âfirewallâ
- double click on the ânetworkâ and copy-paste the following code at the end of the files. remember to set defaultroute '0" as mentioned in the GitHub wiki.
config interface 'wlan'
option proto 'dhcp'
option defaultroute '0'
7. repeat the process with âwirelessâ files by adding the following code to the end of the wireless file. changing according to your inverterâs APâs Name and BSSID
config wifi-iface 'wifinet0'
option key 'Changeme'
option ssid 'SUN2000-HV0123456789'
option device 'radio0'
option mode 'sta'
option bssid '94:25:33:12:34:56'
option encryption 'psk2'
option network 'wlan'
- Add the following code to the âfirewallâ file.
config zone
option input 'ACCEPT'
option name 'sun'
option output 'ACCEPT'
option forward 'ACCEPT'
option masq '1'
option network 'wlan'
config forwarding
option dest 'sun'
option src 'lan'
config forwarding
option dest 'lan'
option src 'sun'
- save everything and restart your OpenWrt router.
Step 4
Firewall rules for the port forwarding
- Network â Firewall â Port forwarding
- Setup first rules as follows
- Name: Preroute
- Protocol: TCP
- Source zone: Lan
- External port: 6607
- Destination zone : sun(wlan)
-
Internal IP: Select from dropdown: 192.168.200.1
-
Uncheck NAT loopback from advanced setting tab
-
Add second rule as following
- Name : Post route
- Protocol TCP
- Outbound zone Sun(wlan)
- Destination address select from dropdown 192.168.200.1
- Destination port: 6607
- Action: SNAT (there is some debate on this issue but you can use this)
- Rewrite IP address: select from dropdown 192.168.200.2 (OpenWrt router IP in Huwai inverter subnet)
Step five
- Verify connectivity, Before continuing with the setup of the integration, you should test whether you can ping the inverter on
192.168.200.1
. You can use one of the SSH/Terminal add-ons of HA, or use a terminal in the VSCode add-on. - successful connection will look like this
Install Wlcrs integration.
- Connect Home Assistant to the WiFi Access Point of your Huawei inverter.
- Install this integration with HACS, or copy the contents of this repository into the
custom_components/huawei_solar
directory - Restart HA
- Start the configuration flow:
- Or: Go to
Configuration
âIntegrations
and click the+ Add Integration
. SelectHuawei Solar
from the list
-
Choose whether you want to connect via serial or network connection. In this case we will choose
network
-
Enter the IP address of your inverter (192.168.200.1). The slave id is typically 0. You should only check the
Advanced: elevate permissions
checkbox if you intend to dynamically change your battery settings.
-
When using the
elevate permissions
feature, you might be asked to enter the credentials to theinstaller
account in the next step. These are the credentials used to connect to the inverter in the âDevice Commissioningâ section of the FusionSolar App. The default password is 00000aâŠ
Hi! I have an apexcharts-card where I have the produced electricity, sold electricity and total produced electricity from my solar panels. Now i need sensor.grid_import_solar_daily_energy + sensor.daily_yield - sensor.grid_export_solar_daily_energy = To get the total consumption in the house - the exported electricity. So total i need 4 slices of the pie chart
Here is the card i use:
type: custom:apexcharts-card
chart_type: pie
header:
show: true
show_states: true
colorize_states: true
title: SÄld, Köpt & Producerad El
apex_config:
chart:
height: 300px
legend:
show: true
dataLabels:
enabled: true
formatter: |
EVAL:function(value) {
return value.toFixed(0) + â%â;
}
series:
- entity: sensor.grid_export_solar_daily_energy
name: SĂ„ld El
color: green
float_precision: 2 - entity: sensor.grid_import_solar_daily_energy
name: Köpt El
color: red
float_precision: 2 - entity: sensor.daily_yield
name: Totalt Producerad El
color: magenta
float_precision: 2 - entity: HERE?
name: Consumption
color: magenta
float_precision: 2
Can somebody explain how can i make actual data, not comulative daily in Home Assistant.
I have this in energy:
But i want this for example in lovelace dash shows actual usage etcâŠ:
I think i managed to create state actual usage
solar_spotreba_vypocet_sit_aktualni:
value_template: >
{% set temp = (states('sensor.power_meter_phase_c_active_power') | float + states('sensor.power_meter_phase_a_active_power') | float + states('sensor.power_meter_phase_b_active_power') | float) | multiply(0.001) | round(3) %}
{% if temp %}
{{ temp }}
{% else %}
{{ 0 }}
{% endif %}
unit_of_measurement: 'kW'
solar_vyroba_aktualni:
value_template: >
{% set temp = states('sensor.inverter_active_power') | float | multiply(0.001) | round(3) %}
{% if temp %}
{{ temp }}
{% else %}
{{ 0 }}
{% endif %}
unit_of_measurement: 'kW'
solar_spotreba_ze_site_aktualni:
value_template: >
{% set temp = (states('sensor.power_meter_phase_c_active_power') | float + states('sensor.power_meter_phase_a_active_power') | float + states('sensor.power_meter_phase_b_active_power') | float) | multiply(0.001) | round(3) %}
{% if temp < 0.000 %}
{{ temp | abs }}
{% else %}
{{ 0 }}
{% endif %}
unit_of_measurement: 'kW'
solar_dodej_do_site_aktualni:
value_template: >
{% set temp = (states('sensor.power_meter_phase_c_active_power') | float + states('sensor.power_meter_phase_a_active_power') | float + states('sensor.power_meter_phase_b_active_power') | float) | multiply(0.001) | round(3) %}
{% if temp > 0.000 %}
{{ temp | abs }}
{% else %}
{{ 0 }}
{% endif %}
unit_of_measurement: 'kW'
solar_dum_spotreba_aktualni:
value_template: >
{% set temp = (states('sensor.solar_vyroba_aktualni') | float | round (3) + states('sensor.solar_spotreba_ze_site_aktualni') | float | round (3) - states('sensor.solar_dodej_do_site_aktualni') | float | round (3)) %}
{% if temp %}
{{ temp }}
{% else %}
{{ 0 }}
{% endif %}
unit_of_measurement: 'kW'
Will see if it work when sun is down :-E
any of you use off-grid mode inverter integration?
when the system enters off grid mode without the grid operatorâs power grid, power supply is supplied by battery via the backup line of the Backup Box-B0. in this condition the integration does not work and shows âconfig entry âSUN2000-6KTL-L1â for huawei_solar integration not ready yet: Could not update (serial number my inverter ) valuesâ.
when the grid voltage is switched on again by the operator., the inverter re-assign on grid mode and integration work perfect.
be possible to make integration work with inveter off grid status (island mode)
Idea to extend the battery live:
I would like to know your opinion about the possibility to implement following idea in home assistant to extend the battery live (in my case could be a 20-30% more live). It applies only for the case your system injects the rest of electricity, not used in your home, in the grid and you revive compensation for it. The idea is, when there is no solar production, to prioritize the consumption of the compensation instead to use the battery, it means to prioritize the consumption from the grid during a time instead the battery. To track the compensation in Home Assistant should not be complicate (you know the grid consumption and probably the sale price, in may case it is easy).And It is possible to create a template sensor to track the grid consumption in front of the compensated buffered amount. The key is to know if it would be possible to modify dynamically the operation mode of the battery through the integration (in my case a Luna2000 battery), or if it is possible to shutdown and star-up the battery with the integration. Other possibility maybe is to connect a smart switch to the battery and control it out of the Huawei integration, but in this case I donât know if this way to proceed could damage the batteries or system. Summarize the idea is to prioritize the use of the grid compensation instead the battery, so we can reduce the amount of cycles of our batteries and extend their lives. For example during the sommer my system injects monthly too much energy into the grid more than required to compensate the grid consupmtion monthly invoice.
@wlcrs : I appreciate specially your opinion about it if you see possible to proceed in some way with the integration. Thanks.