Hi all,
I am really desperate since some hours, since my entire Energy dashboard has fallen apart and is showing bogus numbers after the activation of the BYD battery in my Kostal inverter.
Let me try to describe the situation:
The solar roof is working since early December, but the two-way meter and the battery were only installed today.
I have a Kostal Plenticore inverter, and I have a Kostal Smart Energy Meter (KSEM) installed. Both are connected through a direct connection (Modbus?), and both are separately accessible in my LAN.
Until yesterday, everything was working fine. I have switched of the inverter after sunset since the workers wanted to come early.
I now wanted to re-configure the Energy Dashboard, but all the charts do not make sense anymore.
Up to now, I was using those sensors:
plenticore_Home Consumption from Grid Total
plenticore_Energy Yield Total
netzeinspeisung_energie_ksem (from configuration.yaml: modbus configuration for the KSEM gear)
I now have several findings, that I do not understand in the Energy dashboard:
Which are the appropriate sensors for the power from the grid and the discharge to the grid?
Do I have to configure my home consumption with a series of individual sensors from the Plenticore inverter? (home_consumption_from_grid, home_consumption_from_battery and home_consumption_from_pv?)
Is the battery charging part of the solar yield that I harvest from my roof? – My inverter has a higher yield in its display than HA. I am calculation numbers back & forth, and the data does not match.
What is the difference between plenticore_Energy Yield Total and plenticore_Energy PV1_Total? – I was assuming that Energy_Yield_Total would be the sum of my strings PV1 and PV2, but this again does not match.
Finally: Do I have to restart HA to rebuild the dashboard with different sensors? – I do assume that I do not completely screw up my data, since the sensors are (hopefully) stored separately. Or can I break my data with trial & error?
I have now taken the battery out of the configuration, and only use the KSEM measures, which is positioned between the official meter and my house installation. This cannot be worng.
Et voila, now the numbers are correct:
no triple-counting anymore
power consumption in the expected range
Downside: I see the supply from battery as “solar power”.
Is this correct for DC-installed batteries?
I’ve come in to post a similar issue, that I’m have had with my Growatt system + battery setup. Like yours I’m getting duplicate values, as the system shows the ‘consumption’ as a total that includes power drawn from the battery and then I get the discharge value added to the total for that hour. So the Energy dashboard needs to remove the battery discharge amount from the consumption amount to generate the ‘total’ usage for that period + costs.
I too am wondering how people are getting the correct values when using all data points, input, output, solar & battery.
I am glad that I am not alone. But the Kostal integration is widely used, I really cannot imagine that all others do not have a battery.
What I realize from playing around: The “home consumption” seems to be calculated. When I add more sensors to the “solar” section whilst keeping the discharge to grid, the home consumption goes up.
And all those calculations never match what my inverter is calculating.
But it is tricky to do the debugging since everything is floating and the dashboard is static. I always look at this short after the top of the hour.
Hi! I have Plenticore plus 10, KSEM and BYD 13.8KWH HVM. Kostel Plenticore Plus 10 has native integration with HA and provides almost all sensors natively.
Heres what i’ve set up for myself.
As i want to have exact power consumption and feed in, so by phase ive set up KSEM in configuration.yaml
For grid consumption i have “Energy IN KSEM” which is a meter based on L1+L2+L3 IN sum and for return to grid i have “Energy OUT KSEM” which is a meter for L1+L2+L3 OUT, i used helper for it, naming the sums as “IN” and “OUT”. I want to measure across phases, as i get charged by phase (so if i have load that exceeds my solar or battery output on one phase i get charged for it).
Then i used helper again, using " Add Riemann sum integral sensor" with both “IN” and “OUT” separately, naming it “IN energy” and “OUT energy” (for riemann settings i used “left”, metric prefix “k” and unit of time “H”). Now you have kWh.
Then i used helper again for utility meter, creating “Energy IN KSEM” with “IN energy” and “Energy OUT KSEM” with “OUT energy”.
For solar input i used Kostal Plenticore integration and “_energy_pv1_total” and “_energy_pv2_total”.
For battery input i used Kostal Plenticore integration and “_battery_charge_from_PV” and “_home_consumption_from_PV”.
If anyone has any ideas as to how it would be possible to force Plenticore 10 with BYD HVM to charge for automation in home assistant, then i’d gladly take any input on this.
I’ve resolved this issue for myself. It turns out that although register 1034 accepts positive values (forced discharging) as absolute ( so 1-3500 written will correspond to 1-3500W of forced discharge from battery in my case, as it’s BYD HVM13.8 max discharge) it wants negative values (forced charging of battery) to be defined as percentages of battery specific maximum charge.
So if anyone wants to charge BYD HVM 13.8 at anything between 1-100% you have to first multiply it by 100 and then convert.
For each value:
Convert the desired float value to IEEE 754 float32 binary representation.
Extract the two 16-bit words from the 32-bit representation.
Convert those 16-bit values to decimal.
Example:
10% For -1000 : Hex: c4800000
Words: c480 and 0000
Decimal: 50240 and 0
100% For -10000 : Hex: c5600000
Words: c560 and 0000
Decimal: 50528 and 0
and to make everyones, including future me, life easier:
(save these each as a separate script that you can run manually to test)
Hello, I have a question about the Home Battery Storage section of the dashboard, specifically regarding “_battery_charge_from_PV”. It could be that the battery is not charged from PV but from the grid. This will not be included and shown as house used energy, right?
btw your manual for conversion works perfectly on chatgpt, thanks for that
For each value:
Convert the desired float value to IEEE 754 float32 binary representation.
Extract the two 16-bit words from the 32-bit representation.
Convert those 16-bit values to decimal.
Anyhow, if you set like -10000 on absolute charge power it is literally 10kW, but the Kostal Plenticore seems to have a safety feature to only use the maximum possible load power for your set up.
second: for -10000 I get following result:
The two 16-bit binary values for −10000 converted to decimal are:
First 16-bit word (1100011000011100): 50716
Second 16-bit word (0100000000000000): 16384
I tried your solution, too and was kinda bound to maximum charge power of 3500W, Now it goes up to 9000W as it should in my setup.
3500W as maximum was in my configuration due to my setup having it’s own limitation (BYD HVM13.8 with Plenticore10) - it allowed for maximum of 3500W charge and discharge.
Can you explain me this part? My Riemann sum integral sensor helper for IN energy works fine and gives me the correct data.
But with the last one, I get strange values.
Is it possible, that this depends on what kind of Endian you have configured ? In my case the Big Endian Sunspec configuration is definitely not working properly…