3 phase monitoring with solar

I live in Denmark where we use 3 phase 220V. I have an inverter for my solar which also produce 3 phase power to my house. When there is an excess of power, I sell to the grid.
I have a setup with three Emontx3 one for each phase, powered by each phase by the AC adapter for better accuracy…
I have the current clamps installed at the phases as they come into my house. And I also have current clamps on each of my phases from the inverter.
My question (at long last) is how to set this up in emoncms.
I am using the solar app where you feed it your mains power and your solar power.
(of cause I add up the three phases to be able to give it one value of use and kwh)
When there is no sun the values from the mains are positive…
Where there is some sone (but not enough to sell) the values from the solar are positive and are substracted from the mains values (as far as I can see).
But when I then produce more than I use, the values from the mains become negative and the values from the solar are positive, but are subtracted from the mains, so it becomes even more negative?

Just to be clear, I haven’t set this up yet, but I have used this for some years and not really trusting the readings :wink:

Can someone confirm or deny the way the solar app works?

And would it be better for me to measure my use, without the solar? Yet I am not sure that is possible in my setup…

Unless power/energy is going somewhere else, the way you have your c.t’s set up gives you

use = grid + solar

and this must always be true - but subject to a possible large percentage error when you transpose the values and subtract two nearly equal values.

I don’t use the MySolar app, but I’ve had a quick play generating values for it using my web browser like this ...post?node=browser&fulljson={"grid":1000,"solar":700}... (only sending ‘grid’ & ‘solar’ values for a single phase - much the same as you are doing) and I’ve created a Feed “use” by adding the grid input to the solar (as by the time it processes the solar input, it has already got the value for the grid input):

You should add process steps like this to the last c.t. input on the Inputs page, and add the 5 other c.t’s to give your ‘use’ feed.

MySolar does appear to be using use and solar to correctly calculate the grid (import) power:

I cannot see “import” as a power, only as an energy (kWh) in the selections, so have you selected the correct feeds when you set up MySolar?

OK I now have my current clamps installed. I am now trying to setup the emontx3 via serial…
So I have added one of the emontx3 to the emonhub.conf like this:

    [[USB0]]
        Type = EmonHubOEMInterfacer
        [[[init_settings]]]
            com_port = /dev/serial/by-id/usb-FTDI_TTL-234X-3V3_FT8Z10WW-if00-port0
            com_baud = 115200
        [[[runtimesettings]]]
            pubchannels = ToEmonCMS,
            nodename = emonTx3L1

Not sure if this is the “right” way to do it? Maybe USB0 is reserved to the emonhub it self?
But I do get the device shown… yet there seems to be missing some inputs…
And the “old” version of this emontx3 also shows up (when it was wireless)…
I have tried to remote it from under the [Nodes] section, but as I restart emonhub they are recreated…
Am I doing something wrong? Maybe it would be better to start over with a clean install?

I tried to startover with a blank installation, but sadly the “autoconf” was enabled, and it found the emontx3 via wireless and created the node…
As I attached the emontx3 via USB2Serial it created this:

    [[USB0]]
        Type = EmonHubOEMInterfacer
        [[[init_settings]]]
            com_port = /dev/ttyUSB0
            com_baud = 115200
        [[[runtimesettings]]]
            pubchannels = ToEmonCMS,
            subchannels = ToRFM12,
            nodename = emonTx4

Not sure why it’s called emonTx4, but anyway it found it. But again with less inputs…
Can I just copy/paste the auto-generated entry under [nodes] ?

    [[15]]
        nodename = emontx3_cm_15
        [[[rx]]]
            names = MSG, Vrms, P1, P2, P3, P4, E1, E2, E3, E4, T1, T2, T3, pulse
            datacodes = L, h, h, h, h, h, l, l, l, l, h, h, h, L
            scales = 1.0, 0.01, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.01, 0.01, 0.01, 1.0
            units = n, V, W, W, W, W, Wh, Wh, Wh, Wh, C, C, C, p
            whitening = 1

I guess I need to “match” it to the name defined under USB0 ?

I would really like to name the three emontx3 units so that I can make sense of them… is there a way to to that easily? I can see that the autoconf found “emontx3_cm_15” which is what it was called in the previous installation… (15) is the ID…

