Git Product home page Git Product logo

huawei_solar's People

Contributors

alexdelli avatar andurilll avatar borty97 avatar bstenborg avatar herostrat avatar inigoml avatar johnmclear avatar leandroissa avatar malteger avatar misiu avatar mkornat avatar nurzen avatar robbo600 avatar roving-ronin avatar vpont avatar wlcrs avatar wrt54g avatar xtala avatar yousaf465 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

huawei_solar's Issues

Add battery "Maximum Discharging Power" as a configurable NumberEntity

I’ve been working on exposing some parameters as configurable entities in Home Assistant. My primary use case would be to make it possible to set the “Maximum Discharge Power” for my LUNA2000 battery from Home Assistant. This would allow me to adjust the power output of the battery dynamically based on other inputs.

Example use case: in Belgium, you are taxed on peak usage, starting when you draw more than 2.5kW from the grid for a certain time. I would like to create an automation that sets the “Maximum Discharging Power” for my battery to “Current Grid Power Usage (in W) - 2500W”.

However, while the register is mentioned as being read/writeable in the Modbus Interface Definitions document, I’m receiving a “Permission denied” error (0x80) when trying to write to it.

image

Support is letting me know that the function is not available at the moment 😦 :

image

For everyone who would also be interested in using this function: Please send a mail to Huawei support to ask for this functionality! The more requests are made, the more hope that the function will ever be enabled.

An example mail:

Dear,

I want to use the Modbus-interface on my inverter to dynamically set the maximum discharging power of my LUNA2000 battery.
The Modbus Interface Definitions state that register 47077 is RW. However, when I try to write a value to this register, I get the error code 0x80, which means “No permission”?

My inverter SN: HVxxx>
Battery SN: BTyyy

[Feature Request]: Add Grid Power Maximum injection

Describe your feature request

Writing in the right Modbus Adress, to control the maximum power injected by the inverter in the Grid network.

It will be useful to limit the yield when the energy production is more than the needs.

For those who not sell the energy... And don't have batteries... This will increase the system longevity.

Thanks for this Great HA integration

[Bug]: Connection drops

System Health details

System Health

version core-2022.3.2
installation_type Home Assistant Supervised
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.9
os_name Linux
os_version 5.10.0-11-amd64
arch x86_64
timezone Europe/Berlin
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 4968
Installed Version 1.23.0
Stage running
Available Repositories 1079
Downloaded Repositories 5
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Debian GNU/Linux 11 (bullseye)
update_channel stable
supervisor_version supervisor-2022.01.1
docker_version 20.10.12
disk_total 32.7 GB
disk_used 10.6 GB
healthy true
supported true
supervisor_api ok
version_api ok
installed_addons File editor (5.3.3), Node-RED (11.0.4), Mosquitto broker (6.0.1), Ring-MQTT with Video Streaming (4.9.1), Duck DNS (1.14.0), Studio Code Server (4.1.0), ESPHome (2022.2.6)
Lovelace
dashboards 3
resources 1
views 9
mode storage
Spotify
api_endpoint_reachable ok

Huawei Solar Setup

Model
SUN2000-6KTL-M0
Software version
V100R001C00SPC133

Model
SDongleA-01
Software version
V100R001C00SPC122

Power Meter - 3 phase

no battery

Raspberry Pi is configured to be a network bridge between inverters AP (wlan0 192.168.8.0/24) and local home network (eth0 192.168.2.0/24). On Home assistant server the route is configured.

Describe the issue

The integration has connection drops every 130-132 minutes for 15-17 minutes.

Reproduction steps

  1. install integration v 1.0.0a4 via HACS2.
  2. configure IP and port
  3. add automation to run update interval every 10 seconds
  4. let the integration running see connection drops roughly every 2 h 10 mins for 15 mins5.

Bildschirmfoto 2022-03-07 um 19 35 40

Relevant debug logs

2022-03-07 19:29:24 ERROR (MainThread) [custom_components.huawei_solar] Timeout fetching HV1970006XXX_data_update_coordinator data
2022-03-07 19:29:30 INFO (MainThread) [homeassistant.components.automation.huawei_solar_inverter_data_polling] Huawei Solar inverter data polling: Running automation actions
2022-03-07 19:29:30 INFO (MainThread) [homeassistant.components.automation.huawei_solar_inverter_data_polling] Huawei Solar inverter data polling: Executing step call service
2022-03-07 19:29:37 INFO (MainThread) [backoff] Backing off _do_read(...) for 2.0s (asyncio.exceptions.TimeoutError)
2022-03-07 19:29:40 INFO (MainThread) [homeassistant.components.automation.huawei_solar_inverter_data_polling] Huawei Solar inverter data polling: Running automation actions
2022-03-07 19:29:40 INFO (MainThread) [homeassistant.components.automation.huawei_solar_inverter_data_polling] Huawei Solar inverter data polling: Executing step call service
2022-03-07 19:29:41 ERROR (SyncWorker_9) [spotipy.client] Max Retries reached
2022-03-07 19:29:42 INFO (MainThread) [backoff] Backing off _do_read(...) for 2.0s (asyncio.exceptions.TimeoutError)
2022-03-07 19:29:47 INFO (MainThread) [backoff] Backing off _do_read(...) for 2.0s (asyncio.exceptions.TimeoutError)
2022-03-07 19:29:50 INFO (MainThread) [homeassistant.components.automation.huawei_solar_inverter_data_polling] Huawei Solar inverter data polling: Running automation actions
2022-03-07 19:29:50 INFO (MainThread) [homeassistant.components.automation.huawei_solar_inverter_data_polling] Huawei Solar inverter data polling: Executing step call service
2022-03-07 19:29:52 INFO (MainThread) [backoff] Backing off _do_read(...) for 2.0s (asyncio.exceptions.TimeoutError)
2022-03-07 19:30:00 INFO (MainThread) [homeassistant.components.automation.huawei_solar_inverter_data_polling] Huawei Solar inverter data polling: Running automation actions
2022-03-07 19:30:00 INFO (MainThread) [homeassistant.components.automation.huawei_solar_inverter_data_polling] Huawei Solar inverter data polling: Executing step call service
2022-03-07 19:30:07 INFO (MainThread) [homeassistant.components.websocket_api.http.connection] [139667933821728] Initialized trigger
2022-03-07 19:30:07 INFO (MainThread) [backoff] Backing off _do_read(...) for 2.0s (asyncio.exceptions.TimeoutError)
2022-03-07 19:30:10 INFO (MainThread) [homeassistant.components.automation.huawei_solar_inverter_data_polling] Huawei Solar inverter data polling: Running automation actions
2022-03-07 19:30:10 INFO (MainThread) [homeassistant.components.automation.huawei_solar_inverter_data_polling] Huawei Solar inverter data polling: Executing step call service
2022-03-07 19:30:11 ERROR (SyncWorker_7) [spotipy.client] Max Retries reached
2022-03-07 19:30:12 INFO (MainThread) [backoff] Backing off _do_read(...) for 2.0s (asyncio.exceptions.TimeoutError)
2022-03-07 19:30:17 INFO (MainThread) [backoff] Backing off _do_read(...) for 2.0s (asyncio.exceptions.TimeoutError)
2022-03-07 19:30:20 INFO (MainThread) [homeassistant.components.automation.huawei_solar_inverter_data_polling] Huawei Solar inverter data polling: Running automation actions
2022-03-07 19:30:20 INFO (MainThread) [homeassistant.components.automation.huawei_solar_inverter_data_polling] Huawei Solar inverter data polling: Executing step call service
2022-03-07 19:30:22 INFO (MainThread) [homeassistant.components.websocket_api.http.connection] [139667933821728] Initialized trigger
2022-03-07 19:30:22 INFO (MainThread) [backoff] Backing off _do_read(...) for 2.0s (asyncio.exceptions.TimeoutError)
2022-03-07 19:30:30 INFO (MainThread) [homeassistant.components.automation.huawei_solar_inverter_data_polling] Huawei Solar inverter data polling: Running automation actions
2022-03-07 19:30:30 INFO (MainThread) [homeassistant.components.automation.huawei_solar_inverter_data_polling] Huawei Solar inverter data polling: Executing step call service
...
...
2022-03-07 19:45:37 INFO (MainThread) [backoff] Backing off _do_read(...) for 2.0s (asyncio.exceptions.TimeoutError)
2022-03-07 19:45:42 INFO (MainThread) [backoff] Backing off _do_read(...) for 2.0s (asyncio.exceptions.TimeoutError)
2022-03-07 19:45:45 INFO (MainThread) [homeassistant.components.automation.huawei_solar_inverter_data_polling] Huawei Solar inverter data polling: Running automation actions
2022-03-07 19:45:45 INFO (MainThread) [homeassistant.components.automation.huawei_solar_inverter_data_polling] Huawei Solar inverter data polling: Executing step call service
2022-03-07 19:45:47 INFO (MainThread) [backoff] Backing off _do_read(...) for 2.0s (asyncio.exceptions.TimeoutError)
2022-03-07 19:45:50 WARNING (MainThread) [homeassistant.helpers.entity] Update of media_player.spotify_johannes_richter is taking over 10 seconds
2022-03-07 19:45:52 INFO (MainThread) [backoff] Backing off _do_read(...) for 2.0s (asyncio.exceptions.TimeoutError)
2022-03-07 19:45:56 INFO (MainThread) [pymodbus.client.asynchronous.async_io] Protocol lost connection.
2022-03-07 19:45:58 INFO (MainThread) [pymodbus.client.asynchronous.async_io] Protocol made connection.
2022-03-07 19:45:58 INFO (MainThread) [pymodbus.client.asynchronous.async_io] Connected to 192.168.8.1:502.
2022-03-07 19:46:00 INFO (MainThread) [homeassistant.components.automation.huawei_solar_inverter_data_polling] Huawei Solar inverter data polling: Running automation actions
2022-03-07 19:46:00 INFO (MainThread) [homeassistant.components.automation.huawei_solar_inverter_data_polling] Huawei Solar inverter data polling: Executing step call service
2022-03-07 19:46:04 INFO (MainThread) [custom_components.huawei_solar] Fetching HV197000XXXX_data_update_coordinator data recovered
2022-03-07 19:46:11 ERROR (SyncWorker_10) [spotipy.client] Max Retries reached
2022-03-07 19:46:15 INFO (MainThread) [homeassistant.components.automation.huawei_solar_inverter_data_polling] Huawei Solar inverter data polling: Running automation actions
2022-03-07 19:46:15 INFO (MainThread) [homeassistant.components.automation.huawei_solar_inverter_data_polling] Huawei Solar inverter data polling: Executing step call service
2022-03-07 19:46:30 INFO (MainThread) [homeassistant.components.automation.huawei_solar_inverter_data_polling] Huawei Solar inverter data polling: Running automation actions
2022-03-07 19:46:30 INFO (MainThread) [homeassistant.components.automation.huawei_solar_inverter_data_polling] Huawei Solar inverter data polling: Executing step call service
2022-03-07 19:46:45 INFO (MainThread) [homeassistant.components.automation.huawei_solar_inverter_data_polling] Huawei Solar inverter data polling: Running automation actions
2022-03-07 19:46:45 INFO (MainThread) [homeassistant.components.automation.huawei_solar_inverter_data_polling] Huawei Solar inverter data polling: Executing step call service

[Bug]: Grid exported

System Health details

Huawei Solar Setup

SUN2000 6KTL, Dongle

Describe the issue

Can only see 25 entities and Grid exported is not one of them. What did i do wrong?

Reproduction steps

...

Relevant debug logs

-

[Bug]: Doesn't appear in the Add Integration list

System Health details

Home Assistant 2022.2.0

Describe the issue

i install the component with HACS, reboot HA but then it does not appear in the list of available integrations

Reproduction steps

1.Install this integration with HACS,
2.Restart HA
3.Go to Configuration -> Integrations and click the + Add Integration button
4.I cannot select Huawei Solar from the list, it does not appear

Relevant debug logs

2022-02-03 14:28:53 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-02-03 14:28:53 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration huawei_solar which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

[Feature Request]: add Time of use settings for battery charge/discharge

Describe your feature request

thanks for all your hard work on this integration, it’s brilliant!

I’m not sure if this is possible, but adding the settings for charge discharge of the battery based on time of use (available on the sun2000 app as installer only) would be really useful. If you are on an export tariff where export payments are different throughout the day, it would be great to change these settings quickly in homeassistant

example of how it looks in sun2000 app below

C62ABE01-0DC5-4BEB-8FD0-392F10DBECB2

[Bug]: Error occurred loading configuration flow for integration huawei_solar

System Health details

System Health

version core-2021.12.10
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.7
os_name Linux
os_version 5.10.88
arch x86_64
timezone Europe/Brussels
Home Assistant Community Store
GitHub API ok
Github API Calls Remaining 5000
Installed Version 1.19.3
Stage running
Available Repositories 1017
Downloaded Repositories 36
Home Assistant Supervisor
host_os Home Assistant OS 7.1
update_channel beta
supervisor_version supervisor-2021.12.2
docker_version 20.10.9
disk_total 457.7 GB
disk_used 113.9 GB
healthy true
supported true
board generic-x86-64
supervisor_api ok
version_api ok
installed_addons Samba share (9.5.1), AdGuard Home (4.4.2), AppDaemon 4 (0.8.1), Caddy (1.6), Check Home Assistant configuration (3.9.0), Duck DNS (1.14.0), ESPHome (2022.1.1), Mosquitto broker (6.0.1), Studio Code Server (4.1.0), WireGuard (0.6.0), MariaDB (2.4.0), Samba Backup (5.0.0), InfluxDB (4.3.0), Grafana (7.4.1), Frigate NVR (2.3), SSH & Web Terminal (10.0.2), Glances (0.14.1), phpMyAdmin (0.7.0), Mealie (0.5.4), Arpspoof (1.0.0), Guacamole (1.3.0), Caddy 2 (1.0.9), Firefly iii (5.6.10-7)
Lovelace
dashboards 3
resources 17
views 18
mode storage
Spotify
api_endpoint_reachable ok

Describe the issue

Error occurred loading configuration flow for integration huawei_solar

Reproduction steps

  1. Try to setup Huawei_solar

...

Relevant debug logs

Logger: homeassistant.config_entries
Source: config_entries.py:720
First occurred: 14:33:11 (1 occurrences)
Last logged: 14:33:11

Error occurred loading configuration flow for integration huawei_solar: cannot import name 'is_installed' from 'pymodbus.compat' (/usr/local/lib/python3.9/site-packages/pymodbus/compat.py)

[Feature Request]: Optimizer Feature Data

Describe your feature request

It would be very interesting to be able to create sensors for individual optimizers with info about Output Power, Total Yield and alarms, too
Optimizers
. According to Huawei solar Modbus Interface the register No. 59 (Optmizer Feature Data) should contain this data.

[Bug]: wrong TZ in startup and shutdown Time

System Health details

System Health

version core-2022.4.5
installation_type Home Assistant Container
dev false
hassio false
docker true
user root
virtualenv false
python_version 3.9.9
os_name Linux
os_version 5.4.72-microsoft-standard-WSL2
arch x86_64
timezone Europe/Stockholm
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 4333
Installed Version 1.24.5
Stage running
Available Repositories 1032
Downloaded Repositories 34
cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
lovelace
dashboards 3
resources 16
views 36
mode storage
spotify
api_endpoint_reachable ok

Huawei Solar Setup

Inverter: SUN2000-6KTL-M1 - V100R001C00SPC14
Sdongle: Yes-V100R001C00SPC126

Describe the issue

Startup time and shutdown time is displayed in wrong time zone.
From HA huawei_solar:
image
From Fusion Solar:
image

Modbus register 32091 & 32092:
25180 & 65336
-> 1650261818 Epoch seconds

-> Monday 18 April 2022 06:03:38 in readable format.

Reproduction steps

  1. Check statrtup time in HA vs fusion solar

...

Relevant debug logs

022-04-18 12:07:25 DEBUG (MainThread) [pymodbus.transaction] Adding transaction 75
2022-04-18 12:07:25 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] recv: 0x0 0x4b 0x0 0x0 0x0 0x6b 0x1 0x3 0x68 0x0 0x0 0x13 0x40 0xf 0xbb 0xf 0xb1 0xf 0xac 0x9 0x14 0x9 0x18 0x9 0x6 0x0 0x0 0x1a 0xdc 0x0 0x0 0x1b 0x1 0x0 0x0 0x1b 0x19 0x0 0x0 0x13 0x9a 0x0 0x0 0x12 0xc5 0xff 0xff 0xff 0xe7 0x3 0xe8 0x13 0x8a 0x26 0x17 0x1 0x8b 0xb 0xb8 0x2 0x0 0x0 0x0 0x62 0x5c 0xff 0x3a 0x62 0x5c 0x7a 0xa5 0x0 0x0 0x12 0xe7 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x2 0x13 0xb9 0x0 0x2 0x2b 0x0 0x62 0x5d 0x54 0x7a 0x0 0x0 0x0 0x34 0x0 0x0 0x5 0xaf
2022-04-18 12:07:25 DEBUG (MainThread) [pymodbus.framer.socket_framer] Processing: 0x0 0x4b 0x0 0x0 0x0 0x6b 0x1 0x3 0x68 0x0 0x0 0x13 0x40 0xf 0xbb 0xf 0xb1 0xf 0xac 0x9 0x14 0x9 0x18 0x9 0x6 0x0 0x0 0x1a 0xdc 0x0 0x0 0x1b 0x1 0x0 0x0 0x1b 0x19 0x0 0x0 0x13 0x9a 0x0 0x0 0x12 0xc5 0xff 0xff 0xff 0xe7 0x3 0xe8 0x13 0x8a 0x26 0x17 0x1 0x8b 0xb 0xb8 0x2 0x0 0x0 0x0 0x62 0x5c 0xff 0x3a 0x62 0x5c 0x7a 0xa5 0x0 0x0 0x12 0xe7 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x2 0x13 0xb9 0x0 0x2 0x2b 0x0 0x62 0x5d 0x54 0x7a 0x0 0x0 0x0 0x34 0x0 0x0 0x5 0xaf
2022-04-18 12:07:25 DEBUG (MainThread) [pymodbus.factory] Factory Response[ReadHoldingRegistersResponse: 3]
2022-04-18 12:07:25 DEBUG (MainThread) [pymodbus.transaction] Getting transaction 75
2022-04-18 12:07:25 DEBUG (MainThread) [pymodbus.payload] [0, 4928, 4027, 4017, 4012, 2324, 2328, 2310, 0, 6876, 0, 6913, 0, 6937, 0, 5018, 0, 4805, 65535, 65511, 1000, 5002, 9751, 395, 3000, 512, 0, 25180, 65338, 25180, 31397, 0, 4839, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5049, 2, 11008, 25181, 21626, 0, 52, 0, 1455]
2022-04-18 12:07:25 DEBUG (MainThread) [pymodbus.payload] [b'\x00\x00', b'\x13@']
2022-04-18 12:07:25 DEBUG (MainThread) [pymodbus.payload] [b'\x00\x00', b'\x1a\xdc']
2022-04-18 12:07:25 DEBUG (MainThread) [pymodbus.payload] [b'\x00\x00', b'\x1b\x01']
2022-04-18 12:07:25 DEBUG (MainThread) [pymodbus.payload] [b'\x00\x00', b'\x1b\x19']
2022-04-18 12:07:25 DEBUG (MainThread) [pymodbus.payload] [b'\x00\x00', b'\x13\x9a']
2022-04-18 12:07:25 DEBUG (MainThread) [pymodbus.payload] [b'\x00\x00', b'\x12\xc5']
2022-04-18 12:07:25 DEBUG (MainThread) [pymodbus.payload] [b'\xff\xff', b'\xff\xe7']
2022-04-18 12:07:25 DEBUG (MainThread) [pymodbus.payload] [b'b\\', b'\xff:']
2022-04-18 12:07:25 DEBUG (MainThread) [pymodbus.payload] [b'b\\', b'z\xa5']
2022-04-18 12:07:25 DEBUG (MainThread) [pymodbus.payload] [b'\x00\x02', b'\x13\xb9']
2022-04-18 12:07:25 DEBUG (MainThread) [pymodbus.payload] [b'\x00\x00', b'\x05\xaf']

[Bug]: Possible integration broken after upgrading to HA 2022.02

System Health details

System Health

version core-2022.2.2
installation_type Home Assistant Supervised
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.7
os_name Linux
os_version 4.19.0-10-amd64
arch x86_64
timezone Europe/Madrid
Home Assistant Community Store
GitHub API ok
Github API Calls Remaining 4813
Installed Version 1.22.0
Stage running
Available Repositories 980
Downloaded Repositories 5
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Debian GNU/Linux 11 (bullseye)
update_channel stable
supervisor_version supervisor-2022.01.1
docker_version 20.10.12
disk_total 105.4 GB
disk_used 36.9 GB
healthy true
supported true
supervisor_api ok
version_api ok
installed_addons Home Assistant Google Drive Backup (0.105.2), Studio Code Server (4.1.0), SQLite Web (3.2.1)
Lovelace
dashboards 1
resources 0
views 7
mode storage
Xiaomi Miot Auto
component_version 0.5.2
can_reach_server ok
can_reach_spec ok
logged_accounts 1
total_devices 57
Xiaomi MIoT
logged_in true
can_reach_micloud_server ok
accounts_count 1
account_devices_count 57
added_devices 7

Describe the issue

Integration does not start.

Reproduction steps

  1. Start Home Assistant (hassio_supervised docker edition)
  2. Integration does not start

Relevant debug logs

This error originated from a custom integration.

Logger: homeassistant.config_entries
Source: custom_components/huawei_solar/__init__.py:40
Integration: Huawei Solar
First occurred: 5:52:11 PM (1 occurrences)
Last logged: 5:52:11 PM

