ittv-tools / homeassistant-kostalplenticore Goto Github PK
View Code? Open in Web Editor NEWHome Assistant Component for Kostal Plenticore
License: MIT License
Home Assistant Component for Kostal Plenticore
License: MIT License
Hi.
Thank you for creating this integration. Makes my life a bit easier.
Would it be possible for you to add the following sensors?
Thanks,
Michiel
My configuration stopped working I think a few days ago.
Config:
sensor:
- platform: kostal_plenticore
host: 192.168.178.53
password: !secret kostal_password
monitored_conditions:
- HomeGridPower
- HomeOwnPower
- HomePVPower
- GridPower
- DCPower
- PVPower
- AutarkyDay
- AutarkyMonth
- AutarkyTotal
- AutarkyYear
- CO2SavingDay
- CO2SavingMonth
- CO2SavingTotal
- CO2SavingYear
- PV1Power
- PV1Voltage
- PV1Current
- ACFrequency
- ACL1Current
- ACL1Power
- ACL1Voltage
- ACL2Current
- ACL2Power
- ACL2Voltage
- ACL3Current
- ACL3Power
- ACL3Voltage
- HomeConsumptionDay
- HomeConsumptionMonth
- HomeConsumptionTotal
- HomeConsumptionYear
- HomeConsumptionFromGridDay
- HomeConsumptionFromGridMonth
- HomeConsumptionFromGridTotal
- HomeConsumptionFromGridYear
- HomeConsumptionFromPVDay
- HomeConsumptionFromPVMonth
- HomeConsumptionFromPVTotal
- HomeConsumptionFromPVYear
- HomeConsumptionYieldDay
- HomeConsumptionYieldMonth
- HomeConsumptionYieldTotal
- HomeConsumptionYieldYear
- OwnConsumptionRateDay
- OwnConsumptionRateMonth
- OwnConsumptionRateTotal
- OwnConsumptionRateYear
Error message:
2020-12-22 00:16:53 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up kostal_plenticore platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 199, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/kostal_plenticore/sensor.py", line 483, in setup_platform
plenticore(
File "/config/custom_components/kostal_plenticore/sensor.py", line 563, in __init__
value = self.getData()
File "/config/custom_components/kostal_plenticore/sensor.py", line 514, in getData
value = pv1 + pv2
TypeError: can only concatenate str (not "int") to str
This line looks a little suspicous to me. If only one of both values is in error state then it always looks like a concatenation of an int with a string. I don't understand what's going on there, though...
Hi there,
would you be so kind an help me with this.
- platform: kostal_plenticore
host: 192.168.1.xxx
password: xxxxxxxx
monitored_conditions:
- BatteryPercent
- BatteryCycles
- BatteryPower
- HomeGridPower
- HomeOwnPower
- HomePVPower
- HomeBatteryPower
- GridPower
- PVPower
- AutarkyDay
- AutarkyMonth
- AutarkyTotal
- AutarkyYear
- CO2SavingDay
- CO2SavingMonth
- CO2SavingTotal
- CO2SavingYear
and received following:
2020-03-22 11:59:58 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up kostal_plenticore platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 179, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
return fut.result()
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/kostal_plenticore/sensor.py", line 158, in setup_platform
SENSOR_TYPES[sensor][4],
File "/config/custom_components/kostal_plenticore/sensor.py", line 175, in __init__
self._state = int(self.api.getProcessdata(self.moduleid, [self.id])[0]["value"])
IndexError: list index out of range
2020-03-22 12:00:09 WARNING (MainThread) [homeassistant.setup] Setup of default_config is taking over 10 seconds.
Any help appreciated.
br
Hello,
I know that this integration is no longer maintained. Meanwhile Home Assistant has an own integration for Kostal Plenticore inverter. Check out https://www.home-assistant.io/integrations/kostal_plenticore/.
Nevertheless since I am assuming that the name of all related entities will change I am not ready to move the HA integration yet.
To get this integration working again with HA 2021.8.x version the following changes in the file const.py of the integration are required:
Change all occurences of ELECTRICAL_CURRENT_AMPERE to ELECTRIC_CURRENT_AMPERE
Change all occurences of VOLT to ELECTRIC_POTENTIAL_VOLT
Restart Home Assistant and it should work again
$ diff const.py /etc/homeassistant/custom_components/kostal_plenticore/const.py
9,10c9,10
< ELECTRICAL_CURRENT_AMPERE,
< VOLT,
---
> ELECTRIC_CURRENT_AMPERE,
> ELECTRIC_POTENTIAL_VOLT,
86c86
< VOLT,
---
> ELECTRIC_POTENTIAL_VOLT,
93c93
< ELECTRICAL_CURRENT_AMPERE,
---
> ELECTRIC_CURRENT_AMPERE,
317c317
< ELECTRICAL_CURRENT_AMPERE,
---
> ELECTRIC_CURRENT_AMPERE,
331c331
< VOLT,
---
> ELECTRIC_POTENTIAL_VOLT,
338c338
< ELECTRICAL_CURRENT_AMPERE,
---
> ELECTRIC_CURRENT_AMPERE,
352c352
< VOLT,
---
> ELECTRIC_POTENTIAL_VOLT,
359c359
< ELECTRICAL_CURRENT_AMPERE,
---
> ELECTRIC_CURRENT_AMPERE,
373c373
< VOLT,
---
> ELECTRIC_POTENTIAL_VOLT,
474c474
< VOLT,
---
> ELECTRIC_POTENTIAL_VOLT,
481c481
< ELECTRICAL_CURRENT_AMPERE,
---
> ELECTRIC_CURRENT_AMPERE,
498c498
< VOLT,
---
> ELECTRIC_POTENTIAL_VOLT,
505c505
< ELECTRICAL_CURRENT_AMPERE,
---
> ELECTRIC_CURRENT_AMPERE,
Best Regards
Matthias
PS: It seem that one is able to edit the const.py in this repository, but I am not an experienced enough user to create a new release (if this would be possible at all)
Hi. I have a setup where i connect to two different Kostal Plenticore Inverters. As such - it works just fint. But it seems to mix up the data from the inverters upon restart of the Home Assistant Server. Some values then suddenly change places from one inverter to the other. For instance the value of "sensor.kostal_home_power_from_battery_2" and "sensor.kostal_home_power_from_battery" switch places. If what im writing makes no sense - please ask me for clarification.
This error message appears when I check the configuration:
Platform error sensor.kostal_plenticore - cannot import name 'PERCENTAGE' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)
I have looked for the specified const.py, but there is no such directory or file. What do I have to change?
Let me first thank everyone involved for this wonderful plugin.
I'm using a Kostal Plenticore in combination with a BYD HVM battery. In addition I have two electric cars, that charge at night. As I have a electricity contract with high and low tariff times, I would like to spare some energy of the battery during the night to have enough left for the high tariff time in the morning (and avoid that the charging cars empty the battery).
Right now I achieve this by manually setting the minimal SOC to 30 % in the webif (in the evening) and setting it back to 5 % in the morning.
I know from the Plenticore implementation for fhem (https://wiki.fhem.de/wiki/Kostal_Plenticore_10_Plus) that this "Battery_MinSoc" could be set using the web "api".
As far as I understand is homeassistant-kostalplenticore using the same "api".
I would love to have this function in home assistant, too. Is there any way this could be added?
Sadly, I'm a total noob regarding coding. But I could be of some help for testing or providing access to my actual installation.
BR
Markus
I've seen that you just published a new version (hopefully as compatibility for the Energy section). Can i still use that custom integration in favor of the ingrated one?
HA is giving the following heads-up warning:
Source: loader.py:786
First occurred: 13:43:31 (2 occurrences)
Last logged: 13:43:43
No 'version' key in the manifest file for custom integration 'kostal_plenticore'. As of Home Assistant 2021.6, this integration will no longer be loaded. Please report this to the maintainer of 'kostal_plenticore'
I am sure this is known and addressed already, but just to be on the safe side... :-)
Hi,
it seems that the daily PV yield is not the actual gross panel yield at any given point, but only minus what went into the battery so far. So it seems I have no figure to provide the daily yield after sunset, and if the battery lasts over midnight I can also not precisely read that figure for the day. I could do some approx. computation from SoC and known total capacity, but this would just be an estimation then. On the other hand, the standard Kostal app does show such a figure. Not sure whether they do such kind of a computation or whether there is a „gross yield“ figure available from the inverter, which you just don‘t expose?
Thanks, habitoti
Hello,
I'm trying to use your HACS kostal_plenticore integration for my Lostal Piko IQ inverter but it does not work. Could you please give me a little help ?
My web interface is the same or very similar to the Plenticore.
Here is my config :
Here is the log errors :
Logger: homeassistant.config
Source: config.py:424
First occurred: 9:39:37 (1 occurrences)
Last logged: 9:39:37
Invalid config for [sensor.kostal_plenticore]: value must be one of ['ACFrequency', 'ACL1Current', 'ACL1Power', 'ACL1Voltage', 'ACL2Current', 'ACL2Power', 'ACL2Voltage', 'ACL3Current', 'ACL3Power', 'ACL3Voltage', 'AutarkyDay', 'AutarkyMonth', 'AutarkyTotal', 'AutarkyYear', 'BatteryCycles', 'BatteryPercent', 'BatteryPower', 'CO2SavingDay', 'CO2SavingMonth', 'CO2SavingTotal', 'CO2SavingYear', 'DCPower', 'GridPower', 'HomeBatteryPower', 'HomeConsumptionDay', 'HomeConsumptionFromBatDay', 'HomeConsumptionFromBatMonth', 'HomeConsumptionFromBatTotal', 'HomeConsumptionFromBatYear', 'HomeConsumptionFromGridDay', 'HomeConsumptionFromGridMonth', 'HomeConsumptionFromGridTotal', 'HomeConsumptionFromGridYear', 'HomeConsumptionFromPVDay', 'HomeConsumptionFromPVMonth', 'HomeConsumptionFromPVTotal', 'HomeConsumptionFromPVYear', 'HomeConsumptionMonth', 'HomeConsumptionTotal', 'HomeConsumptionYear', 'HomeConsumptionYieldDay', 'HomeConsumptionYieldMonth', 'HomeConsumptionYieldTotal', 'HomeConsumptionYieldYear', 'HomeGridPower', 'HomeOwnPower', 'HomePVPower', 'InverterState', 'LimitEvuAbs', 'MinSoC', 'OwnConsumptionRateDay', 'OwnConsumptionRateMonth', 'OwnConsumptionRateTotal', 'OwnConsumptionRateYear', 'PV1Current', 'PV1Power', 'PV1Voltage', 'PV2Current', 'PV2Power', 'PV2Voltage', 'PV3Current', 'PV3Power', 'PV3Voltage', 'PVPower', 'SmartBatteryControl'] @ data['monitored_conditions'][62]. Got 'SerialNumber' value must be one of ['ACFrequency', 'ACL1Current', 'ACL1Power', 'ACL1Voltage', 'ACL2Current', 'ACL2Power', 'ACL2Voltage', 'ACL3Current', 'ACL3Power', 'ACL3Voltage', 'AutarkyDay', 'AutarkyMonth', 'AutarkyTotal', 'AutarkyYear', 'BatteryCycles', 'BatteryPercent', 'BatteryPower', 'CO2SavingDay', 'CO2SavingMonth', 'CO2SavingTotal', 'CO2SavingYear', 'DCPower', 'GridPower', 'HomeBatteryPower', 'HomeConsumptionDay', 'HomeConsumptionFromBatDay', 'HomeConsumptionFromBatMonth', 'HomeConsumptionFromBatTotal', 'HomeConsumptionFromBatYear', 'HomeConsumptionFromGridDay', 'HomeConsumptionFromGridMonth', 'HomeConsumptionFromGridTotal', 'HomeConsumptionFromGridYear', 'HomeConsumptionFromPVDay', 'HomeConsumptionFromPVMonth', 'HomeConsumptionFromPVTotal', 'HomeConsumptionFromPVYear', 'HomeConsumptionMonth', 'HomeConsumptionTotal', 'HomeConsumptionYear', 'HomeConsumptionYieldDay', 'HomeConsumptionYieldMonth', 'HomeConsumptionYieldTotal', 'HomeConsumptionYieldYear', 'HomeGridPower', 'HomeOwnPower', 'HomePVPower', 'InverterState', 'LimitEvuAbs', 'MinSoC', 'OwnConsumptionRateDay', 'OwnConsumptionRateMonth', 'OwnConsumptionRateTotal', 'OwnConsumptionRateYear', 'PV1Current', 'PV1Power', 'PV1Voltage', 'PV2Current', 'PV2Power', 'PV2Voltage', 'PV3Current', 'PV3Power', 'PV3Voltage', 'PVPower', 'SmartBatteryControl'] @ data['monitored_conditions'][63]. Got 'ArticleNumber' value must be one of ['ACFrequency', 'ACL1Current', 'ACL1Power', 'ACL1Voltage', 'ACL2Current', 'ACL2Power', 'ACL2Voltage', 'ACL3Current', 'ACL3Power', 'ACL3Voltage', 'AutarkyDay', 'AutarkyMonth', 'AutarkyTotal', 'AutarkyYear', 'BatteryCycles', 'BatteryPercent', 'BatteryPower', 'CO2SavingDay', 'CO2SavingMonth', 'CO2SavingTotal', 'CO2SavingYear', 'DCPower', 'GridPower', 'HomeBatteryPower', 'HomeConsumptionDay', 'HomeConsumptionFromBatDay', 'HomeConsumptionFromBatMonth', 'HomeConsumptionFromBatTotal', 'HomeConsumptionFromBatYear', 'HomeConsumptionFromGridDay', 'HomeConsumptionFromGridMonth', 'HomeConsumptionFromGridTotal', 'HomeConsumptionFromGridYear', 'HomeConsumptionFromPVDay', 'HomeConsumptionFromPVMonth', 'HomeConsumptionFromPVTotal', 'HomeConsumptionFromPVYear', 'HomeConsumptionMonth', 'HomeConsumptionTotal', 'HomeConsumptionYear', 'HomeConsumptionYieldDay', 'HomeConsumptionYieldMonth', 'HomeConsumptionYieldTotal', 'HomeConsumptionYieldYear', 'HomeGridPower', 'HomeOwnPower', 'HomePVPower', 'InverterState', 'LimitEvuAbs', 'MinSoC', 'OwnConsumptionRateDay', 'OwnConsumptionRateMonth', 'OwnConsumptionRateTotal', 'OwnConsumptionRateYear', 'PV1Current', 'PV1Power', 'PV1Voltage', 'PV2Current', 'PV2Power', 'PV2Voltage', 'PV3Current', 'PV3Power', 'PV3Voltage', 'PVPower', 'SmartBatteryControl'] @ data['monitored_conditions'][64]. Got 'ProductName'. (See /config/configuration.yaml, line 118). Please check the docs at https://www.home-assistant.io/integrations/kostalplenticore/
Many thanks for your help.
It would be nice to make the actual sw Version number visual. Since there is the autoupdate this makes sense.
As already discussed I'll take a look into it.
It might be necassary to perform some little changes in the underlying kostalplenticore library
Hello,
According the MODBUS manual from Kostal, there are some more addresses available. Is it possible, to integrate some of them as well ?
56: Inverter state
122: Power limit from EVU
???: Power to grid (Einspeisung in Watt) ? If there is no such address, is it possible to calculate it and allocate it to a sensor ?
That would be great.
Thank you
Markus
The Costal Plenticore Plus Models have 3 inputs (pv1, pv2, pv3) whereas the 3rd one may be used for battery instead of input. Bit in my case I use all 3 ports for solar input (3-MPPT). Is there by chance a way to get the 3rd one?
Essentially the following monitored options are missing:
PV3Power
PV3Voltage
PV3Current
There should also be an option in your configuration which decides how to handle PV3.
(Parallel to host/password)
Sth. like "battery_on_pv3: true/false"
(The default value should be false, since it requires a license activation to enable PV3 for battery within the Plenticore)
Your PVPower calculation should then be changed to:
"PVPower": ["pv1+2+3", "P", "Kostal pv power", POWER_WATT, "mdi:solar-power"],
Whereas the calculation should look like
if self.moduleid == "pv1+2+3":
try:
pv1 = int(
self.api.getProcessdata("devices:local:pv1", [self.id])[0]["value"]
)
except:
pv1 = "error"
try:
pv2 = int(
self.api.getProcessdata("devices:local:pv2", [self.id])[0]["value"]
)
except:
pv2 = "error"
try:
pv3 = int(
self.api.getProcessdata("devices:local:pv3", [self.id])[0]["value"]
)
except:
pv3 = battery_on_pv3 ? 0 : "error"
if(pv1 != "error" and pv2 != "error" and pv3 != "error"):
value = pv1 + pv2 +pv3
else:
value= "error"
Feel free to contact me in case of any question.
Kind regards
Sascha Sander
Hi there ITTV,
Once again thank you for your work on this project, appreciate it.
Unfortunately the new added sensor do not work for me. As i have no Power Meter installed i do not get any consumption values from the statistic page.
The only values displayed are as found in screenshot below. I have tried all of the new sensors for consumption but none of it reply a value, always 0.
Do you see a way to make these values available as sensor? PVProductionDay e.g.?
Another thing,
I think i found small problem with PVPower and DCPower.
In my understanding PV Power should be the genarated Power on AC side and therefore always a little lower than DCPower.
And DCPower the summarized value of each Input (PV1Power+PV2Power)
I compared values from PV and DC Power with the one i see on Kostal GUI:
And this is what sensors in HA report me:
It looks PV and DC Power report the same values.
Please share your thoughts.
Thank you.
br mole
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.