core
core copied to clipboard
Integration Kostal Plenticore Solar Inverter
The problem
Seems, that G2 Inverter are not supported. Adding the inverter via IP / password ends with an unexpected error.
Kostal Plenticore Plus 8.5 G2 SW-Version 02.06.09313 MC-Version 02.06.2080 IOC-Version 02.06.0441
2023-03-19 14:35:09.170 ERROR (MainThread) [homeassistant.components.kostal_plenticore.config_flow] Unexpected exception Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/kostal_plenticore/config_flow.py", line 54, in async_step_user hostname = await test_connection(self.hass, user_input) File "/usr/src/homeassistant/homeassistant/components/kostal_plenticore/config_flow.py", line 35, in test_connection values = await client.get_setting_values("scb:network", "Hostname") File "/usr/local/lib/python3.10/site-packages/pykoplenti/init.py", line 564, in _wrapper return await fn(self, *args, **kwargs) File "/usr/local/lib/python3.10/site-packages/pykoplenti/init.py", line 760, in get_setting_values return {module_id: {data_response[0]["id"]: data_response[0]["value"]}} IndexError: list index out of range
What version of Home Assistant Core has the issue?
2023.3.5
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Kostal Plenticore Solar Inverter
Link to integration documentation on our website
No response
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response
Hey there @stegm, mind taking a look at this issue as it has been labeled with an integration (kostal_plenticore) you are listed as a code owner for? Thanks!
Code owner commands
Code owners of kostal_plenticore can trigger bot actions by commenting:
@home-assistant closeCloses the issue.@home-assistant rename Awesome new titleRenames the issue.@home-assistant reopenReopen the issue.@home-assistant unassign kostal_plenticoreRemoves the current integration label and assignees on the issue, add the integration domain after the command.
(message by CodeOwnersMention)
kostal_plenticore documentation kostal_plenticore source (message by IssueLinks)
@nowairly
Maybe i'm facing the same issue. I have two Plenticore, one of them is G1 and the the second is G2.
G1 is already in HA and i'm not able to add the second one.
SW-Version 2.06.09313
MC-Version 02.06.2080
IOC-Version 02.06.0441
HW-Version 0106
@deadrabbit87 Same for me, the G1 works fine, G2 is not possible to add.
I get the same error and have a Plenticore plus 10 G2.
Is the correct way to make changes to the code and run it to add the files in the repo under /config/custom_components/kostal_plenticore ?
I have looked a little at this now and it seems the names of settings and data sources has changed. I made a test as per the example in the pykoplenti github repo and used the code from this integration and got the same error. When I changed line 35 in config_flow.py from:
values = await client.get_setting_values("scb:network", "Hostname")
to:
values = await client.get_setting_values("scb:network", "Network:Hostname")
it worked
Attaching output of all-settings and all-processdata. all-processdata-G2.txt all-settings-G2.txt
Is the correct way to make changes to the code and run it to add the files in the repo under /config/custom_components/kostal_plenticore ?
Sorry, i didn't know that, but your plan sounds not wrong.
Great that you have found the issue.
BW
I made the changes to get G2 working here: https://github.com/erikbadman/core/tree/kostal-plenticore-g2
I have tested this in my home assistant installation and I can now configure the the integration and get data in to HA. Used this information to add the changes locally: https://developers.home-assistant.io/docs/development_tips#test-core-integration-changes-in-your-production-home-assistant-environment
This will of course make G1 stop working, just made this to get my G2 working for now quickly.
Just installed your changed file @erikbadman, it works as described :-) G2 is running now, G1 not. Thank you, for your effort! As far as I understood, this solution overrides the core integration with the custom. Is there a way, to use both integrations?
@nowairly Yes it overrides the core integration, I think you should be able to use both if you change the name of the custom one. Maybe this could work https://developers.home-assistant.io/blog/2019/04/12/new-integration-structure/
@erikbadman
Could you please have a look on this issue also?
https://github.com/home-assistant/core/issues/87611
I can't add my kostal plenticore g2 to home assistant either.
As workaround it is possible to override the core integration with the fix of Erikbadman - for a "G2 only" setup.
For the case of a mixed setup with G1 and G2 you can use the fix of Erikbadman to build a custom integration for the G2 inverter. The core integration can be still used for the G1 in this case.
The client also contains a method get_settings which returns all available setting ids. Maybe a better way would be to read these ids first and then chose either "Hostname" or "Network:Hostname" depending on which id is available.
Some of the ids are also used in the Plenticoreclass in module helper.py.
I have looked a little at this now and it seems the names of settings and data sources has changed. I made a test as per the example in the pykoplenti github repo and used the code from this integration and got the same error. When I changed line 35 in config_flow.py from:
values = await client.get_setting_values("scb:network", "Hostname")to:values = await client.get_setting_values("scb:network", "Network:Hostname")it worked
Does anyone know if the core will be changed by official update in the near future?
Same problem here with a (only G2) plenticore setup. And I also hope for the official update ;-)
Same as me. Official Update would be awesome!
@erikbadman Did you create a pull request?
@Th0tti I haven't since it's not a proper fix. I will try do to that this weekend if I can find the time
Excellent. Thanks very much. As a solution, there could be a drop-down menu when querying the host, or a second integration with G2 inverters could be added.
@stegm I have added a check as you suggested and created a PR for this (https://github.com/home-assistant/core/pull/92198)
I have tested it locally and it works with my G2 hardware
Nice.
@stegm I have added a check as you suggested and created a PR for this (#92198)
I have tested it locally and it works with my G2 hardware
Thank you for contributing. I reviewed your changes, please take a look at it.
@stegm When do you think the update will be released. Version 2023.5?
@stegm When do you think the update will be released. Version 2023.5?
I have no influence of that apart helping reviewing the changes.