That is the name you give to identify the Node

No - you don’t need that Node Definition. The data comes in “Key:Value” format, so there is no need to decode the value and attach a name to it, which is what this part of emonHub does.

You have done so, for the first one: it is connected to port USB0 and you have named it “emonTx4” in the Interfacer. You need two more USB ports and two more instances of the Interfacer for the other two emonTx V3s. You might want to change the first to “emonTx1” and name the others “emonTx2” and “emonTx3”. Or maybe emonTx0, emonTx1 & emonTx2 to match the USB ports?

So that the emonTx’s don’t get swapped around if the port names are allocated to a different physical port when the emonPi reboots, look at the part in this thread where “udev rules” are discussed. (Note: where they use “3No.”, they mean a quantity of three.)

Hi Robert! My hero :slight_smile:
I am aware about the USB port and how to make it unique etc… I am using original FTDI cables because I found out that china clones use the same serial for their chips, and cannot be changed…
The thing is that it looks like the emontx3 is only showing P1 and not the other ports…
If I have a look via the serial monitor it shows this:

Settings:
Band 433 MHz, Group 210, Node 15, 7 dBm
Calibration:
vCal = 268.97
assumedV = 240.00
i1Cal = 90.90
i1Lead = 3.00
i2Cal = 90.90
i2Lead = 3.00
i3Cal = 90.90
i3Lead = 3.00
i4Cal = 16.67
i4Lead = 6.00
datalog = 9.85
pulse period = 100
RF on
temp_enable = 1
JSON Format Off
Temperature Sensors found = 0 of 3
Temperature measurement is enabled.

MSG:2320,Vrms:253.73,P1:-694,E1:175764,pulse:2
MSG:2321,Vrms:253.31,P1:-691,E1:175762,pulse:2

Shouldn’t it show P2, P3 and P4 ?

/Heino

Only if you have a c.t. connected. If you look at the sketch, you’ll see: emontx3/firmware/emonTx34/emonTx34_CM/emonTx34_CM.ino at master · openenergymonitor/emontx3 · GitHub
Lines 456 onwards.

Hmm OK, but I do have three clamps connected right now and only P1 is showing anything…
I can see “from the code” that you pointed out, that it only prints any values if the value if different from 0 (I guess)… but I know that at least two of the clamps have a charge… so seems a bit strange?

Yeah I tried to move the clamp from P1 to P2 and reboot everything, but it didn’t make any change I only still see P1 in the serial output… So not sure what it going on? And I tried to “+++” thing at bootup but as we found out earlier it was disabled in this firmware…
maybe there is a but in the way the serial data is shown? and I need another firmware on the device?

Were the c.t’s plugged in when you started/reset the emonTx V3? – because the detection that the sketch uses only works at start-up.

CT1 etc are logical variables (true or false - it’s actually wrong to set them to 0 or 1, although “it works”) that are set in lines 222 onwards - if nothing is in the socket, the d.c. voltage on the input is zero and that is what is being detected. If you look at the serial monitor as it starts, it should list the c.t’s it finds (lines 267 onwards). What version does it say it is? It should be

emonTx V3.4 Continuous Monitoring V2.4.0

Well right now I can only see the output from the serial monitor inside emonhub…
I uploaded the FW to the emontx using Visual Studio Code om my Mac… worked great… the reason was that I needed to change the node ID on the 3rd box, so I have 15,16 and 17.
(at the top of the .iso file is says emonTxV3.4 Continuous Sampling and the last entry in the change log is 2.4…

I still find it strange that even when I swapped the C.T. from port 1 (where I saw some values) to port 2, it doesn’t create P2 ?
So if this isn’t working I guess I will need to go back to wireless communication?

If you can send serial commands, I’d advise turning the radio off with w0 and then s (save).

You cannot enable or disable a power/energy with a configuration command, and you would get zero rather than nothing if the calibration had been changed to zero. So I do not know why it is failing to detect the c.t. in any other position - you have pressed the Reset button on the emonTx V3 after you plugged the c.t. into the CT2 or CT3 or CT4 socket?

If you can edit the sketch, recompile and upload it, you can permanently enable the power channels by creating a new line after the c.t’s should have been detected in line 226:

CT1 = true; CT2 = true;  CT3 = true; CT4 = true;  CT_count = 4;

(or whichever c.t’s you’re using). If the input is still shorted to ground, the library senses it and sets the power and current to 0.0, so that you don’t get wrong values. But it will always send all the c.t’s that you have enabled.

I’ve freshly downloaded and checked the sketch (post no.7) and the c.t. detection works for me - but it does need the Reset button to be pressed to update it after a change.

If it still does not show the c.t. in another socket, measure the d.c. voltage on the c.t. (tip or sleeve). It should be > 0 V, normally 1.65 V

You the man! :slight_smile: This actually made a change… a bit strange that power-off doesn’t result in the same… but when you know, you know :slight_smile:
Now I would just like to clean up the devices and inputs… because even though I have “autoconf = 0” in the emonhub.conf they just keep poping up :slight_smile:
But you mentioned that the “[nodes]” part I could just remove all together?
I have [[5]] and [[15]] in there… I will remove [[15]] as this is the emontx3 (where I have disabled wifi as you described)

Under inputs I have “0” and “5” that just have inputs from 1 to 20… which seems active…
I have nuked it all now, and lets give it a few hours and see it it comes back :slight_smile:

OK, got all 3 emontx set up now, and it looks good… I got another device “5” under input (I think it was when i restarted emonhub)… I just deleted it again…

One quick question… In the “My Solar” app I have use/use_kwh and solar/solar_kwh setup, but how is the import_kwh calculated? Right now I have nothing setup here… and I guess this is why I have nothing under “DIRECT” when showing the graph?
(maybe this looks better once we get a little sun tomorrow) :slight_smile:

I think I god the idea now, from this nice description… I if cause need to add up my three phases… Solar PV — OpenEnergyMonitor 0.0.1 documentation

Power-off, then power-up should be exactly the same as pressing the reset - unless you switched off the a.c. side and didn’t allow enough time for the power supply to die.

But wait – were you powering the emonTx via the serial port all the time in parallel, so you never actually removed the supply voltage at all? I pressed ‘Reset’ because I was monitoring via serial just like you were, with the a.c. adapter connected too.

Node [[5]] is the emonPi itself. You need this if you are using any of the voltage, c.t., temperature or pulse inputs on the emonPi.

Yes but I also have the node it self show under [nodes] with the nodename “emonpiCM_5” and node 5 is under SPI:

    [[SPI]]
        Type = EmonHubRFM69LPLInterfacer
        [[[init_settings]]]
            nodeid = 5
            networkID = 210
            resetPin = 24
            selPin = 16
        [[[runtimesettings]]]
            pubchannels = ToEmonCMS,

The emonpiCM_5 (under nodes) seems to be updating its inputs and node 5 is only shown when I reboot or restart emonhub… could I remote any of them?

Looks like this under nodes:

[nodes]
    [[5]]
        nodename = emonpiCM_5
        [[[rx]]]
            names = Msg, power1, power2, power1pluspower2, vrms, t1, t2, t3, t4, t5, t6, pulse1count, pulse2count, E1, E2
            datacodes = L, h, h, h, h, h, h, h, h, h, h, L, L, l, l
            scales = 1.0, 1.0, 1.0, 1.0, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 1.0, 1.0, 1.0, 1.0
            units = n, W, W, W, V, C, C, C, C, C, C, p, p, Wh, Wh

BTW: About the emontx3 you might be right… I use the AC power and the serial port via a FTDI cable. I think it must have been powered by the serial connection when I removed the AC…
The two other emontx3s behaved as you described the first time they powered up, they found the three C.Ts with no problems…

Unless it’s causing a problem, I wouldn’t worry. It only uses up memory on the SD card when you save the data in a Feed. In any case, you might want the emonPi’s inputs at some point so it’s better to comment out the definitions, rather than delete them.

well they seem to be multiplying :wink: I just rebooted the pi and now I got this:

Seems strange with autoconf turned off and all?
If I look under inputs for these devices they are all stale with no data…