-
Notifications
You must be signed in to change notification settings - Fork 33
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
readout data not correct? #28
Comments
Have you tried using only If you're a factor 10 off, it sounds like you aren't applying the scaling factor to the |
Please try |
my first guess is, that the data directly read out with example.py is correct. however i do not understand the powerfactor entries. here the print data from example.py. Shouldnt the powefactor be between -1 and 1? Seems like example_influxdb.py produces the error for me. maybe it has something to do with the calculations inside. Attached a screenshot from the influxdb data. |
Those values are correct. Power factor is a percentage, and with the scaling factor applied they become 36.30, 92.19 and 43.59 %. The scaling of meter values is not being done correctly, however. Please try the new |
the inverter.power_ac data seems reasonable now i could not find any deviation to the API Data. Meter.power should be total power used right? (Selfconsumption +import?) My first guess would be that meter.selfconsumption and meter.power are switched! |
after another day of read outs i think i found the problem. meter_values["power_selfconsumption"] = inverter_power_ac - meter_power "power_selfconsumption" from my understanding should be the Power the inverter produces and is directly used. Excess Power is going to the grid. (inverter_power_ac - meter_power) however, to my understanding should be Total Consumption (Selfconsumption + import from grid) So my fix would be add this line: meter_values["power_selfconsumption"] = min(inverter_power_ac, (inverter_power_ac - meter_power ))** i just started programing with python only 2 weeks ago. So please excuse any rookie mistakes. |
Thanks for letting me know the values look better now. Regarding the self consumption and import/export calculations: I've removed them from the example script. The calculations were wrong and they shouldn't have been in there to begin with. Properly computing the values depends on the topology of the meter(s), and other complicating factors such as the presence of batteries. I will leave this up to the user to implement in either the Python glue, or presentation layer. In the following example the kWh meter is installed in such a way that importing power is reported as positive meter power, while excess power is reported as negative. Self consumption is equal to your Translated roughly to python that will work in
|
@nmakel and @Deepdiigger: I don't want to open a new issue for this because I basically have the same problem that @Deepdiigger had (at least in the beginning). I'm looking for the actual energy production in kWh of the SolarEdge PV modules. This is the output of
I couldn't figure out which of these power values refer to the current energy production, so I waited until it is pitch dark here (half past midnight) and the API shows 0 kWh in the monitoring web interface. However, none of the above values is zero (or at least near zero). During the day I also couldn't get closer than a few hundred Wh to what the API says. Also, total energy in the web interface is 4.91 kWh and here it is 5.71 kWh. As I can't say for sure that the API values are 100% correct, I wouldn't mind a bit of a difference, but a factor of 10-20% is a bit too much. Do you have any idea what is wrong here? |
And for comparison, this is the output at 7:30am with sunshine on a clear-blue sky where the API currently reports 0.7kWh:
Except for total power (which the API reports at 6.18kWh), the values are even lower (such as DC Power) - how is that possible? |
Would you mind posting the output of |
Sure, here you go (I named examply.py modbus.py, but it's one and the same script):
|
Current PV production is around 1.9kW and total power consumption in the house around 2.3kW. power_dc and/or power_ac seem to reflect that, also before when the washing machine was not running and consumption was around 0.2kW. |
The values you just posted seem entirely reasonable, or am I missing something? |
Thanks for your quick reply, yes, the power consumption values are reasonable, but there is no parameter which reflects the actual PV production (1.9 kW at this point in time). power_ac and power_dc are the power consumption, that is why it is around 0.2kW at half past midnight. Or have I overseen some kind of conversion that will get me to 1.9kW somehow? |
In your latest post the PV installation is producing at 2.27kW AC, 2.3kW DC. This matches the current and voltage values. Those values are production, not consumption. Consumption is calculated server side by SolarEdge. |
Sorry if I'm a bit slow, but here's another output:
power_ac and power_dc here seem to match the current PV production. But how comes that both values are around 0.2kW in the middle of the night? Or is this the battery counted as PV production as well? |
Your current consumption should be about 274W. The 213W production at midnight, together with the inverter reporting as producing is what seemed odd to me in your first post. A |
im not sure if this helps. But i recall that i read some posts about the solaredge battery not beeing correctly documented. It seems that it needs substantial watts even in idle mode. Examples in the mid of the night were given were it should be zero but it was not. Maybe a point to consider too. I dont have a battery, but this script works now perfectly for me. |
Interesting. @fredlcore, is the battery connected using a storedge module? |
I only have this setup for a few days, how could I find out? What I found out so far is that the battery is connected via a ModBus connection to the SolarEdge inverter. |
If the battery is connected via the inverter to your electrical installation, the explanation provided by @Deepdiigger makes sense. The most obvious way of finding out is following the cabling from the battery. If there is DC cabling from the battery to a box with SolarEdge on it the inverter is acting as inverter from battery DC to AC. The consumption is sum(inverter.power_ac - meter.p1_power - meter.p2_power - meter.p3_power). |
Yes, the battery seems to be connected via the inverter, all cables seem to go through it. So that means there is no way to figure out the actual PV production? Or I guess I could calculate it with the help of the values from the battery1 JSON output? |
I'm not familiar with all of the settings available for batteries. However, the actual consumption can be calculated using the formula I posted above. The sum of all generating components minus the power that your kWh meter registers as export is the consumption of your entire system. The power required by the battery when charging and when operating normally are (delayed) consumption, but consumption nonetheless -- power provided to the battery will never be exported. If you're interested in tracking the actual consumption of your system at all times you will need to also subtract the battery.instantaneous_power value from the power being exported. At night there will be no export, which means the p1/2/3_power values from your combined with the instantaneous_power value will equal your actual consumption. In this case the production of 200W at night reported by your inverter makes sense, it is producing power, only the source is not PV, but the battery. |
Thanks a lot for this comprehensive response, I really appreciate it and get a better understanding of things now. Thanks also for this really cool program! With this, I may be able to completely stop using the Web API which seems to continuously send data to SolarEdge. |
Just an additional info: Power provided to the battery can actually be exported - my SolarEdge inverter has a mode where I can tell it to export both PV and battery power to the grid. I plan to do this in the morning when PV power is higher than consumption in order to empty the battery before I reach the 70% threshold that usually starts around 11am in summer. This way the battery is empty when I switch to the mode where the battery is only charged with excess PV power. PV production: inverter.power_ac * (10 ** inverter.power_ac_scale) + batteries.instantaneous_power Together with batteries.soe (which gives me the percentage of charge of the battery), I can now dynamically change the strategy how the produced energy should be used. For example, if PV production is higher than consumption in the morning, I can discharge the rest of the battery (except for a safety buffer of 10-20%) to the grid so that I have enough capcity before peak production during noon where I switch to charging the battery only with PV excess production. In the afternoon, I can switch back to maximize for self consumption where consumption has priority over charging which again has priority over grid export. |
Interesting situation. I lack battery storage, so I don't face these issues. Do you have restrictions on how much you are allowed to export to the grid, or otherwise have an incentive to export at certain times? Also, have you figured out whether the charging and discharging of the battery is reflected in the power_ac values of your inverter? |
Any kind of export (be it 100% PV or a mix of PV and previously stored charge in the battery or even 100% from battery) is limited to the 70% cap that is configured in the inverter. I have a 5.92 kW system installed, so export is capped at 4.11 kW. In the morning, when production is around 1-2kW and I only consume 0.2-0.3kW, I can export to the grid whatever charge is left in the battery after the night. With a 4kW battery, I still have 25-35% capacity left. When I discharge the battery down to 10% (to have some charge left for the occasional use of the water boiler or so), I have enough capacity to store the excess capacity around noon when production is often times more than 5kW, but I can only export 4.11kW. The rest goes into consumption and the battery. During summer months, I can easily charge the battery to almost 100% just with this excess production which would otherwise go to waste. As for inverter.power_ac, it is a bit strange: If the battery is discharging, the power that comes from the battery is included in inverter.power_ac. If the battery is charging, inverter.power_ac does not include the power that goes into the battery. |
Is that a wiring limitation?
Does that explain the 200W reported by your inverter at midnight? |
No, it is a legal limitation (in Germany). Since 2012, every PV installation with less than 30kW is allowed to export only 70% of it's maximum production power: And yes, that explains the 200W reported at midnight, because the 200W came from the battery and power drawn from the battery is added to inverter.power_ac. |
One more interesting fact:
inverter.power_ac is 158,00W, meter1.power is -8W (i.e. getting 8W from the grid) and batteries.instantaneous_power is -249.0W, so the total sum in that case is -99W. Some part of that deviation might be stemming from the fact that the battery is running on DC, so maybe inverter.power_dc should be taken into account rather than inverter.power_ac, but the difference is minimal (160.4 compared to 158.0). Do you have any ideas how this is possible? |
I found out that this problem only occurs when the battery is discharging. Once the battery is empty (late into the night for example) and all electricity comes from the grid, this behaviour does not exist. I have therefore taken the approach that once PV production is negative and the battery is discharging, the total household consumption is the amount of energy flowing from the battery plus the amount of energy coming from the grid. By the way, I have kind of finished my predictive battery charging for SolarEdge inverters, using SolCast and/or DWD data to forecast solar power generation, just in case anyone is interested: |
Good to know!
Thanks for sharing! |
hello, i am new to python and influx.
However i got everything running and setup a Chronograf chart to verify the readouts.
I wanted to check them against the API Data.
what i noticed is, that all data from the meter seems to be as expected and ok.
However i could not find the actual production of the solaredge PV in the meters section so i did look in the inverter section.
I think this should be power_ac. But i do not understand this. the values range between 3k and 30k. however i have a max 10,5 kW Peak Produktion and when the API says i have 7k Production power_ac shows. 3k. Even more when the API Production says 3k (less than the 7k) power_ac says 28k so more than before by the factor 10. Any hints? i did not modify your script at all.
The text was updated successfully, but these errors were encountered: