Replies: 3 comments 1 reply
-
Hi Remco, You are right; most values returned by the inverter are averaged out by the plugin. Regarding your question: Isn't calculating averages what Domoticz should be doing by itself to store the values for the graph? With an interval of 5 seconds over a period of 300 seconds, we receive 60 values from the inverter. The only exception to this is the “Total Energy” value; this is a counter that only goes up (unless you do a factory reset of your inverter). You can see the real-time values in the Setup -> Devices list; this is what the plugin receives from the inverter. Since you already played with the code: experiment with it. Regarding the 1 second interval: more than happy to add it. Kind regards, Addie |
Beta Was this translation helpful? Give feedback.
-
Yep, I agree that for displaying the graphs in Domoticz this average would make some sense, with the remark that no other plugins do this. That makes this plugin somewhat different from others. So, I had a play with it and decided that you have a point regarding the graphs in Domoticz, but also that averaging needs to be optional for the user. So I just sent you a pull request with these changes in it:
While I was at it I added the 1 second interval and merged 2 logging option parameters to one. Something completely different: I also have a GoodWe inverter, I didn't manage to find a working plugin for Domoticz that communicates via Modbus UDP to that inverter. Currently I'm in the process of creating a new plugin that does exactly that and it is working in a primitive state/proof of concept at the moment. I used your plugin as a reference point to get things up and running quite quickly. :) So thank you for the good example. Hope you will merge it, or discuss about it if needed, |
Beta Was this translation helpful? Give feedback.
-
Bedankt en graag gedaan Addie. :) |
Beta Was this translation helpful? Give feedback.
-
Hi Addie,
I'm new to Domoticz and i've been using this plugin for a couple of days now.
I am having the same type of issue as @FritsPh described in #21 (comment). Being a software developer (with some Python experience) myself I started to investigate. I had seen and processed my SolarEdge modbus before by myself and that data was spot-on, so I know it must be possible to get better corresponding values as it is now.
First let me describe what I am experiencing, in short:
Power
is lagging behind the power that my inverter is showing on its display and returning via modbus. Its not the 5 second time interval causing it, because it takes a way longer time for the number to creep up (or down) to the 'real' power delivered at that time: 5 minutes if the real power doesn't change in the meantime.The same goes for other values like
DC Current
andDC Voltage
and presumably others. Didn't check them all.Knowing that the modbus data is spot on, I was first turning my attention to Domoticz. Maybe something got cached or averaged out somewhere between your plugin and my screen (being some process in Domoticz). It didn't look like that. So I started to have a look at your
plugin.py
file.There is an
Average
class. That class is being used by almost all (all but 3) items in both of theSINGLE_PHASE_INVERTER
andTHREE_PHASE_INVERTER
lookup tables.A snippet:
Its the
Average()
that is to be discussed. I think this is the cause of lagging behind the real numbers. Since theAverage
class needs amax_samples
value, this is set this way:and
Which makes the output of your plugin creep up or down to the current real value in 5 minutes time.
Since the darkness and the night has set in I currently have no way of checking all of the above facts, so many of it comes from the top of my head, but it seems to me the usage of the
Average
class is the culprit here.My proposed solution would be: Setting
MATH
for most (or all?) items in your lookup tables toNone
, to resolve the issue.But since I'm new to Domoticz and your code looks well and organized I might be missing out on why you choose to use the
Average
class in all these items. I'd like to hear from you what that reason would be. A comment in your code gives the reason partly:But I'm looking at my Domoticz screen and there I want to see the realtime values (Like I see when I look at my P1 meter Power value, that is realtime), not 5 minute average processed ones. Next to that this also causes the Domoticz graph to lag behind as well.
Being a Domoticz newbie, I could say something really stupid here: Isn't calculating averages what Domoticz should be doing by itself to store the values for the graph?
Next to this I have a small feature reqeust: Please add a 1 second interval option:
I already added this myself and works like a charm. With the above described issue, that is. :)
Regards, Remco.
Beta Was this translation helpful? Give feedback.
All reactions