Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Emma: Inverter and battery configuration registers unavailable #943

Open
5 tasks done
delefant opened this issue Feb 10, 2025 · 6 comments
Open
5 tasks done
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@delefant
Copy link

Describe the issue

On the inverter with a battery connected, the write-enabled configuration registers of the inverter as well as the configuration and the per-module sensors of the battery entities instantly become unavailable.

On the other inverter without a connected battery, these write enabled registers such as MPPT-Scan On/Off are working.

Both inverters are accessed via modbus-tcp on an EMMA, connected via a Smartguard 63A-T0

Describe your Huawei Solar Setup

Inverter Type: 2 x SUN2000 10k-MAP0
Inverter Firmware version: V200R024C00SPC102
MBUS version: V100R001C00SPC339
Emma firmware version: SmartHEMS V100R024C10SPC100
Smartguard firmware version: V100R024C00SPC101
sDongle present: No
Power meter present: three phase
Optimizers Present: No
Battery: LUNA2000-S1 21kWh
Battery Firmware version: V200R023C10SPC115
Huawei Solar integration version: 1.5.4
Home Assistant version: 2025.2.1

How do you connect to the inverter?

Via the SDongle, wired connection

Upload your Diagnostics File

config_entry-huawei_solar-01JKN80S4DKY3DRAPMPTMSV2KN.json
Drag & Drop your Diagnostics File here.

Upload your relevant debug logs

2025-02-10 18:45:30.794 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 47954 with length 2 from slave 4
2025-02-10 18:45:30.794 DEBUG (MainThread) [pymodbus.logging] send: 0x0 0x25 0x0 0x0 0x0 0x6 0x4 0x3 0xbb 0x52 0x0 0x2
2025-02-10 18:45:30.797 DEBUG (MainThread) [pymodbus.logging] recv: 0x0 0x25 0x0 0x0 0x0 0x3 0x4 0x83 0x3 old_data:  addr=None
2025-02-10 18:45:30.797 DEBUG (MainThread) [pymodbus.logging] Processing: 0x0 0x25 0x0 0x0 0x0 0x3 0x4 0x83 0x3
2025-02-10 18:45:30.797 ERROR (MainThread) [pymodbus.logging] Exception response 131 / 0
2025-02-10 18:45:30.798 DEBUG (MainThread) [pymodbus.logging] Frame advanced, resetting header!!
2025-02-10 18:45:30.798 ERROR (MainThread) [custom_components.huawei_solar] Error fetching BT24A0032021_config_data_update_coordinator data: Could not update BT24A0032021 values: Got error while reading from register 47954 with length 2: ExceptionResponse(dev_id=4, transaction_id=37, address=0, count=0, bits=[], registers=[], status=1)
2025-02-10 18:45:30.798 DEBUG (MainThread) [huawei_solar.bridge] Batch update of the following registers: storage_state_of_capacity, storage_running_status, storage_bus_voltage, storage_bus_current, storage_charge_discharge_power, storage_total_charge, storage_total_discharge, storage_current_day_charge_capacity, storage_current_day_discharge_capacity
2025-02-10 18:45:30.799 DEBUG (MainThread) [huawei_solar.huawei_solar] Sleeping for 0.049070 seconds before making next call

Please confirm the following:

  • I'm running the latest release of Home Assistant.
  • I'm running the latest release of this integration.
  • I did not find an existing issue describing this problem.
  • I did upload the diagnostics-file that I could retrieve from the 'Devices & Services Page'
  • I did upload the relevant debug logs (via 'Enable Debug Logging'-feature or by manually configuring HA logging)
@delefant delefant added the bug Something isn't working label Feb 10, 2025
@wlcrs
Copy link
Owner

wlcrs commented Feb 10, 2025

I have no EMMA device, so I cannot easily debug this.

I need someone to compile me a list of entities which are incompatible with an EMMA device.

Please follow these steps:

  • disable all but one configuration entities of the affected inverter and battery
  • force an entity update with the homeassistant.update_entity action . You can do this in the "Actions" tab of the Developer tools.
  • Check if the entity becomes available again after a few seconds

Continue enabling entities and forcing an update until you see that all the entities become unavailable. If that is the case, add the entity to the list of incompatible entities. Disable the incompatible entity and continue enabling the next entity to check.

Once I receive this list, I will be able to remove those incompatible entities from the integration.

@wlcrs wlcrs added the help wanted Extra attention is needed label Feb 10, 2025
@delefant
Copy link
Author

Thank you for pointing me in this direction.

After disabling the configuration entities and re-enabling them one by one the following two lead to all others becoming unavailable:

  • storage_charge_from_grid_function
  • storage_discharging_cutoff_capacity

I'm not quite sure, if this is a generic problem with the EMMA device itself or its configuration, e.g storage_charge_from_grid_function becoming unavailable if storage_working_mode_settings==adaptive or storage_discharging_cutoff_capacity becoming unavailable as storage_backup_power_state_of_charge takes precedence.

@dragosmd
Copy link

dragosmd commented Feb 14, 2025

@wlcrs Hi again :)
Is one of the errors I've reported from our first tests on Emma.