Error setting up entry SUN2000-4KTL-L1 for huawei_solar
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 327, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/huawei_solar/__init__.py", line 40, in async_setup_entry
    primary_bridge = await HuaweiSolarBridge.create(
TypeError: create() got an unexpected keyword argument 'username'

Daily yield discounts battery charge until it discharges

Describe your feature request

Hello,

Daily yield presents the energy that is produced and gets out of the inverter. If the energy is stored in the battery it would only count to the daily yield after the battery starts discharging.

This affects the energy dashboard and if the battery does not discharge completely until mid night it will mess up the next day numbers.

Can this be fixed? Could not be in the daily yield entity itself but other entity to not mess up the existing one?

Thank you.

[Feature Request]: Integration with OpenAPI

Describe your feature request

Hello,
Given the fact that not everyone can or wants to connect directly in ModBUS to the inverter, I was wondering why not integrate directly the part of OpenAPI that Huawei provides.
In my case, I am not the installer of the system nor do I want to be, but I do want to be able to read the data via API. All I had to do was ask Huawei for an OpenAPI account and I am in possession of all the data that can be obtained using ModBUS (I think so.. see https://trengo.s3.eu-central-1.amazonaws.com/media/2y5JxXaS8cGn6o06_smartpvms-v500r007c00-northbound-interface-reference.pdf) .
Unfortunately my knowledge on how to develop a home assistant component is very poor, but here on GitHub there is someone who is doing a similar work to yours starting from the API (https://github.com/jgriss/FusionSolarHA/).
It would be nice to collaborate and create a single component that can either connect directly via modbus or use the API.
I find that using the API is much less invasive (in the end you just have to ask for credentials and the installer has no problem), different is connecting directly to the inverter via modbus (maybe interrupting or getting in the way of the installer).
This is obviously just an idea/request.

Thanks in advance, great work !

[Feature Request]: Update interval from 1 to 60 seconds

Describe your feature request

The user can't set the update interval.
During integration installation the user take the possibility to define the time in seconds between inverter data request.

It will be perfect if the user can selected from 1 to 60 seconds

There are different hardware HA Servers, with very different capabilities and power.

Some of us want to have all sensors information... But other ones only want power yield, and grid power to generate quick information for automations.

If this possibility is possible, any one can adjust this integration for what they need...

Thanks for your EXCELLENT work...
Big help for all community

[Bug]: Huawei Solar does not load with HA 2022.3.5

System Health details

System Health

version core-2022.3.5
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.9
os_name Linux
os_version 5.10.92-v8
arch aarch64
timezone Europe/Madrid
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 4919
Installed Version 1.23.0
Stage running
Available Repositories 1081
Downloaded Repositories 6
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 7.5
update_channel stable
supervisor_version supervisor-2022.03.5
docker_version 20.10.9
disk_total 58.7 GB
disk_used 8.2 GB
healthy true
supported true
board rpi3-64
supervisor_api ok
version_api ok
installed_addons File editor (5.3.3), SSH & Web Terminal (10.1.0)
Lovelace
dashboards 2
resources 1
views 1
mode storage

Huawei Solar Setup

Huawei Solar Integration: v0.5.1
Host: 192.168.200.1
Port: 6607
Slave: 0
SUN2000-3KTL-L1. Firmware 117
Power sensor single phase
No dongle
No battery
Connected to 192.168

Describe the issue

After updating from 2022.03.1, the Huawei Solar Integration has stopped working.

image

Reproduction steps

  1. It was working perfectly for some weeks with Home Assistant 2022.3.1
  2. Update Home Assistant from 2022.3.1 to 2022.3.5
  3. It does not work at all. It appears as "not loaded"
    ...

Relevant debug logs

This is the error in the log:


This error originated from a custom integration.

Logger: aiohttp.server
Source: custom_components/huawei_solar/__init__.py:10
Integration: Huawei Solar
First occurred: 21:23:55 (3 occurrences)
Last logged: 21:25:43

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 79, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 219, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 137, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 72, in delete
    result = await hass.config_entries.async_remove(entry_id)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 858, in async_remove
    await entry.async_remove(self.hass)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 510, in async_remove
    component = integration.get_component()
  File "/usr/src/homeassistant/homeassistant/loader.py", line 553, in get_component
    cache[self.domain] = importlib.import_module(self.pkg_path)
  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/__init__.py", line 10, in <module>
    from huawei_solar import (
ModuleNotFoundError: No module named 'huawei_solar'

[Bug]: Permission to write configuration stops after a certain number of hours

System Health details

System Health

version core-2022.4.7
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.9
os_name Linux
os_version 5.10.103-v8
arch aarch64
timezone Europe/Stockholm
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 4953
Installed Version 1.24.5
Stage running
Available Repositories 1101
Downloaded Repositories 7
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 7.6
update_channel stable
supervisor_version supervisor-2022.05.0
docker_version 20.10.9
disk_total 931.4 GB
disk_used 19.0 GB
healthy true
supported true
board rpi3-64
supervisor_api ok
version_api ok
installed_addons Z-Wave JS (0.1.58), MariaDB (2.4.0), File editor (5.3.3), Let's Encrypt (4.12.2), Samba share (9.6.1), Terminal & SSH (9.4.0)
Dashboards
dashboards 2
resources 2
views 2
mode storage

Huawei Solar Setup

Inverter: SUN2000-8KTL-M1 (Software version: V100R001C00SPC141)
Smart Power Meter (3-phase)
Luna 2000 - 5 kWh battery

Describe the issue

It seems like the permission to write configuration registers stops working after some hours. My guess is that Huawei somehow logs out that permission (or has a timeout).
If I restart home-assistant (or reloads the Huawei integration), the writing works perfect. After a period of time (today 12,5 hours after startup), I get permission denied. It is hard to know exactly when the permission went away. It worked 2,5 hours after startup.
If possible, I would maybe suggest that you do a new login when this happens (or on a timer). I have not looked into that code. Maybe there are some other way of solving it?

Reproduction steps

  1. Start home assistant
  2. Change configuration -> Works ok
  3. Wait an unknown number of hours (more than 2.5, less than 12.5)
  4. Change configuration -> Permission denied
    .

Relevant debug logs

2022-05-04 07:51:49 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 32064
2022-05-04 07:51:54 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 32016
2022-05-04 07:51:56 DEBUG (MainThread) [huawei_solar.huawei_solar] Heartbeat succeeded
2022-05-04 07:51:57 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 37101
2022-05-04 07:52:04 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 37760
2022-05-04 07:52:08 DEBUG (MainThread) [huawei_solar.huawei_solar] Writing to 47075: [0, 300]
2022-05-04 07:52:12 DEBUG (MainThread) [huawei_solar.huawei_solar] Heartbeat succeeded

[... cut not relevant messages ...]

2022-05-04 08:23:35 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 32064
2022-05-04 08:23:35 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 32016
2022-05-04 08:23:35 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 37101
2022-05-04 08:23:35 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 37760
2022-05-04 08:23:48 DEBUG (MainThread) [huawei_solar.huawei_solar] Heartbeat succeeded
2022-05-04 08:24:00 DEBUG (MainThread) [huawei_solar.huawei_solar] Writing to 47075: [0, 250]
2022-05-04 08:24:03 DEBUG (MainThread) [huawei_solar.huawei_solar] Heartbeat succeeded
2022-05-04 08:24:05 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 32064
2022-05-04 08:24:05 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 32016
2022-05-04 08:24:05 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 37101
2022-05-04 08:24:05 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 37760

[ ... cut ...]

2022-05-04 10:27:05 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 32016
2022-05-04 10:27:05 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 37101
2022-05-04 10:27:05 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 37760
2022-05-04 10:27:16 DEBUG (MainThread) [huawei_solar.huawei_solar] Heartbeat succeeded
2022-05-04 10:27:31 DEBUG (MainThread) [huawei_solar.huawei_solar] Heartbeat succeeded
2022-05-04 10:27:33 DEBUG (MainThread) [huawei_solar.huawei_solar] Writing to 47075: [0, 2500]
2022-05-04 10:27:36 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 32064
2022-05-04 10:27:36 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 32016
2022-05-04 10:27:36 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 37101
2022-05-04 10:27:36 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 37760

[ ... cut ... ]

2022-05-04 18:29:30 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 37101
2022-05-04 18:29:30 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 37760
2022-05-04 18:29:35 DEBUG (MainThread) [huawei_solar.huawei_solar] Writing to 47077: [0, 2400]
2022-05-04 18:29:35 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547167342896] Permission denied
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 193, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1634, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1671, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 677, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 955, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 714, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/number/__init__.py", line 75, in async_set_value
    await entity.async_set_value(value)
  File "/config/custom_components/huawei_solar/number.py", line 197, in async_set_value
    if await self.bridge.set(self.entity_description.key, int(value)):
  File "/usr/local/lib/python3.9/site-packages/huawei_solar/bridge.py", line 265, in set
    return await self.client.set(name, value, slave=self.slave_id)
  File "/usr/local/lib/python3.9/site-packages/huawei_solar/huawei_solar.py", line 304, in set
    response = await self.write_registers(
  File "/usr/local/lib/python3.9/site-packages/huawei_solar/huawei_solar.py", line 335, in write_registers
    raise PermissionDenied("Permission denied")
huawei_solar.exceptions.PermissionDenied: Permission denied
2022-05-04 18:30:00 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 32064
2022-05-04 18:30:00 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 32016
2022-05-04 18:30:00 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 37101
2022-05-04 18:30:00 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 37760

[... Reload Huawei integration ... ]

2022-05-04 18:30:32 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 37101
2022-05-04 18:30:32 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 37760
2022-05-04 18:30:36 DEBUG (MainThread) [huawei_solar.huawei_solar] Heartbeat succeeded
2022-05-04 18:30:51 DEBUG (MainThread) [huawei_solar.huawei_solar] Heartbeat succeeded
2022-05-04 18:30:55 DEBUG (MainThread) [huawei_solar.huawei_solar] Writing to 47077: [0, 2499]
2022-05-04 18:31:00 DEBUG (MainThread) [huawei_solar.huawei_solar] Writing to 47077: [0, 2500]
2022-05-04 18:31:02 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 32064
2022-05-04 18:31:02 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 32016
2022-05-04 18:31:02 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 37101

Huawei Solar not avaible from the list "Add Integration"_ wlcrs / huawei_solar #7

The same problem with "Huawei Solar is not available in the list"

The component appears to be loaded from the log.

2021-12-01 15:52:17 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

2021-12-01 15:52:17 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration huawei_solar which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

2021-12-01 15:52:17 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration sonoff which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

Furthermore, there were no messages in the log.
But the component Huawei Solar not avaible from the list "Add Integration".
Nothing has changed in the /config/configuration.yaml. That's why I didn't include this one.

System Health

version core-2021.11.5
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.7
os_name Linux
os_version 5.10.75
arch x86_64
timezone Europe/Amsterdam
Home Assistant Community Store
GitHub API ok
Github API Calls Remaining 4892
Installed Version 1.18.0
Stage running
Available Repositories 975
Installed Repositories 3
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 6.6
update_channel stable
supervisor_version supervisor-2021.10.8
docker_version 20.10.8
disk_total 30.8 GB
disk_used 2.6 GB
healthy true
supported true
board ova
supervisor_api ok
version_api ok
installed_addons SSH & Web Terminal (9.1.1), File editor (5.3.3), Filebrowser (2.19.0)
Lovelace
dashboards 1
resources 0
views 1
mode storage

Connecting to this integration

Hi

I read that this repository is the improved version of the huawei solar from emilv2.
I tried to replace the emilv2 huawei solar with this one, however i couldn't manage to get your version connected whilst i can connect with emil's version. Is the connection procedure different to the one from emilv2?

I have a sun2000 3tkl m1 which is connected with a s dongle.

[INVERTER] = spc140
[DONGLE] = spc124

Thanks in advance!

Huawei Solar not showing in integrations list

Hi,

after adding Huawei Solar to HA via HACS, it's not showing in the integration list.
I tried adding Huawei Solar in HACS by copying the huawei_solar folder to the custom_components folder.
That didn't make Huawei Solar visible in HACS so i removed the folder again and then i added Huawei Solar to HACS true Custom Repositories as an integration.
After that i restarted HA and Huawei Solar was now showing in HACS with a download option.
So i downloaded the Huawei Solar integration and did a restart as asked by HA.
Now that Huawei Solar is installed in HACS, i don't see it showing up in the integrations list in the configuration section.
Configuration -> Devices & Services -> + Add Integration - Huawei Solar is not in the list.
I tried multiple restarts.

Inverter is forgetting Parallel communication mode

Hey guys. I fully realize this is not a problem with this HA integration, but I figure this would be the best way to reach out to users that might have had similar issues.

I have a SUN2000 10kW inverter with smart dongle, but I have a problem accessing it. I can enable the modbus tcp communication, but when setting the parallel communication mode to RS485 it remembers it until the app is closed, next time it is always set to NA. It does not seem to set the setting at all, only displays it as set in the app until next restart.

Have anyone encountered this before?

I want to use the smart dongle to access modbus that way, the internal wifi of the inverter seems to have very low range and I am unable to move more than a few meters away from it. It is also outside so the signal is very dodgy (mostly non-existent) from where my HA server is.

Any ideas and help would be appreciated.

[Bug]: Got error while reading from register 37760 with length 28: Exception Response(131, 3, IllegalAddress)

System Health details

System Health

version core-2022.2.9
installation_type Home Assistant Supervised
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.7
os_name Linux
os_version 5.10.0-11-amd64
arch x86_64
timezone Europe/Berlin
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 4906
Installed Version 1.23.0
Stage running
Available Repositories 1071
Downloaded Repositories 4
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Debian GNU/Linux 11 (bullseye)
update_channel stable
supervisor_version supervisor-2022.01.1
docker_version 20.10.12
disk_total 32.7 GB
disk_used 5.9 GB
healthy true
supported true
supervisor_api ok
version_api ok
installed_addons File editor (5.3.3), Node-RED (11.0.4), Mosquitto broker (6.0.1), Ring-MQTT with Video Streaming (4.9.1)
Lovelace
dashboards 2
resources 0
views 2
mode storage
Spotify
api_endpoint_reachable ok

Huawei Solar Setup

Model
SUN2000-6KTL-M0
Software version
V100R001C00SPC133

Model
SDongleA-01
Software version
V100R001C00SPC122

Power Meter - 3 phase

no battery

Raspberry Pi is configured to be a network bridge between inverters AP (wlan0 192.168.8.0/24) and local home network (eth0 192.168.2.0/24). On Home assistant server the route is configured. Ping to inverter works, telnet to port 502 works, a self written python script (same server) can read registers 37113 and 32080 with unit id = 1. Script disabled for testing this integration to not conflict.

Describe the issue

After adding the integration (1.0.0a3) it confirms that the inverter was successfully added but the integration shows following error:
Could not update HV1970006XXX values: Got error while reading from register 37760 with length 28: Exception Response(131, 3, IllegalAddress)

Reproduction steps

  1. Add repository / custom component via HACS
  2. Restart HAAS
  3. Add integration Huawei Solar4.
  4. Provide values IP: 192.168.8.1, Port: 502, Slave ID: 0 (also tried 1 and 2)

Relevant debug logs

2022-03-02 10:05:22 INFO (MainThread) [pymodbus.client.asynchronous.async_io] Protocol made connection.
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.
2022-03-02 10:05:30 INFO (MainThread) [pymodbus.client.asynchronous.async_io] Protocol made connection.
2022-03-02 10:05:30 INFO (MainThread) [pymodbus.client.asynchronous.async_io] Connected to 192.168.8.1:502.
2022-03-02 10:05:31 INFO (MainThread) [pymodbus.client.asynchronous.async_io] Protocol lost connection.
2022-03-02 10:05:41 INFO (MainThread) [pymodbus.client.asynchronous.async_io] Protocol made connection.
2022-03-02 10:05:41 INFO (MainThread) [pymodbus.client.asynchronous.async_io] Connected to 192.168.8.1:502.
2022-03-02 10:05:43 INFO (MainThread) [pymodbus.client.asynchronous.async_io] Protocol lost connection.
2022-03-02 10:06:03 INFO (MainThread) [pymodbus.client.asynchronous.async_io] Protocol made connection.
2022-03-02 10:06:03 INFO (MainThread) [pymodbus.client.asynchronous.async_io] Connected to 192.168.8.1:502.
2022-03-02 10:06:05 INFO (MainThread) [pymodbus.client.asynchronous.async_io] Protocol lost connection.

Wrong Data on Energy Dashboard

Hi Guys

First many thanks for the amazing job. Im new to HA and just taken my first steps on it.

I followed the readme file and I got my inversor connected and providing data but what I get looks really strange.

image

image

image

I was starting to play around with the data but before wanted to ensure that I did not put anything wrong. BTW Inversor is a Huawei SUN2000 5KTL

Config flow could not be loaded

After installing the integration in HACS, restarting, then going to Add Integration > Huawei Solar, I get an error "config flow could not be loaded".

I dont get far enough to specify the IP address.

Please let me know if you need more info.

Here's a copy of the log

Logger: aiohttp.server
Source: custom_components/huawei_solar/const.py:80
Integration: Huawei Solar
First occurred: 5:17:51 PM (3 occurrences)
Last logged: 5:21:01 PM

Error handling request
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
resp = await self._request_handler(request)
File "/srv/homeassistant/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
resp = await handler(request)
File "/srv/homeassistant/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl
return await handler(request)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
return await handler(request)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/forwarded.py", line 98, in forwarded_middleware
return await handler(request)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/request_context.py", line 24, in request_context_middleware
return await handler(request)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/ban.py", line 78, in ban_middleware
return await handler(request)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/auth.py", line 144, in auth_middleware
return await handler(request)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/view.py", line 136, in handle
result = await result
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/config/config_entries.py", line 130, in post
return await super().post(request)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/data_validator.py", line 62, in wrapper
result = await method(view, request, *args, **kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/data_entry_flow.py", line 72, in post
result = await self._flow_mgr.async_init(
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/data_entry_flow.py", line 151, in async_init
flow, result = await task
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/data_entry_flow.py", line 169, in _async_init
flow = await self.async_create_flow(handler, context=context, data=data)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/config_entries.py", line 709, in async_create_flow
integration.get_platform("config_flow")
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/loader.py", line 532, in get_platform
cache[full_name] = self._import_platform(platform_name)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/loader.py", line 537, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
File "/usr/local/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 961, in _find_and_load_unlocked
File "", line 219, in _call_with_frames_removed
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 843, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/homeassistant/.homeassistant/custom_components/huawei_solar/init.py", line 8, in
from .const import DOMAIN, CONF_SLAVE, DATA_MODBUS_CLIENT
File "/home/homeassistant/.homeassistant/custom_components/huawei_solar/const.py", line 80, in
SENSOR_TYPES: tuple[HuaweiSolarSensorEntityDescription] = (
TypeError: 'type' object is not subscriptable

image

[Bug]: Failed connectivity

System Health details

System Health

version core-2022.4.7
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.9
os_name Linux
os_version 5.10.108
arch aarch64
timezone Europe/London
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 4993
Installed Version 1.24.0
Stage running
Available Repositories 1029
Downloaded Repositories 8
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 7.6
update_channel stable
supervisor_version supervisor-2022.04.0
docker_version 20.10.9
disk_total 115.7 GB
disk_used 92.4 GB
healthy true
supported true
board odroid-n2
supervisor_api ok
version_api ok
installed_addons File editor (5.3.3), MariaDB (2.4.0), Let's Encrypt (4.12.0), Check Home Assistant configuration (3.10.0), Terminal & SSH (9.3.0), Zigbee2mqtt (1.25.0-1), Log Viewer (0.13.0), Mosquitto broker (6.0.1), ESPHome (2022.4.0), Plex Media Server (2.8.0)
Dashboards
dashboards 1
resources 0
views 1
mode storage

Huawei Solar Setup

I'm NOT connecting using the AP method as the AP is 200M away from the HA box.

Hosts

SDongleA-HV2170115623.lan > 10.0.0.101    
SUN2000-102180067169.lan > 10.0.0.182

Firmware

Inverter V200R001C00SPC121
Dongle V100R001C00SPC127

Unrestricted Modbus TCP is enabled and set to RS485. I did notice that RS485 didn't seem to persist after restarts.

Connectivity testing

nmap SDongleA-HV2170115623.lan -p1-10000
PORT     STATE SERVICE
502/tcp  open  mbap
6606/tcp open  unknown

Note 6606 instead of 6607?! 502 does appear to be open.

nmap SUN2000-102180067169.lan -p1-10000
Nmap scan report for SUN2000-102180067169.lan (10.0.0.182)
All 10000 scanned ports on SUN2000-102180067169.lan (10.0.0.182) are closed

Describe the issue

I'm unable to connect to the inverter or dongle.

I don't seem to have any newer firmware options available in the Fusion web interface. Should my firmware be okay?
I don't seem to have 6607 available on the Dongle, is that expected? Do we expect to see 6606?
Is RS485 setting not being persistent a known fault/issue?

Reproduction steps

  1. Install plugin
  2. Attempt to connect
  3. Fails to connect
    ...

Relevant debug logs

Logger: huawei_solar.huawei_solar
Source: /usr/local/lib/python3.9/site-packages/huawei_solar/huawei_solar.py:246
First occurred: 09:22:31 (2 occurrences)
Last logged: 09:23:20

Modbus client is not connected to the inverter.
NoneType: None
Logger: huawei_solar.huawei_solar
Source: /usr/local/lib/python3.9/site-packages/huawei_solar/huawei_solar.py:270
First occurred: 09:24:21 (2 occurrences)
Last logged: 09:24:28

Could not read register value, has another device interrupted the connection?
Logger: pymodbus.client.asynchronous.async_io
Source: /usr/local/lib/python3.9/site-packages/pymodbus/client/asynchronous/async_io/__init__.py:307
First occurred: 09:22:30 (48 occurrences)
Last logged: 09:30:09

Failed to connect: [Errno 111] Connect call failed ('10.0.0.101', 6607)
Failed to connect: Multiple exceptions: [Errno 111] Connect call failed ('::1', 6607, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 6607)
Failed to connect: Multiple exceptions: [Errno 111] Connect call failed ('::1', 6606, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 6606)

[Bug]: Issue activating the Integration

System Health details

System Health

version core-2022.2.3
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.7
os_name Linux
os_version 5.10.88
arch x86_64
timezone Europe/Brussels
Home Assistant Community Store
GitHub API ok
Github API Calls Remaining 4515
Installed Version 1.22.0
Stage running
Available Repositories 978
Downloaded Repositories 11
Home Assistant Cloud
logged_in true
subscription_expiration 4 March 2022, 01:00
relayer_connected true
remote_enabled true
remote_connected true
alexa_enabled false
google_enabled true
remote_server eu-west-2-0.ui.nabu.casa
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 7.1
update_channel stable
supervisor_version supervisor-2022.01.1
docker_version 20.10.9
disk_total 118.5 GB
disk_used 9.4 GB
healthy true
supported true
board generic-x86-64
supervisor_api ok
version_api ok
installed_addons Studio Code Server (4.1.0), Grafana (7.4.1), InfluxDB (4.3.0), Terminal & SSH (9.3.0), Mopidy (6e49c79)
Lovelace
dashboards 1
resources 4
views 1
mode storage
Spotify
api_endpoint_reachable ok

Describe the issue

I receive an error when trying to install the Integration (see debug log below)

Reproduction steps

  1. Install via HACS
  2. Restart HA
  3. Try to install the Integration

Relevant debug logs

Logger: aiohttp.server
Source: requirements.py:194
First occurred: 11:16:57 (1 occurrences)
Last logged: 11:16:57

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 98, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 79, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 219, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 137, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 132, in post
    return await super().post(request)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 62, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 72, in post
    result = await self._flow_mgr.async_init(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 203, in async_init
    flow, result = await task
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 221, in _async_init
    flow = await self.async_create_flow(handler, context=context, data=data)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 730, in async_create_flow
    await async_process_deps_reqs(self.hass, self._hass_config, integration)
  File "/usr/src/homeassistant/homeassistant/setup.py", line 351, in async_process_deps_reqs
    await requirements.async_get_integration_with_requirements(
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 83, in async_get_integration_with_requirements
    await _async_process_integration(hass, integration, done)
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 99, in _async_process_integration
    await async_process_requirements(
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 162, in async_process_requirements
    await _async_process_requirements(
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 194, in _async_process_requirements
    raise RequirementsNotFound(name, [req])
homeassistant.requirements.RequirementsNotFound: Requirements for huawei_solar not found: ['huawei-solar==2.1.0rc4'].

[Bug]: Integration does not show up

System Health details

System Health

version core-2021.12.5
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.7
os_name Linux
os_version 5.10.63-v8
arch aarch64
timezone Europe/Budapest
Home Assistant Community Store
GitHub API ok
Github API Calls Remaining 4776
Installed Version 1.18.0
Stage running
Available Repositories 933
Installed Repositories 7
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 7.0
update_channel stable
supervisor_version supervisor-2021.12.2
docker_version 20.10.9
disk_total 28.6 GB
disk_used 6.4 GB
healthy true
supported true
board rpi4-64
supervisor_api ok
version_api ok
installed_addons Check Home Assistant configuration (3.9.0), Grocy (0.11.0), Portainer (2.0.0), File editor (5.3.3), Log Viewer (0.12.1), FTP (4.4.0), ESPHome (2021.12.1), Let's Encrypt (4.12.0), NGINX Home Assistant SSL proxy (3.1.0), SSH & Web Terminal (10.0.0)
Lovelace
dashboards 2
resources 3
views 5
mode storage

Describe the issue

Hi, I do not know what I do wrong. I added the repo to HACS, installed it. The folder with the files is under custom_components. HA is restarted. Nothing Huawei related is in the logs.
Still the integration is not in the list of available integrations.

Reproduction steps

  1. Try to add the integration

...

Relevant debug logs

nothing unfortunately

[Feature Request]: Allow change update interval

Describe your feature request

Method for modifying update interval for sensors is not working and if it works, it's not very usable since you have to update two dozen of sensors. Exposing a property at integration level as a parameter in order to change update interval should be preferred way. I've manually modified code at const.py and it's working properly but, of course, a more easy way is desirable.

Justification: (changing update interval has a good reason).

After upgrade SPC115 in SUN2000-KTL-L1 and disabling direct query to SUN2000 inverter via regular wifi (not commissioning WIFI), some weird behavior is present. Now a network gateway between commissioning wifi and regular wifi is a must and modbus tcp query must be done via commissioning wifi. If you query very frequently inverter, at a given moment, it stops sending data to Huawei servers and FusionSolar app stop receiving data. This flow is restored as soon as you stop integration or restart HA. Some bug at inverter side locks sending information to Huawei when querying via modbus TCP. As I said, only with SPC115 and later. Modbus keeps running. Only affect to Huawei sending process.
This lock happens once or twice per day, sometimes a bit longer, but always before 48 hours. I've tested by modifying query interval to 150 seconds and no problem has arisen for 72 hours.

change host ip adres

thank you for the awesome integration! Is it possible to change the host ip without removing and re-adding the integration?

[Bug]:

System Health details

System Health

version core-2022.2.5
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.7
os_name Linux
os_version 5.10.98
arch aarch64
timezone Europe/Madrid
Home Assistant Community Store
GitHub API ok
Github API Calls Remaining 5000
Installed Version 1.22.0
Stage running
Available Repositories 986
Downloaded Repositories 34
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 7.4
update_channel stable
supervisor_version supervisor-2022.01.1
docker_version 20.10.9
disk_total 113.9 GB
disk_used 13.2 GB
healthy true
supported true
board odroid-n2
supervisor_api ok
version_api ok
installed_addons Samba share (9.5.1), Check Home Assistant configuration (3.9.0), File editor (5.3.3), NGINX Home Assistant SSL proxy (3.1.1), Portainer (1.5.0), Duck DNS (1.14.0), Terminal & SSH (9.3.0), Mosquitto broker (6.0.1), BlueRiiot2MQTT (0.14.0), motionEye (0.12.0), Traccar (0.12.0), ESPHome (1.17.1), MariaDB (2.4.0), Z-Wave JS (0.1.53)
Lovelace
dashboards 1
resources 18
views 12
mode yaml
Spotify
api_endpoint_reachable ok

Solar Setup Details

SUN2000-5KTL-L1 + SUN2000-3.68KTL-L1
SDongleA-05 (FE)
DDSU666-H
single
No battery

Describe the issue

Integration failed to connect after entering Ip and the 2 possible ports (502 & 6607)

Reproduction steps

  1. Adding the integration and entering the parameters I receive the "Fail to Connect" message
  2. I have ensure the Dongle has the MODBUS TCP enabled
  3. I have tried two possible ports as per the QA
  4. Have the lastest possible firmware version in dongle and inverters
    ...

Relevant debug logs

2022-02-11 17:30:20 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Connecting to 192.168.1.91:502.
2022-02-11 17:30:20 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Connecting.
2022-02-11 17:30:20 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: [Errno 111] Connect call failed ('192.168.1.91', 502)
2022-02-11 17:30:20 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Waiting 100 ms before next connection attempt.
2022-02-11 17:30:20 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Connecting.
2022-02-11 17:30:20 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: [Errno 111] Connect call failed ('192.168.1.91', 502)
2022-02-11 17:30:20 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Waiting 200 ms before next connection attempt.
2022-02-11 17:30:21 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Connecting.
2022-02-11 17:30:21 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: [Errno 111] Connect call failed ('192.168.1.91', 502)
2022-02-11 17:30:21 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Waiting 400 ms before next connection attempt.
2022-02-11 17:30:21 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Connecting.
2022-02-11 17:30:21 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: [Errno 111] Connect call failed ('192.168.1.91', 502)
2022-02-11 17:30:21 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Waiting 800 ms before next connection attempt.
2022-02-11 17:30:21 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 43006
2022-02-11 17:30:21 ERROR (MainThread) [huawei_solar.huawei_solar] Modbus client is not connected to the inverter.
NoneType: None
2022-02-11 17:30:22 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Connecting.
2022-02-11 17:30:22 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: [Errno 111] Connect call failed ('192.168.1.91', 502)
2022-02-11 17:30:22 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Waiting 1600 ms before next connection attempt.
2022-02-11 17:30:23 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Connecting.
2022-02-11 17:30:23 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: [Errno 111] Connect call failed ('192.168.1.91', 502)
2022-02-11 17:30:23 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Waiting 3200 ms before next connection attempt.
2022-02-11 17:30:27 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Connecting.
2022-02-11 17:30:27 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: [Errno 111] Connect call failed ('192.168.1.91', 502)
2022-02-11 17:30:27 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Waiting 6400 ms before next connection attempt.
2022-02-11 17:30:28 WARNING (MainThread) [aioshelly.block_device] device 192.168.1.10 initialize error - TimeoutError()
2022-02-11 17:30:33 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Connecting.
2022-02-11 17:30:33 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: [Errno 111] Connect call failed ('192.168.1.91', 502)
2022-02-11 17:30:33 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Waiting 12800 ms before next connection attempt.
2022-02-11 17:30:43 ERROR (MainThread) [homeassistant.components.netatmo] Error during webhook registration - 400 - Bad request - Allowed ports for webhooks are 80, 88, 443 and 9443. (21) when accessing 'https://api.netatmo.com/api/addwebhook'
2022-02-11 17:30:46 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Connecting.
2022-02-11 17:30:46 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: [Errno 111] Connect call failed ('192.168.1.91', 502)
2022-02-11 17:30:46 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Waiting 25600 ms before next connection attempt.
2022-02-11 17:30:59 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Connecting to 192.168.1.91:6607.
2022-02-11 17:30:59 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Connecting.
2022-02-11 17:30:59 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: [Errno 111] Connect call failed ('192.168.1.91', 6607)
2022-02-11 17:30:59 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Waiting 100 ms before next connection attempt.
2022-02-11 17:30:59 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Connecting.
2022-02-11 17:30:59 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: [Errno 111] Connect call failed ('192.168.1.91', 6607)
2022-02-11 17:30:59 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Waiting 200 ms before next connection attempt.
2022-02-11 17:30:59 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Connecting.
2022-02-11 17:30:59 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: [Errno 111] Connect call failed ('192.168.1.91', 6607)
2022-02-11 17:30:59 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Waiting 400 ms before next connection attempt.
2022-02-11 17:30:59 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Connecting.
2022-02-11 17:30:59 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: [Errno 111] Connect call failed ('192.168.1.91', 6607)
2022-02-11 17:30:59 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Waiting 800 ms before next connection attempt.
2022-02-11 17:31:00 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 43006
2022-02-11 17:31:00 ERROR (MainThread) [huawei_solar.huawei_solar] Modbus client is not connected to the inverter.
NoneType: None
2022-02-11 17:31:00 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Connecting.
2022-02-11 17:31:00 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: [Errno 111] Connect call failed ('192.168.1.91', 6607)
2022-02-11 17:31:00 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Waiting 1600 ms before next connection attempt.
2022-02-11 17:31:02 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Connecting.
2022-02-11 17:31:02 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: [Errno 111] Connect call failed ('192.168.1.91', 6607)
2022-02-11 17:31:02 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Waiting 3200 ms before next connection attempt.
2022-02-11 17:31:05 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Connecting.
2022-02-11 17:31:05 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: [Errno 111] Connect call failed ('192.168.1.91', 6607)
2022-02-11 17:31:05 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Waiting 6400 ms before next connection attempt.
2022-02-11 17:31:11 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Connecting.
2022-02-11 17:31:11 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: [Errno 111] Connect call failed ('192.168.1.91', 6607)
2022-02-11 17:31:11 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Waiting 12800 ms before next connection attempt.
2022-02-11 17:31:11 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Connecting.
2022-02-11 17:31:11 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: [Errno 111] Connect call failed ('192.168.1.91', 502)
2022-02-11 17:31:11 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Waiting 51200 ms before next connection attempt.
2022-02-11 17:31:19 ERROR (MainThread) [homeassistant.components.shelly] Timeout fetching Shelly Puerta Valla data
2022-02-11 17:31:24 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Connecting.
2022-02-11 17:31:24 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: [Errno 111] Connect call failed ('192.168.1.91', 6607)
2022-02-11 17:31:24 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Waiting 25600 ms before next connection attempt.

[Feature Request]: Option to differenciate generated sensor names

Describe your feature request

When you configure one inverter you get two active power sensors. Home assistant renames one to active_power and the other one to active_power_1. This may be confusing at first to differenciate without looking at the parent entity but you can handle it without problems.

When you have two inverters you get also active_power_2 and active_power_3 and all the other sensors to _2 which refer to one or other inverter depending on the order you added them. This is a bit more problematic to manage in the long term remembering which one is suffixed with _1.

Using an automated prefix would break backwards compatibility and it is also hard to use a good one as inverter model can be also duplicated and serial number is not very human friendly.

I would like better to have an optional alias parameter to label the inverter's generated sensors with a custom prefix you can remember when using the sensors in cards/automations and so on

NOTE: I am waiting for a more final version to migrate and only temporary tested your login and write branch so I apologize if this do not applies to the main branch

huawei_solar.huawei_solar.ReadException: could not read register value, is an other device already connected?

System Health details

System Health

version core-2021.12.5
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.7
os_name Linux
os_version 5.10.88
arch x86_64
timezone Europe/Amsterdam
Home Assistant Community Store
GitHub API ok
Github API Calls Remaining 4982
Installed Version 1.18.0
Stage running
Available Repositories 932
Installed Repositories 3
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 7.1
update_channel stable
supervisor_version supervisor-2021.12.2
docker_version 20.10.9
disk_total 30.8 GB
disk_used 4.8 GB
healthy true
supported true
board ova
supervisor_api ok
version_api ok
installed_addons File editor (5.3.3), Filebrowser (2.20.1), Terminal & SSH (9.2.2), MariaDB (2.4.0), phpMyAdmin (0.6.0)
Lovelace
dashboards 1
resources 0
views 2
mode storage

Describe the issue

I have followed all the steps as stated in the description..?
But I can't get it to work.
IP number and port number checked with https://www.advanced-port-scanner.com/

HUAWEI 17KTL M0 (SPC139)
Dongle WIFI/FE (SPC123).
IP 192.169.0.8

Reproduction steps

IP and port checked

  1. Install the integration with HACS,
  2. Restart HA
  3. Go to Configuration -> Integrations and click the + Add Integration button
  4. Select Huawei Solar from the list
  5. Enter the IP address 192.168.0.8
  6. Select if you have a battery (none)
  7. Select optimizers (none).
  8. slave id 0. (also tried 1)

Relevant debug logs

Logger: huawei_solar.huawei_solar
Source: /usr/local/lib/python3.9/site-packages/huawei_solar/huawei_solar.py:437
First occurred: 2:26:15 PM (1 occurrences)
Last logged: 2:26:15 PM

could not read register value, is an other device already connected?

---------------------------------------------------------------

This error originated from a custom integration.

Logger: custom_components.huawei_solar.config_flow
Source: custom_components/huawei_solar/config_flow.py:47
Integration: Huawei Solar
First occurred: 2:26:15 PM (1 occurrences)
Last logged: 2:26:15 PM

Unexpected exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/huawei_solar/huawei_solar.py", line 419, in read_register
    response = await client.protocol.read_holding_registers(
  File "/usr/local/lib/python3.9/site-packages/pymodbus/client/asynchronous/async_io/__init__.py", line 35, in execute
    resp = await asyncio.wait_for(req, timeout=self._timeout)
  File "/usr/local/lib/python3.9/asyncio/tasks.py", line 481, in wait_for
    return fut.result()
pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Connection lost during request

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/huawei_solar/config_flow.py", line 77, in async_step_user
    info = await validate_input(self.hass, user_input)
  File "/config/custom_components/huawei_solar/config_flow.py", line 47, in validate_input
    model_name = (await inverter.get(ATTR_MODEL_NAME)).value
  File "/usr/local/lib/python3.9/site-packages/huawei_solar/huawei_solar.py", line 394, in get
    response = await self.read_register(await self.client, reg.register, reg.length)
  File "/usr/local/lib/python3.9/site-packages/huawei_solar/huawei_solar.py", line 438, in read_register
    raise ReadException(message)
huawei_solar.huawei_solar.ReadException: could not read register value, is an other device already connected?

-------------------------------------------------------------

Logger: pymodbus.client.asynchronous.async_io
Source: /usr/local/lib/python3.9/site-packages/pymodbus/client/asynchronous/async_io/__init__.py:307
First occurred: 2:26:16 PM (15 occurrences)
Last logged: 2:48:05 PM

Failed to connect: Multiple exceptions: [Errno 111] Connect call failed ('::1', 502, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 502)


---------------------------------------------------------

2022-01-07 14:25:14 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration huawei_solar which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-01-07 14:25:14 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-01-07 14:26:15 ERROR (MainThread) [huawei_solar.huawei_solar] could not read register value, is an other device already connected?
2022-01-07 14:26:15 ERROR (MainThread) [custom_components.huawei_solar.config_flow] Unexpected exception
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/huawei_solar/huawei_solar.py", line 419, in read_register
response = await client.protocol.read_holding_registers(
File "/usr/local/lib/python3.9/site-packages/pymodbus/client/asynchronous/async_io/__init__.py", line 35, in execute
resp = await asyncio.wait_for(req, timeout=self._timeout)
File "/usr/local/lib/python3.9/asyncio/tasks.py", line 481, in wait_for
return fut.result()
pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Connection lost during request
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/config/custom_components/huawei_solar/config_flow.py", line 77, in async_step_user
info = await validate_input(self.hass, user_input)
File "/config/custom_components/huawei_solar/config_flow.py", line 47, in validate_input
model_name = (await inverter.get(ATTR_MODEL_NAME)).value
File "/usr/local/lib/python3.9/site-packages/huawei_solar/huawei_solar.py", line 394, in get
response = await self.read_register(await self.client, reg.register, reg.length)
File "/usr/local/lib/python3.9/site-packages/huawei_solar/huawei_solar.py", line 438, in read_register
raise ReadException(message)
huawei_solar.huawei_solar.ReadException: could not read register value, is an other device already connected?
2022-01-07 14:26:16 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: Multiple exceptions: [Errno 111] Connect call failed ('::1', 502, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 502)
2022-01-07 14:26:16 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: Multiple exceptions: [Errno 111] Connect call failed ('::1', 502, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 502)
2022-01-07 14:26:16 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: Multiple exceptions: [Errno 111] Connect call failed ('::1', 502, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 502)
2022-01-07 14:26:17 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: Multiple exceptions: [Errno 111] Connect call failed ('::1', 502, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 502)
2022-01-07 14:26:19 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: Multiple exceptions: [Errno 111] Connect call failed ('::1', 502, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 502)
2022-01-07 14:26:22 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: Multiple exceptions: [Errno 111] Connect call failed ('::1', 502, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 502)
2022-01-07 14:26:28 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: Multiple exceptions: [Errno 111] Connect call failed ('::1', 502, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 502)
2022-01-07 14:26:41 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: Multiple exceptions: [Errno 111] Connect call failed ('::1', 502, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 502)
2022-01-07 14:27:07 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: Multiple exceptions: [Errno 111] Connect call failed ('::1', 502, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 502)
2022-01-07 14:27:58 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: Multiple exceptions: [Errno 111] Connect call failed ('::1', 502, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 502)
2022-01-07 14:29:40 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: Multiple exceptions: [Errno 111] Connect call failed ('::1', 502, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 502)
2022-01-07 14:33:05 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: Multiple exceptions: [Errno 111] Connect call failed ('::1', 502, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 502)
2022-01-07 14:38:05 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: Multiple exceptions: [Errno 111] Connect call failed ('::1', 502, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 502)
2022-01-07 14:43:05 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: Multiple exceptions: [Errno 111] Connect call failed ('::1', 502, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 502)
2022-01-07 14:48:05 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: Multiple exceptions: [Errno 111] Connect call failed ('::1', 502, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 502)

[Bug]:

System Health details

System Health

version core-2022.2.9
installation_type Home Assistant Container
dev false
hassio false
docker true
user root
virtualenv false
python_version 3.9.7
os_name Linux
os_version 5.4.72-microsoft-standard-WSL2
arch x86_64
timezone Europe/Stockholm
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 4810
Installed Version 1.23.0
Stage running
Available Repositories 997
Downloaded Repositories 32
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Lovelace
dashboards 3
resources 15
views 25
mode storage
Spotify
api_endpoint_reachable ok

Huawei Solar Setup

Inverter SUN2000-6KTL-M1 V100R001C00SPC140
Dongle SDongleA V100R001C00SPC126

Describe the issue

The efficiency value goes from 0 to 655,35% before production starts and right after production stops. See image.
This happens mainly during standby:detecting irradiation and standby:init
It looks like an overflow for unsigned short due to division by zero.

image

Reproduction steps

See Above

Relevant debug logs

To be added if needed

[Bug]: No labels for fields to install the integration

System Health details

System Health

version: core-2022.2.5
installation_type: Home Assistant OS
dev: false
hassio: true
docker: true
user: root
virtualenv: false
python_version: 3.9.7
os_name: Linux
os_version: 5.10.91
arch: x86_64
timezone: Europe/Brussels

GitHub API: ok
Github API Calls Remaining: 4517
Installed Version: 1.22.0
Stage: running
Available Repositories: 1043
Downloaded Repositories: 24

logged_in: false
can_reach_cert_server: ok
can_reach_cloud_auth: ok
can_reach_cloud: ok

host_os: Home Assistant OS 7.2
update_channel: stable
supervisor_version: supervisor-2022.01.1
docker_version: 20.10.9
disk_total: 30.8 GB
disk_used: 17.9 GB
healthy: true
supported: true
board: ova
supervisor_api: ok
version_api: ok
installed_addons: Duck DNS (1.14.0), Samba share (9.5.1), Studio Code Server (4.1.0), Mosquitto broker (6.0.1), Node-RED (10.4.0), Zigbee2mqtt (1.23.0-1), Home Assistant Google Drive Backup (0.105.2), ESPHome (2022.1.3), Grafana (7.4.1), InfluxDB (4.3.0), Frigate NVR (2.3)

dashboards: 1
resources: 15
views: 14
mode: storage

api_endpoint_reachable: ok

Solar Setup Details

Single phase
Power meter used
Inverter SUN2000-4.6KTL-L1 with firmware V200R001C00SPC115
10 kWh Luna battery with firmware V100R002C00SPC106

Describe the issue

Unable to install the integration due to missing labels for the input fields.

Reproduction steps

  1. Install your integration by HACS
  2. Restarted HA
  3. Installed your integration in HA (Configuration - Devices & Services - Integrations - + Add integration - and got a first popup with 3 input fields but without labels:

Schermafbeelding 2022-02-10 om 17 28 25

I guess the first field is the IP address. Second field is I guess the por (I left it on the default value) and the 3th field represents the slave option. No idea if the tickbox is used for optimisers or battery but I enabled the option.

After this I get another popup with 2 fields:

Schermafbeelding 2022-02-10 om 17 33 23

The first box shows 'intaller' and cannot be changed.
The second box looks like a password box. I entered my FusionSolar login but got an error.
Please instruct what to fill in the second box.

Thanks in advance.

Relevant debug logs

no logs

[Bug]: Huawei sensors are going unavailable sometimes

System Health details

System Health

version core-2022.2.7
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.7
os_name Linux
os_version 5.10.98
arch x86_64
timezone Europe/Brussels
Home Assistant Community Store
GitHub API ok
Github API Calls Remaining 5000
Installed Version 1.22.0
Stage running
Available Repositories 1060
Downloaded Repositories 36
Home Assistant Supervisor
host_os Home Assistant OS 7.4
update_channel beta
supervisor_version supervisor-2022.01.1
docker_version 20.10.9
disk_total 457.7 GB
disk_used 112.5 GB
healthy true
supported true
board generic-x86-64
supervisor_api ok
version_api ok
installed_addons Samba share (9.5.1), AdGuard Home (4.4.4), AppDaemon 4 (0.8.1), Caddy (1.6), Check Home Assistant configuration (3.9.0), Duck DNS (1.14.0), ESPHome (2022.1.4), Mosquitto broker (6.0.1), Studio Code Server (4.1.0), WireGuard (0.6.0), MariaDB (2.4.0), Samba Backup (5.0.0), InfluxDB (4.3.0), Grafana (7.4.1), Frigate NVR (2.3), SSH & Web Terminal (10.0.2), Glances (0.14.2), phpMyAdmin (0.7.0), Mealie (0.5.6), Arpspoof (1.0.0), Caddy 2 (1.1.0), Firefly iii (5.6.14-2)
Lovelace
dashboards 3
resources 17
views 18
mode storage
Spotify
api_endpoint_reachable ok

Describe the issue

My HA instance is connected to the internal wifi of the inverter And I'm using your latest version 1.0.0.a3, in the manifest.json it is still 1.0.0.a1

All Huawei sensors are going unavailable for some time.
Schermafbeelding 2022-02-16 om 14 07 47

Schermafbeelding 2022-02-16 om 14 10 03

Reproduction steps

  1. Connect to internal wifi
  2. Install integration
  3. Just wait
    ...

Relevant debug logs

This is the moment everything becomes unavailable

Deze fout is ontstaan door een aangepaste integratie.

Logger: custom_components.huawei_solar
Source: helpers/update_coordinator.py:193
Integration: Huawei Solar
First occurred: 11:40:50 (1 occurrences)
Last logged: 11:40:50

Timeout fetching HV20C0092844_data_update_coordinator data
Logger: huawei_solar.huawei_solar
Source: /usr/local/lib/python3.9/site-packages/huawei_solar/huawei_solar.py:270
First occurred: 11:46:01 (1 occurrences)
Last logged: 11:46:01

Could not read register value, has another device interrupted the connection?
Logger: pymodbus.client.asynchronous.async_io
Source: /usr/local/lib/python3.9/site-packages/pymodbus/client/asynchronous/async_io/__init__.py:307
First occurred: 12:02:41 (20 occurrences)
Last logged: 13:00:56

Failed to connect: [Errno 113] Connect call failed ('192.168.200.1', 6607)
Failed to connect: [Errno 110] Connect call failed ('192.168.200.1', 6607)
Logger: huawei_solar.huawei_solar
Source: /usr/local/lib/python3.9/site-packages/huawei_solar/huawei_solar.py:246
First occurred: 12:02:31 (105 occurrences)
Last logged: 13:05:51

Modbus client is not connected to the inverter.
NoneType: None

And this are all debug logs from going unavailable to available again, sorry for the very long logs...

https://paste.ubuntu.com/p/mFwtgHDwPK/

[Bug]: Grid Active Power and Grid Exported are inverted (negative)

System Health details

System Health

version core-2022.4.6
installation_type Home Assistant Container
dev false
hassio false
docker true
user root
virtualenv false
python_version 3.9.9
os_name Linux
os_version 5.4.0-1058-raspi
arch aarch64
timezone Europe/Madrid
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 5000
Installed Version 1.24.5
Stage waiting
Available Repositories 1092
Downloaded Repositories 17
Dashboards
dashboards 1
resources 10
views 11
mode storage

Huawei Solar Setup

Inverter: SUN2000-4KTL-L1
Single Phase meter.
No Battery
No SDongle, builtin wifi

Describe the issue

Both Grid Active Power and Grid Exported are inverted (negative)
image

Reproduction steps

Just connect to my inverter...

Relevant debug logs

A lot of repetitions of this, nothing else:

2022-04-29 23:25:27 DEBUG (MainThread) [huawei_solar.huawei_solar] Heartbeat succeeded
2022-04-29 23:25:42 DEBUG (MainThread) [huawei_solar.huawei_solar] Heartbeat succeeded
2022-04-29 23:25:44 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 32064
2022-04-29 23:25:44 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 32016
2022-04-29 23:25:44 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 37201
2022-04-29 23:25:44 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 37101
2022-04-29 23:25:44 DEBUG (MainThread) [custom_components.huawei_solar] Finished fetching 102060084875_data_update_coordinator data in 0.607 seconds (success: True)```

Permission denied after lost of connection with the inverter

System Health details

System Health

version core-2022.2.7
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.7
os_name Linux
os_version 5.10.98
arch x86_64
timezone Europe/Madrid
Home Assistant Community Store
GitHub API ok
Github API Calls Remaining 4862
Installed Version 1.22.0
Stage running
Available Repositories 1048
Downloaded Repositories 23
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 7.4
update_channel stable
supervisor_version supervisor-2022.01.1
docker_version 20.10.9
disk_total 234.0 GB
disk_used 12.0 GB
healthy true
supported true
board generic-x86-64
supervisor_api ok
version_api ok
installed_addons Terminal & SSH (9.3.0), Mosquitto broker (6.0.1), AppDaemon 4 (0.8.1), Studio Code Server (4.1.0), ESPHome (2022.1.4), SQLite Web (3.2.1), WireGuard (0.6.0)
Lovelace
dashboards 3
resources 20
views 6
mode storage

Describe the issue

When there is a connection issue at the inverter (last one was due to a network issue at my house) then authenticated connection that allows writing a register get lost and any further modification produces a Permission denied error

Reproduction steps

  1. Connect the integration to the inverter
  2. Wait until there is some connection failure to the inverter (for example battery SOC goes to 0 at some point or forcing network issues)
  3. Try to write a register
    ...

Permission denied error which is fixed restarting HA

Relevant debug logs

2022-02-16 10:01:52 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [139737392269776] Received {'type': 'call_service', 'domain': 'number', 'service': 'set_value', 'service_data': {'value': '49', 'entity_id': 'number.grid_charge_cutoff_soc'}, 'id': 65}
2022-02-16 10:01:52 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=number, service=set_value, service_data=value=49, entity_id=number.grid_charge_cutoff_soc>
2022-02-16 10:01:52 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [139737487853360] Sending {"id": 48, "type": "event", "event": {"event_type": "call_service", "data": {"domain": "number", "service": "set_value", "service_data": {"value": "49", "entity_id": "number.grid_charge_cutoff_soc"}}, "origin": "LOCAL", "time_fired": "2022-02-16T09:01:52.733201+00:00", "context": {"id": "4c554543b3f15ddb84b61428af1a8a06", "parent_id": null, "user_id": "43afe331828341e092825df35208db49"}}}
2022-02-16 10:01:52 DEBUG (MainThread) [pymodbus.payload] [490]
2022-02-16 10:01:52 DEBUG (MainThread) [pymodbus.payload] [490]
2022-02-16 10:01:52 DEBUG (MainThread) [huawei_solar.huawei_solar] Writing to 47088: [490]
2022-02-16 10:01:52 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] send: 0x0 0x24 0x0 0x0 0x0 0x9 0x0 0x10 0xb7 0xf0 0x0 0x1 0x2 0x1 0xea
2022-02-16 10:01:52 DEBUG (MainThread) [pymodbus.transaction] Adding transaction 36
2022-02-16 10:01:52 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] recv: 0x0 0x24 0x0 0x0 0x0 0x3 0x0 0x90 0x80
2022-02-16 10:01:52 DEBUG (MainThread) [pymodbus.framer.socket_framer] Processing: 0x0 0x24 0x0 0x0 0x0 0x3 0x0 0x90 0x80
2022-02-16 10:01:52 DEBUG (MainThread) [pymodbus.factory] Factory Response[144]
2022-02-16 10:01:52 DEBUG (MainThread) [pymodbus.transaction] Getting transaction 36
2022-02-16 10:01:52 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139737392269776] Permission denied
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 190, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1630, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1667, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await self.hass.helpers.service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 668, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 930, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 705, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/number/__init__.py", line 75, in async_set_value
    await entity.async_set_value(value)
  File "/config/custom_components/huawei_solar/number.py", line 197, in async_set_value
    if await self.bridge.set(self.entity_description.key, int(value)):
  File "/usr/local/lib/python3.9/site-packages/huawei_solar/bridge.py", line 240, in set
    return await self.client.set(name, value, slave=self.slave_id)
  File "/usr/local/lib/python3.9/site-packages/huawei_solar/huawei_solar.py", line 304, in set
    response = await self.write_registers(
  File "/usr/local/lib/python3.9/site-packages/huawei_solar/huawei_solar.py", line 335, in write_registers
    raise PermissionDenied("Permission denied")
huawei_solar.exceptions.PermissionDenied: Permission denied
2022-02-16 10:01:52 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [139737392269776] Sending {"id": 65, "type": "result", "success": false, "error": {"code": "unknown_error", "message": "Permission denied"}}

[Bug]: Error while trying to add integration of version 1.0.0a3

System Health details

System Health

version core-2022.2.5
installation_type Home Assistant Core
dev false
hassio false
docker false
user root
virtualenv true
python_version 3.9.8
os_name Linux
os_version 5.13.0-30-generic
arch x86_64
timezone UTC
Home Assistant Community Store
GitHub API ok
Github API Calls Remaining 4844
Installed Version 1.22.0
Stage running
Available Repositories 1043
Downloaded Repositories 2
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Lovelace
dashboards 2
resources 0
views 3
mode storage

Huawei Solar Setup

1 x Sun2000 KTL 4.6 L1 (Connected by wire to Main router. IP inverter : 192.168.0.209)
1 x Luna2000 10kWh
1 x 3-phase power meter

Laptop with Ubuntu running HA connected to a Secondary Router by Wifi
Laptop IP (IP 192.168.1.118)
DNS 192.168.0.1

Both routers are connected by wire together

Describe the issue

Hello,
I'm pretty new in the HA world (playing since 2 weeks with it, and waiting for the Raspberry Pi 4 B 4Gb to arrive very soon)

I was able to install the Version 0.5.1 of Huawei Solar.
I wanted to install the 1.0.0a3 to be on the latest version with the optimisation that I could read in the forum, but when I do this, I get the Error message "Config flow could not be loaded: [object Object]"
-> I tried to uninstall in HACS
-> Clear cache and cookie from browser
-> Close Broswer
-> Restart HA
-> Update HA
-> HACS seems to be already on the latest version

Reproduction steps

1.Install Huawei Solar from HACS
2.Restart HA Server management via Configuration> Settings
3. Clear Browser cache & Cookie
4.Try to add the integration Huawei Solar from Configuration>Devices & Services
5. Loading a while then Error
6. Retry
7. Call for support :)

Relevant debug logs

Logger: homeassistant.config_entries
Source: config_entries.py:735
First occurred: 10:43:36 PM (2 occurrences)
Last logged: 10:54:02 PM

Error occurred loading configuration flow for integration huawei_solar: cannot import name 'HuaweiSolarBridge' from 'huawei_solar' (/root/snap/home-assistant-snap/483/.local/lib/python3.9/site-packages/huawei_solar/__init__.py)


2022-02-18 22:43:17 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration huawei_solar which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-02-18 22:43:17 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-02-18 22:43:19 WARNING (MainThread) [homeassistant.components.updater]
NOTE! Using a replacement (custom) 'updater' component for the snap package.
Do NOT report bugs of any kind related to 'updater' to the Home Assistant core project.
Report any issues at https://github.com/home-assistant-snap/home-assistant-snap/issues
2022-02-18 22:43:19 WARNING (MainThread) [homeassistant.components.updater]
NOTE! Using a replacement (custom) 'updater' component for the snap package.
Do NOT report bugs of any kind related to 'updater' to the Home Assistant core project.
Report any issues at https://github.com/home-assistant-snap/home-assistant-snap/issues
2022-02-18 22:43:19 WARNING (MainThread) [homeassistant.components.meteo_france] 1 hour rain forecast not available. Halle - Flanders - BE is not in covered zone
2022-02-18 22:43:19 WARNING (MainThread) [homeassistant.components.meteo_france] Weather alert not available: The city Halle - Flanders - BE is not in metropolitan France or Andorre
2022-02-18 22:43:23 WARNING (MainThread) [homeassistant.components.homeassistant.triggers.numeric_state] Error initializing 'Turn on boiler' trigger: In 'numeric_state' condition: unknown entity sensor.input_power
2022-02-18 22:43:23 WARNING (MainThread) [homeassistant.components.homeassistant.triggers.numeric_state] Error initializing 'Turn OFF boiler ' trigger: In 'numeric_state' condition: unknown entity sensor.input_power
2022-02-18 22:43:36 ERROR (MainThread) [homeassistant.config_entries] Error occurred loading configuration flow for integration huawei_solar: cannot import name 'HuaweiSolarBridge' from 'huawei_solar' (/root/snap/home-assistant-snap/483/.local/lib/python3.9/site-packages/huawei_solar/__init__.py)
2022-02-18 22:54:02 ERROR (MainThread) [homeassistant.config_entries] Error occurred loading configuration flow for integration huawei_solar: cannot import name 'HuaweiSolarBridge' from 'huawei_solar' (/root/snap/home-assistant-snap/483/.local/lib/python3.9/site-packages/huawei_solar/__init__.py)
2022-02-18 23:01:10 ERROR (MainThread) [homeassistant.components.upnp] Timeout fetching WRT320N data

config flow could not be loaded

After installing Huawei Solar i cannot get past the config flow could not be loaded warning message, I have checked the closed issue in #4 and i have python version 3.9.7 installing on a Hyper V system using HA 2021.12.8
image

The only error that does come up is this
Logger: homeassistant.config_entries
Source: config_entries.py:720
First occurred: 12:24:27 PM (1 occurrences)
Last logged: 12:24:27 PM

Error occurred loading configuration flow for integration huawei_solar: cannot import name 'AsyncHuaweiSolar' from 'huawei_solar' (/usr/local/lib/python3.9/site-packages/huawei_solar/init.py)

could not read register value, is an other device already connected?

When adding the integration through the GUI, after a while, the following error is shown:

Logger: custom_components.huawei_solar.config_flow
Source: custom_components/huawei_solar/config_flow.py:54
Integration: Huawei Solar
First occurred: 15:36:56 (1 occurrences)
Last logged: 15:36:56

Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/huawei_solar/config_flow.py", line 80, in async_step_user
    info = await validate_input(self.hass, user_input)
  File "/config/custom_components/huawei_solar/config_flow.py", line 54, in validate_input
    model_name = inverter.get(ATTR_MODEL_ID).value
  File "/usr/local/lib/python3.9/site-packages/huawei_solar/huawei_solar.py", line 265, in get
    response = self.read_register(reg.register, reg.length)
  File "/usr/local/lib/python3.9/site-packages/huawei_solar/huawei_solar.py", line 312, in read_register
    raise ReadException(message)
huawei_solar.huawei_solar.ReadException: could not read register value, is an other device already connected?

I have previously used Emilv2's integration but I would love to switch to this one. I've removed his from HACS and added yours. But at least the setup worked over there.

I can also run this testing code successfully, just to show that a successful read can be performed.

client = ModbusClient("192.168.1.40", port=502)

client.connect()

if client.connect():
    time.sleep(1)

    rr = client.read_holding_registers(0x7D50, 0x02, unit=1)  # 32080 => active_power

    activePowerInv = rr.registers[1]

    print(activePowerInv)

[Bug]: Incorrect values after loss of AC power

System Health details

System Health

version core-2022.3.6
installation_type Home Assistant Supervised
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.9
os_name Linux
os_version 5.10.0-10-amd64
arch x86_64
timezone Europe/Bucharest
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 4865
Installed Version 1.23.0
Stage running
Available Repositories 1008
Downloaded Repositories 10
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Debian GNU/Linux 11 (bullseye)
update_channel stable
supervisor_version supervisor-2022.03.5
docker_version 20.10.12
disk_total 218.1 GB
disk_used 90.0 GB
healthy true
supported failed to load: Unsupported
supervisor_api ok
version_api ok
installed_addons Duck DNS (1.14.0), SSH & Web Terminal (10.1.1), Studio Code Server (4.1.0), Mosquitto broker (6.0.1), ESPHome (2022.3.0), NGINX Home Assistant SSL proxy (3.1.1), Samba share (9.5.1), Zigbee2mqtt (1.24.0-1), Transmission (dev), RTSPtoWebRTC (1.0.1), rtl_433 MQTT Auto Discovery (0.3.1), Log Viewer (0.13.0), Node-RED (11.1.0)
Lovelace
dashboards 2
resources 5
views 5
mode storage
Xiaomi Miot Auto
component_version 0.5.4
can_reach_server ok
can_reach_spec ok
logged_accounts 1
total_devices 5

Huawei Solar Setup

Sun2000 8KTL-M1
Meter - 3 phase
Wifi SDongle
All with latest firmware
no battery

Describe the issue

After the AC power is lost (due to grid issues i.e.) It seems that a very high number of kwh is reported(as produced and consumed) - which completely screws up the stats
I noticed this issue with the other HASS plugin for Huawei inverters as well, I'm not sure what produces it(I suppose it's a bad reading from the registry via Modbus, maybe an exception should cover it)
On the Solar Fusion web app all it's normal.
Captură de ecran din 2022-03-22 la 16 16 22
Captură de ecran din 2022-03-22 la 16 30 47

Reproduction steps

  1. Use as normal
  2. Disconnect the grid completely (including the power meter)
  3. Wait for the stats in HASS again.
    ...

Relevant debug logs

debugging was not on.

After update to v1.0.0 - a new interver was added

Hi.
I updated from v0.5.1 to v1.0.0.
This addon added new inverter with same name and "_2" at end entity name.

How to upgrade without changing entity names and all other integrations with it?

System Health

version core-2022.3.8
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.9
os_name Linux
os_version 5.10.108
arch x86_64
timezone Europe/Warsaw
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 4881
Installed Version 1.24.0
Stage running
Available Repositories 1100
Downloaded Repositories 5
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 7.6
update_channel stable
supervisor_version supervisor-2022.04.0
docker_version 20.10.9
disk_total 31.3 GB
disk_used 16.4 GB
healthy true
supported true
board ova
supervisor_api ok
version_api ok
installed_addons File editor (5.3.3), Terminal & SSH (9.3.0), Mosquitto broker (6.0.1), Zigbee2mqtt (1.25.0-1), Node-RED (11.1.1)
Lovelace
dashboards 5
resources 1
views 8
mode storage

Huawei Solar not avaible from the list "Add Integration"_ wlcrs / huawei_solar

Hello,

I have done all steps:

  1. Install integration with HACS, or copy the contents of this repository into the custom_components/huawei_solar directory
  2. Restart HA
  3. Go to Configuration -> Integrations and click the + Add Integration button
    And Huawei Solar ist not avaible to be selected.
    I have huawei_solar folder with all components, in HACS this Integration Hawei Solar is visible, but nothing in the Configuration/Integration - so I can not edit Energy card.
    Probably this is sth simple but I can not find solution - Thank you for your help in adv!

cannot get get connectivity between HA on my home network and the inverter AP

Hello,

first of all thanks for your great work and detailed descriptions!
I was trying to make connection, integration of Huawei Solar feature to my HA based on raspberry pi4.
I tried: following procedure: configure this device in Hass.io via Configuration -> Add-ons, Backups & Supervisor -> System -> Change (next to IP address) -> WLAN.
Inverter was found as wifi AP. but i cannot manage to connect. Error message received:
"Failed to change network settings
Activating connection failed, check connection settings."

Please support/guide how to continue in order to get connections.

Thank you!

issue
P

Forced charge/discharge with services?

Hi,
I have installed the integration via HACS and it works well.
It is possible to use the services in Automations?
As I cant get this to work, I guess that there is some limitations when it is possible to run Forced charge/discharge? More than the obvious cases that you cant charge when battery has SOC 100%.

Can this for example be done in combination with "Max self Consumtion" or only with "Time of Use".

I plan to set this up with the state of an binary sensor that gives states "on" /"off" depending on Nordpool prices and level of SOC in battery
/TB

Change IP address?

Describe your feature request

What should I do if a router reset changed my converter's ip address? Where can I adjust it?
Thanks for this amazing integration!

Daily Yield also counts battery usage

Hi,

First of all, thanks for the great work on this integration, we use it daily in our HA setup !

In our house, we have a solar installation with also a 10Kwh battery installed.
I noticed that the Daily Yield also includes the battery discharge value.
You can clearly see this when the sun is down, then the Daily Yield is still increasing.

I was wondering if there is no other value that can be read to just have the PV Yield and not have the battery usage included ?

Thanks

Fix commingling of battery charging/discharging in yield

The values reported in Daily Yield/Total Yield are muddied when you have a home battery (ex. LUNA2000) connected to your inverter (ex. SUN2000L).

Energy used to charge the battery is not added to the yield, while energy which was discharged from the battery is added to the yield.

It's not as simple as adding/substracting the values from the Battery (Dis)charge fields, as you need to account for conversion losses. For example: when I look to the daily values before the sun has come up, the Battery Discharge can report 1.2 kWh, while the daily yield reports roughly 1.0 kWh at that moment.

[Bug]: Unit of measurement is wrong for PV1 and PV2 voltage

System Health details

System Health

version core-2022.2.0b1
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.7
os_name Linux
os_version 5.10.88
arch x86_64
timezone Europe/Brussels
Home Assistant Community Store
GitHub API ok
Github API Calls Remaining 4559
Installed Version 1.20.0
Stage running
Available Repositories 1039
Downloaded Repositories 36
Home Assistant Supervisor
host_os Home Assistant OS 7.1
update_channel beta
supervisor_version supervisor-2022.01.0
docker_version 20.10.9
disk_total 457.7 GB
disk_used 114.0 GB
healthy true
supported true
board generic-x86-64
supervisor_api ok
version_api ok
installed_addons Samba share (9.5.1), AdGuard Home (4.4.3), AppDaemon 4 (0.8.1), Caddy (1.6), Check Home Assistant configuration (3.9.0), Duck DNS (1.14.0), ESPHome (2022.1.2), Mosquitto broker (6.0.1), Studio Code Server (4.1.0), WireGuard (0.6.0), MariaDB (2.4.0), Samba Backup (5.0.0), InfluxDB (4.3.0), Grafana (7.4.1), Frigate NVR (2.3), SSH & Web Terminal (10.0.2), Glances (0.14.2), phpMyAdmin (0.7.0), Mealie (0.5.4), Arpspoof (1.0.0), Guacamole (1.3.0), Caddy 2 (1.0.9), Firefly iii (5.6.10-7)
Lovelace
dashboards 3
resources 17
views 18
mode storage
Spotify
api_endpoint_reachable ok

Describe the issue

Unit of measurement is wrong for PV1 and PV2 voltage

It should be V and it is W
Schermafbeelding 2022-01-28 om 18 14 32

Reproduction steps

  1. Update to the latest version on HACS

...

Relevant debug logs

None

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.