modification of the indication table

Talks about solar stuff
xtronets
Posts: 8
Joined: Thu Apr 08, 2021 7:10 am

modification of the indication table

Post by xtronets » Thu Apr 08, 2021 7:14 am

Hello, is it possible to modify the code so that it shows the energy produced for each of the phases and not how it was consuming only for one phase at the moment?

Image

jeanmarc
Posts: 2130
Joined: Thu Aug 29, 2013 7:16 am

Re: modification of the indication table

Post by jeanmarc » Fri Apr 09, 2021 11:14 am

Hi,
No, 123s ain't designed to have a kWh counter for each phase. I'am not sure you can get that from your inverter.
You can get power for each phase tough via $GxP

xtronets
Posts: 8
Joined: Thu Apr 08, 2021 7:10 am

Re: modification of the indication table

Post by xtronets » Sat Apr 10, 2021 5:14 am

I can only measure G1P, but I measure the voltage and amps for each phase, you can use a mathematical framework.
V*A=W :)

jeanmarc
Posts: 2130
Joined: Thu Aug 29, 2013 7:16 am

Re: modification of the indication table

Post by jeanmarc » Sun Apr 11, 2021 10:00 am

sure, don't forget cos phi. What is your inverter/com.app ?

xtronets
Posts: 8
Joined: Thu Apr 08, 2021 7:10 am

Re: modification of the indication table

Post by xtronets » Sun Apr 11, 2021 12:22 pm

I am using your script to communicate with KACO BluePlanet TL3 inverter, the outputs are taken from ... realtime.csv, I modified it a bit.
What I would like to achieve is a power breakout for each of the phases in the mathematical model,but still, I would not like it to be affected by the G1P parameter that the inverter gives correctly.For my inverter, the G1P parameter is the sum of the power of the 3 phases

jeanmarc
Posts: 2130
Joined: Thu Aug 29, 2013 7:16 am

Re: modification of the indication table

Post by jeanmarc » Sun Apr 11, 2021 3:19 pm

i believe it's ok to skip the cos phi, so into kaco.php

$G2V = (float) ($line[4] / (65535/1600));
$G2V = round($G2V, 2);
$G2A = (float) ($line[9] / (65535/200));
$G2A = round($G2A, 2);
$G2P = $G2V*$G2A;

same for $G3P, then $G1P = $G1P-$G2P-$G3P;
Is it ok ?

xtronets
Posts: 8
Joined: Thu Apr 08, 2021 7:10 am

Re: modification of the indication table

Post by xtronets » Sun Apr 11, 2021 4:50 pm

not working

Code: Select all