2025-02-14 21:09:25.229 DEBUG (MainThread) [huawei_solar.bridge] Storage capacity control as it is not supported by slave 123
2025-02-14 21:09:27.156 DEBUG (MainThread) [custom_components.huawei_solar.select] Storage capacity control is not supported by inverter HV2290299408
2025-02-14 21:09:27.860 DEBUG (MainThread) [custom_components.huawei_solar.number] Capacity control not supported on slave HV2290299408. Skipping capacity control number entities
2025-02-14 21:09:36.562 WARNING (SyncWorker_8) [homeassistant.components.huawei_lte] lan_host_info apparently not supported by device, excluding from future updates
2025-02-14 21:12:53.859 WARNING (MainThread) [custom_components.huawei_solar.config_flow] Skipping slave 131 with model SmartSwitch. Only SUN2000 inverters are supported as secondary slaves
2025-02-14 21:12:53.859 WARNING (MainThread) [custom_components.huawei_solar.config_flow] Skipping slave 122 with model SmartGuard-63A-S0. Only SUN2000 inverters are supported as secondary slaves
2025-02-14 21:12:54.164 DEBUG (MainThread) [huawei_solar.bridge] Storage capacity control as it is not supported by slave 123
2025-02-14 21:12:54.327 WARNING (MainThread) [custom_components.huawei_solar.config_flow] Skipping slave 127 with model SmartLoad. Only SUN2000 inverters are supported as secondary slaves
2025-02-14 21:12:54.819 DEBUG (MainThread) [huawei_solar.bridge] Storage capacity control as it is not supported by slave 123
2025-02-14 21:12:54.984 DEBUG (MainThread) [custom_components.huawei_solar.select] Storage capacity control is not supported by inverter HV2290299408
2025-02-14 21:12:55.307 DEBUG (MainThread) [custom_components.huawei_solar.number] Capacity control not supported on slave HV2290299408. Skipping capacity control number entities

2025-02-14 21:17:25.998 DEBUG (MainThread) [huawei_solar.bridge] Storage capacity control as it is not supported by slave 123
2025-02-14 21:17:26.161 DEBUG (MainThread) [custom_components.huawei_solar.select] Storage capacity control is not supported by inverter HV2290299408
2025-02-14 21:17:26.485 DEBUG (MainThread) [custom_components.huawei_solar.number] Capacity control not supported on slave HV2290299408. Skipping capacity control number entities

home-assistant_huawei_solar_2025-02-14T19-18-13.153Z.log

Inverter:
Image
Batteries:

Image
Lastest firmwares, latest integration.

My personal theory this is related to "Elevated permissions", all this entries are usually available with admin rights and since Emma ignores the authenitcation .... entires are detected but unavailable. Just a guess.
@delefant same issues as my pictures?

2025-02-14 21:31:31.033 ERROR (MainThread) [pymodbus.logging] Exception response 131 / 0
2025-02-14 21:31:31.087 ERROR (MainThread) [pymodbus.logging] Exception response 131 / 0
2025-02-14 21:31:31.206 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.emma_rated_ess_capacity (<class 'custom_components.huawei_solar.sensor.HuaweiSolarSensorEntity'>) is using state class 'total_increasing' which is impossible considering device class ('energy_storage') it is using; expected None or one of 'measurement'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/wlcrs/huawei_solar/issues
2025-02-14 21:31:41.726 ERROR (MainThread) [pymodbus.logging] Exception response 131 / 0
2025-02-14 21:31:41.727 ERROR (MainThread) [custom_components.huawei_solar] Error fetching HV2290299408_config_data_update_coordinator data: Could not update HV2290299408 values: Got error while reading from register 47955 with length 1: ExceptionResponse(dev_id=123, transaction_id=27, address=0, count=0, bits=[], registers=[], status=1)

@dragosmd
Copy link

Disabling the following entities in batteries configurstion fixed others:

Image
Allowed be to have access to charge discharge and soc option. Also the inverter power derating option is now available.
Not sure how batteries entries also fix inverter entries.
If I enable any of the options in batteries configuration they move back in unavailable.

@delefant
Copy link
Author

Hi again,
@dragosmd Thanks for your reply.
As far as I can tell, the configuration entries only become available when "Elevated permissions" are set. According to wlcrs/huawei-solar-lib@27dfdb4 EMMA should always have write access, which does seem to be the case, as both the inverter and the subordinate battery do not throw error messages, when changing (available) configuration parameters.

As to why the battery entities influence some inverter entities: I guess a generic check for write permissions may go wrong, when an expected register of the battery is not writable as intended, thus disabling the "write_permission" for the entire device, including the inverter as it is the parent device.

Our errors do not seem to be the same, heres a screenshot from my current (working) battery entities for comparison:

Image

When enabling End-of-discharge SOC and Charge from grid, all configuration entities in the battery and the parent inverter become available, the log showing errors in reading register 47954 or 47955 respectively.

If I am interpreting https://github.com/wlcrs/huawei-solar-lib/blob/bb22046de7554798f37890aa37bc1f6efef633a0/src/huawei_solar/registers.py#L1392 right, the register for "Charge from Grid" should be 47087 (STORAGE_CHARGE_FROM_GRID_FUNCTION), so I´m wondering why I do not get an error containing this register.
I could not find a register for "End-of-discharge SOC", but functionally, 47102 (STORAGE_BACKUP_POWER_STATE_OF_CHARGE) which I assume is used for "Backup Power SOC" seems almost the same.

@dragosmd
Copy link

dragosmd commented Feb 17, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants