Closed r13ssh closed 1 year ago
Can you enable extensive logging as described on the bottom of the README, restart HA and then re-add the integration? Finally download the "Full logs" and upload them here (feel free to filter out any lines unrelated to the integration). This will generate a log showing me all the messages sent/received to/from the inverter and will allow me to diagnose the problem.
@wlcrs I am also experiencing issues with elevated permission operations, my use case is changing battery configuration
I didn't want to raise a new issue - bug as it is more than likely the same as @r13ssh is running into, but let me know if you want me to raise a new one instead
here are the details after enabling extensive logging as you have suggested: -
Inverter Type: SUN2000-6KTL-L1 Inverter Firmware version: V200R001C00SPC124 SDongle present: no Power meter present: single phase Battery: LUNA2000 10kWh Battery Firmware version: V100R002C00SPC116
Via SUN2000-
Diagnostics File:
config_entry-huawei_solar-e698316461e8c0ed05ffbd592187e6c1.json.txt
Same as above, I started with just the regular permissions and tried to get the elevated permissions, but no dice.
Things I have tried:
BUT the weird thing is, when I first tried with "elevated permissions" and wasn't offered the password, I toggled "charge from grid" to off to see if I had the permissions. HA blinked the toggle to off and back to on, and "you don't have permissions for that". Then the following day, I noticed the battery didn't charge from grid overnight (It's winter and dull here). So I tried toggling to "on", and same again, HA said no, but later the switch was indeed toggled to "on".
So the short term workaround, while this bug gets fixed, that I'm going to try is:
(Didn't grab log files yet, running v1.2.1 of the integration, HA 2023.1.7 on a pi. smart dongle running V100R001C00SPC125,
| SUN2000-6KTL-L1 | V200R001C00SPC125 )
I can only diagnose the core issue if I receive the full logs that I asked for in the first reply. I need to understand what your inverter responds while the integration tries to detect if it has write permission on the inverter during the initial setup.
home-assistant_2023-01-28T15-07-45.369Z.log Here are the logs.
Thank you. I see that the inverter gives a valid reply to write requests, but then decides to close the connection. This leads to all kinds of erratic behavior 😕
Do you see the same issue with v1.1.6 of this integration? Can you generate the same logs while testing? This will allow me to compare the messages being sent and the replies received to find what has changed and is causing the issues.
home-assistant_2023-01-28T16-06-53.897Z.log
HACS doesn't let you just downgrade handily, so I removed from HACS and readded 1.1.6
Same thing, elevated permissions doesn't ask you for a password. and it still lets you change the "charge from grid" setting w/o the password.
Thank you for the extra logs. I can confirm that it's normal that you don't have to provide login details: the inverter only requires this when using the Modbus TCP interfaces exposed on the WLAN it's connected to, or when using the inverter WiFi. The integration detects this by doing a "test-write" to the time-zone register.
I've implemented some changes and released them in v1.2.2 . I really hope they improve robustness and correctness for your case (eg. when the write-command reports a success, but the device immediately terminates the Modbus-TCP connection after it).
So the "charge from grid" toggle won't stay toggled in the short term, but later when you go back it's set how you intended. I was trawling the home assistant forums looking for something else and saw you had a comment about backup boxes interfering with the modbus. It may be worth noting that I also have a backup box.
The delay in the "charge from grid" toggle displaying the changed state has been fixed in 1.2.4
I also have this issue. Already upgraded to 1.2.4, no luck. I had added my inverters without elevated permissions, but would now like to enable them to conditionally enable "charge from grid".
Removed and readded the integration (with elevate permission checked) without getting password prompt. I am connected to the Modbus TCP port exposed by my dongle on my home network.
When I try to toggle the battery switch I get this error:
Error executing service: <ServiceCall switch.turn_off (c:01GRVVM429FJP2JH40PDYPTVJ2): entity_id=['switch.battery_charge_from_grid_2']> Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/core.py", line 1805, in catch_exceptions await coro_or_task File "/usr/src/homeassistant/homeassistant/core.py", line 1824, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service await service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 681, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 968, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 721, in _handle_entity_call await result File "/config/custom_components/huawei_solar/switch.py", line 185, in async_turn_off await self.coordinator.async_request_refresh() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 189, in async_request_refresh await self._debounced_refresh.async_call() File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 82, in async_call await task File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 215, in async_refresh await self._async_refresh(log_failures=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 330, in _async_refresh self.async_update_listeners() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 135, in async_update_listeners update_callback() File "/config/custom_components/huawei_solar/sensor.py", line 947, in _handle_coordinator_update self._attr_native_value = len(data) TypeError: object of type 'DecodeError' has no len()
Any ideas? I'd appreciate any help!
Can you please generate more extensive debug logs for that error with this method: https://www.home-assistant.io/docs/configuration/troubleshooting/#debug-logs-and-diagnostics . I want to understand what causes that DecodeError.
Hi, see attached. Please let me know if you need further information. Thanks!
home-assistant_huawei_solar_2023-02-09T20-21-50.003Z.log
Edit: I should add the information that I am using two inverters. The battery is connected to the 10KTL, the dongle is connected to 5KTL.
I'll need to do some thorough analysis on those debug logs. Can you describe your system please? What are the firmware versions?
Sure!
Dongle:
Battery
5KTL
10KTL
Everything seems to work except of changing battery settings and changing Inverter polling frequency.
Have you set your battery to TOU working mode in the past? Can you tell me what the exact configuration is that is currently set for that working mode?
In the FusionSolar app: go to Devices -> Connected devices -> Battery -> three dots in top right corner -> Parameter settings -> working mode.
Can you screenshot the content of that page? Change the working mode to TOU if necessary and screenshot that too. You can then click cancel to abort changing the working mode for real if necessary.
For reference, it should look something like this:
No, I haven't set that working mode. Current working mode is max self consumption. Here are the screenshots:
Changed to TOU, without saving:
Settings:
Can you test my fix by changing the "requirements"
in your /config/custom_components/huawei_solar/manifest.json
to
"requirements": ["huawei-solar==2.2.5b1"],
?
Restart HA and test again please. If you run into problems, please generate new debug logs and include your diagnostics file as well.
After changing the requirement and reboot the integration doesn't start up anymore. This is the error message:
Config entry 'SUN2000-5KTL-M1GIN300-5KTL-M1' for huawei_solar integration not ready yet: Could not update HV21<redacted> values: Invalid model to decode TOU Registers for: 0; Retrying in background
Here are the logs:
Can you try again with 2.2.5b2?
Please also include the diagnostics file if you are still having problems.
It works! Thank you very much for your effort. :-)
Describe the issue
Hi,
I ran into a similar issue as discussed in https://github.com/wlcrs/huawei_solar/discussions/190, where originally I had added my inverter(s) without elevated permissions, but would now like to enable them.
Following the suggestions in https://github.com/wlcrs/huawei_solar/discussions/190#discussioncomment-4241862 I tried to remove and reinstall the ingetration, but - while I could re-add the inverters no problem, with the history retained - I was not prompted for the installer password, and I do not seem to have elevated permissions.
Did I do something wrong?
Bescribe your Huawei Solar Setup
Inverter Type: SUN2000-5KTL-L1 (master), SUN2000-4KTL-L1 (slave) Inverter Firmware version: SDongle present: yes Power meter present: single phase Battery: None Battery Firmware version: n/a
How do you connect to the inverter?
Via the SDongle, wireless connection
Upload your Diagnostics File
Diagnostics File (before reinstall):
config_entry-huawei_solar-6bc38b13c42dd33e898c51bf2e025c08.json.txt
Diagnostics File (after reinstall): config_entry-huawei_solar-28a773df6e4f2ca6279ac53f82103d62.json.txt
Upload your relevant debug logs
Please confirm the following: