i'm complete lost with my PHP approach.... and looking for a fresh view....
Who can calculate the calibration values from this circle response:
002701D7000D6F00005519E23F7C66A4B556EB543D65DCFE000000002C22
and, based on these figures, current power usage from this circle response:
002401D8000D6F00005519E20001015D0004421001850000044001074DCCDB7B0201DD
I get a value of -163xx,xx Watts
[PHP] Negative Watt value
Re: [PHP] Negative Watt value
Solarpanel?
Re: [PHP] Negative Watt value
No, LCD monitor.
Re: [PHP] Stange Gain value
Calibration:
0027 01D7 000D6F00005519E2 3F7C66A4 B556EB54 3D65DCFE 00000000 2C22
0027 = Response code
01D7 = Sequence number
000D6F00005519E2 = Mac address
3F7C66A4 = GainA = 0.9859411716461182
B556EB54 = GainB = -8.006365987967001e-07
3D65DCFE = OffTot = 0.056118957698345184
00000000 = OffNoise = 0.0
As for the 0024 response, that's a device information response which holds no information about the current power usage!
You need a 0013 response to get the current usage. For more information on the Plugwise protocol please see my Plugwise unleashed document.
0027 01D7 000D6F00005519E2 3F7C66A4 B556EB54 3D65DCFE 00000000 2C22
0027 = Response code
01D7 = Sequence number
000D6F00005519E2 = Mac address
3F7C66A4 = GainA = 0.9859411716461182
B556EB54 = GainB = -8.006365987967001e-07
3D65DCFE = OffTot = 0.056118957698345184
00000000 = OffNoise = 0.0
As for the 0024 response, that's a device information response which holds no information about the current power usage!
You need a 0013 response to get the current usage. For more information on the Plugwise protocol please see my Plugwise unleashed document.
Re: [PHP] Negative Watt value
That are exactly the values i "calculated".
I now have a "5" watt LightBulb on the plug and the formula gives: "-63.97 Watt" based on 2 pulses a second (17pulses in 8 seconds).
Here is my pulse correction(based on you're python) formula;
The function inputs are:
than i calculate the Watts and Kwh with the following functions:
What i'm i doing wrong?
I now have a "5" watt LightBulb on the plug and the formula gives: "-63.97 Watt" based on 2 pulses a second (17pulses in 8 seconds).
Here is my pulse correction(based on you're python) formula;
Code: Select all
public function _pulsesCorrection($timespansource,$pulses, $offnoise, $offtot,$gain_a, $gain_b){
$timespantarget = $timespansource;
if($pulses == 0.0){
return 0.0;
}
$corrected = 0.0;
$value = $pulses / $timespansource;
$out = $timespantarget * (((pow($value + $offnoise, 2.0) * $gain_b) + (($value + $offnoise) * $gain_a)) + $offtot);
return $out;
}
Code: Select all
pulses:2
offnoise: 0
offtot: 0.056118957698
gain_a: 0.985941171646
gain_b: -8.00636598796
than i calculate the Watts and Kwh with the following functions:
Code: Select all
public function _pulsetowatt($pulses,$timespan){
return $this->_pulsetokwh($pulses,$timespan) * 1000;
}
public function _pulsetokwh($pulses, $timespan){
return ($pulses / $timespan) / 468.9385193;
}
Re: [PHP] Negative Watt value
Did you read my latest comments? 0024 is not a power information response..
Re: [PHP] Negative Watt value
i read it, and i posted the wrong string.
this is the "good" string:
00130033000D6F00005519E2000200110000045200000000000A741E
And in my last post i gave all the info to calculate the current power usage;
pulses,
noise
totaloff
gaina
gainb
And when i put these figures in the formula, it gave a negative and totally off value
i aspect a value between +4 and +6 and get a -63.....
this is the "good" string:
00130033000D6F00005519E2000200110000045200000000000A741E
And in my last post i gave all the info to calculate the current power usage;
pulses,
noise
totaloff
gaina
gainb
And when i put these figures in the formula, it gave a negative and totally off value
i aspect a value between +4 and +6 and get a -63.....
Re: [PHP] Negative Watt value
I get weird values as well. What firmware version are you using?
It looks like a new format/version..
It looks like a new format/version..