Closed Evka2k closed 1 month ago
I'm having the same problem on my Growatt SPH8000 but unfortunately your fix didn't work for me.
Now I get:
File "/config/custom_components/solax_modbus/config_flow.py", line 193, in _next_step_battery if "support-battery" not in user_input.keys(): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ KeyError: 'support-battery'
It seems to trip over the first support-battery it encounters.
Same for me with a Solax Inverter. Updated to latest version and lost battery level. Therefore I deinstalled the complete integration, rebooted HA and tried to install again - with the same arror as above. Will try the fix now.
File "/config/custom_components/solax_modbus/config_flow.py", line 193, in _next_step_battery if user_input["support-battery"]:
KeyError: 'support-battery'
Fix doesn't help for me, same as Beunhaaz reported
Got it up and running for me with this hack:
user_input["support-battery"] = true # plugin.plugin_instance.BATTERY_CONFIG is not None
This of course is only valid inverter supports a battery
After getting the fix up and running I'm missing some entities:
sensor.solax_battery_input_energy_total sensor.solax_battery_output_energy_total sensor.solax.grid_status
Please make them also available again. Especially the total energies are crucial for the energy dashboard to work.
X3-Hybrid von SolaX Power Firmware: DSP v1.29 ARM v1.31 Hardware: Gen4
Untested but a suggestion to try:
at "/config/custom_components/solax_modbus/config_flow.py", line 193, in _next_step_battery
replace
if user_input["support-battery"]:
With
if user_input.get("support-battery", False):
Latest version is working for me. Missing entities have been found, are disabled by default.
Can this be closed down now?
Closing down as no further response. If there are still issues either reopen or raise a new issue.
Just wanted to let you know that the issue is not fixed in the latest version.
When looking at the code, I can see that the "support-battery" setting is only set up in the _validate_host
function (which is only called when setting up the connection via TCP). When setting up an inverter-connection via serial, the variable is never set, so it should always fail at the next step.
The change that @siebeclaes suggested should be applied to master in my opinion to fix this.
Opened a PR now with this change: https://github.com/wills106/homeassistant-solax-modbus/pull/1054
Describe the bug
Add integration -> Select Interface:Serial, Inverter type: growatt or any other -> Serial Interface Parameters: Submit
Integration Version
2024.07.0b3
Homeassistant core version
2024.7.3
Inverter brand
growatt
Plugin used
plugin_growatt.py
Serial prefix
113.02
Connection Method
RS485-USB
Detailed Error Log
crash.log
Additional context
This fix prevents from crash.