• P
    Pikey4

    Thanks for helping out @CraigWeb @phildunlap @Jared-Wiltshire ,

    I couldn't get it to work with a Persistent TCP data on central server, so set up on an ES on Site and it seems to be tracking good. All the 4's and 1's are lining up where I expect them.

    Thanks Again.

    I got this to work:

    var prevVal = p709.lastValue(2);
    var thisVal = p709.lastValue(1);
    var nextVal = p709.lastValue();
    
    if (thisVal >= prevVal && thisVal >= nextVal) {
        // peak
        return 4;
    } else if (thisVal >= prevVal && thisVal < nextVal) {
        // still climbing
        return 3;
    } else if (thisVal < prevVal && thisVal < nextVal) {
        // trough
        return 1;
    } else {
        // falling
        return 2;
    }
    

    0_1547002473983_mangoChart.png

    posted in How-To read more
  • P
    Pikey4

    Hi Rowen,
    Hope this helps to get started.

    I am only monitoring current on one of the 3 phases on a small job, and I've used:

    return (1.732 * 0.7 * p217.value * p218.value)/1000;
    

    1.732 = Square Root of 3
    0.7 = power factor I measured onsite once
    p217 = Amps
    p218 = Voltage

    It's not going to be as good as a power meter, but gets me trending which is all I am after and it's fairly close.

    posted in User help read more