if (isset($line[13])) {
    // Grid values
    $G1V = (float) ($line[3] / (65535/1600));
    $G1V = round($G1V, 2);
    $G1A = (float) ($line[8] / (65535/200));
    $G1A = round($G1A, 2);
    $G1P = (float) ($line[11] / (65535/100000));
    $G1P = round($G1P, 2);
    
    $G2V = (float) ($line[4] / (65535/1600));
    $G2V = round($G2V, 2);
    $G2A = (float) ($line[9] / (65535/200));
    $G2A = round($G2A, 2);
    $G2P = $G2V*$G2A;
    $G2P = round($G2P, 2);
    
    $G3V = (float) ($line[5] / (65535/1600));
    $G3V = round($G3V, 2);
    $G3A = (float) ($line[10] / (65535/200));
    $G3A = round($G3A, 2);
    $G3P = $G3V*$G3A;
    $G3P = round($G3P, 2);

jeanmarc
Posts: 2130
Joined: Thu Aug 29, 2013 7:16 am

Re: modification of the indication table

Post by jeanmarc » Sun Apr 11, 2021 7:58 pm

Code: Select all

<?php
/**
 * /srv/http/123solar/scripts/protocols/kaco.php
 *
 * @package default
 */


if (!defined('checkaccess')) {die('Direct access not permitted');}

// For KACO Powador (work in progress)
$CMD_RETURN = ''; // Always initialize

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://${'ADR'.$invt_num}:8091/realtime.csv");
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$CMD_RETURN = strip_tags(curl_exec($ch));
curl_close($ch);

$line = preg_split('/;/', $CMD_RETURN);
//print_r($line);

if (isset($line[13])) {
	// Grid values
	$G1V = (float) ($line[3] / (65535/1600));
	$G1V = round($G1V, 2);
	$G1A = (float) ($line[8] / (65535/200));
	$G1A = round($G1A, 2);
	$G1P = (float) ($line[11] / (65535/100000));
	$G1P = round($G1P, 2);

	$G2V = (float) ($line[4] / (65535/1600));
	$G2V = round($G2V, 2);
	$G2A = (float) ($line[9] / (65535/200));
	$G2A = round($G2A, 2);
	$G2P = $G2V*$G2A;

	$G3V = (float) ($line[5] / (65535/1600));
	$G3V = round($G3V, 2);
	$G3A = (float) ($line[10] / (65535/200));
	$G3A = round($G3A, 2);
	$G3P = $G3V*$G3A;
	
	$G1P = $G1P-$G2P-$G3P;

	$FRQ = null;

	// Strings
	$I1V = (float) ($line[1] / (65535/1600));
	$I1V = round($I1V, 2);
	$I1A = (float) ($line[6] / (65535/200));
	$I1A = round($I1A, 2);
	$I1P = null;

	$I2V = (float) ($line[2] / (65535/1600));
	$I2V = round($I2V, 2);
	$I2A = (float) ($line[7] / (65535/200));
	$I2A = round($I2A, 2);
	$I2P = (float) ($line[6] / (65535/200));
	$I2P = round($I2P, 2);

	$I3V = null;
	$I3A = null;
	$I3P = null;
	$I4V = null;
	$I4A = null;
	$I4P = null;

	// Inverter
	//$EFF = round(($G1P / $I1P) * 100, 1);
	$EFF  = null;
	$INVT = $G3A = (float) ($line[12] / 100);
	$BOOT = null;

	// Getting KWHT in Wh, the value should always increase !
	// Here's the hassle, your counter isn't precise enough

	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, 'http://193.34.93.23:8091/eternal.csv');
	curl_setopt($ch, CURLOPT_TIMEOUT, 15);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	$CMD_RETURN = strip_tags(curl_exec($ch));
	curl_close($ch);

	$line = preg_split('/;/', $CMD_RETURN);
	//print_r($line);

	$KWHT = preg_replace('/[^0-9.]+/', '', $line[8]);
	if (isset($KWHT)) {
		/*
        echo "
        G1V: $G1V V
        G1A: $G1A A
        G1P: $G1P W
        G2V: $G2V
        G2A: $G2A
        G2P: $G2P
        G3V: $G3V
        G3A: $G3A
        G3P: $G3P

        FRQ: $FRQ
        I1V: $I1V
        I1A: $I1A
        I1P: $I1P
        I2V: $I2V
        I2A: $I2A
        I2P: $I2P

        EFF: $EFF
        INVT: $INVT

        KWT: $KWHT Wh
        ";
*/
		$RET = 'OK';
	} else {
		$RET = 'NOK';
	}

} else {
	$RET = 'NOK';
}

?>
what's wrong with that ?

xtronets
Posts: 8
Joined: Thu Apr 08, 2021 7:10 am

Re: modification of the indication table

Post by xtronets » Mon Apr 12, 2021 5:37 am

No Data
Image
foto 55

jeanmarc
Posts: 2130
Joined: Thu Aug 29, 2013 7:16 am

Re: modification of the indication table

Post by jeanmarc » Mon Apr 12, 2021 6:01 am

What 'test communication' return ?
:!: BTW, i notice that the total coutner wasn't precise enough on previous attempt and the value should always increase.
I'm sure sure it is your the case actually

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests