Page 1 of 1

Total of cunsumption and delivering

Posted: Wednesday 04 April 2018 18:12
by HendrikJan
Hello everybody,

I will short introduce myself; I'm Hendrik-Jan and live near Breda. I work as a Senior Processoperator at a big water company.
I'm completely new with Domoticz :lol:

I hope somebody can help me with this problem.
I have a Raspberry PI 3B with Domoticz and a Smart meter P1 to USB cable.
This works fine, but since I have a 3-fase installation, it's possible to consume power from the supply and at the same time deliver back.
At the sensor screen this is shown as it should be but the total calculation on the Dashboard screen is not correct.
I also installed the Domoticz app on my Android Phone, and then the valua is correct :?:
Is it possible to adjust this for the Windows webbrowser?

Another question on this: I want to make a floorplan, and I was trying something; but when I put the power there the day total is shown and I want the current value.

It's kind of a long story, but maybe the answer is quite simple, but I couldn't find it on the forum and the wiki :oops:

Thanks in advance for your help.

Hendrik-Jan

Re: Total of cunsumption and delivering

Posted: Wednesday 02 May 2018 12:40
by rapbot
I also have this same doubt from couple of days. Thanks for your input this helped me a lot.

Re: Total of cunsumption and delivering

Posted: Wednesday 27 June 2018 20:44
by olleman
I too have this problem. I'm trying to meassure current in/out (solar panels in a 12v system) to get the netto for each day. Seems like the calculations on the overview are correct with pos/neg values but the graphs go haywire when I feed them with negative values. A negative valuye will equal a consumption of 18 trillion watts or so...

For the time being I will have to use a script to make all negative values go to one counter "used power" and invert them and all positive figures to "charged power" and then combine these somhow.

Re: Total of cunsumption and delivering

Posted: Wednesday 27 June 2018 21:14
by pwhooftman
HendrikJan wrote: Wednesday 04 April 2018 18:12
This works fine, but since I have a 3-fase installation, it's possible to consume power from the supply and at the same time deliver back.
That seems impossible to me, and irrelevant to wether you have a 1-phase of 3-phase installation. I have a 3-fase installation with smart meter and solar panels. When i need more power than the panels are producing, my smart meter shows a positive value for power taken from the grid to deliver the power needed (ie in the evening & at night). During daytime when the panels are producing more than the needed power in house, the surplus is being delivered back to the grid, the smart meter shows a negative value (current is flowing in reverse direction, to the grid).

You can't have 3 fases where like 2 fases consume power from the grid, and 1 delivers to the grid. The fases work together (3 sinusses of around 380v shifted 120 degrees) to produce net power of 230V to ór from the grid.

btw, im not experiencing this, 'sensor' view & dasboard view match.

Re: Total of cunsumption and delivering

Posted: Wednesday 27 June 2018 21:39
by pwhooftman
olleman wrote: Wednesday 27 June 2018 20:44 I too have this problem. I'm trying to meassure current in/out (solar panels in a 12v system) to get the netto for each day. Seems like the calculations on the overview are correct with pos/neg values but the graphs go haywire when I feed them with negative values. A negative valuye will equal a consumption of 18 trillion watts or so...

For the time being I will have to use a script to make all negative values go to one counter "used power" and invert them and all positive figures to "charged power" and then combine these somhow.
A smart meter also uses different counters for energy taken from the grid, and energy delivered to the net. And each also in two separate counters; low tariff and high tariff.
So, i guess you'll have to use 2 counters: one 'power used' which counts positive numbers when you are using more power than generated, and one 'power generated' which counts positive numbers when you are generating more power than you are using. Both counters will show totals at the end of the day, substracting them tells you wether you generated more power in the whole day than used, or vice versa.

Re: Total of cunsumption and delivering

Posted: Thursday 28 June 2018 21:30
by olleman
But how do I do this filtering of negative values to one meter and positive to another? The function updateCounter() doesn't work with incremental counters. Please see this thread. Any suggestions?
viewtopic.php?f=59&t=19098&p=184974#p184974

Re: Total of cunsumption and delivering

Posted: Thursday 28 June 2018 21:45
by pwhooftman
olleman wrote: Thursday 28 June 2018 21:30 But how do I do this filtering of negative values to one meter and positive to another? The function updateCounter() doesn't work with incremental counters. Please see this thread. Any suggestions?
viewtopic.php?f=59&t=19098&p=184974#p184974
You will have to program your script to determine wether values are negative or not, and update the appropiate counter with the absolute value of the negative value.
Do you use a bash script? If so, something like this (not tested so probably with errors):

Code: Select all

if [ "$(echo "$Value < 0" | /opt/bin/bc)" -eq 1 ]  ; then    
 Value=`echo ${Value#-}`    # turn negative value to positive
 result=$(/opt/bin/curl -s -m 5 "http://youripadress:yourport/json.htm?type=command&param=udevice&idx=yourdevicea&nvalue=0&svalue=$Value")
else
 result=$(/opt/bin/curl -s -m 5 "http://youripadress:yourport/json.htm?type=command&param=udevice&idx=yourdeviceb&nvalue=0&svalue=$Value")
fi

Re: Total of cunsumption and delivering

Posted: Friday 29 June 2018 14:16
by olleman
Sorry, I was a bit unclear. I have the filtering working but the problem is that dZvents is somehow updatering an incremental counter wrong so the incremental part isn't updated. Doing this via Json gives me the same error. I have really hard to believe that I'm the only one with this problem. Can someone please confirm that updatering an incremental counter via json and latest stable domoticz is actually working?