rdmenezes / measureit

Automatically exported from code.google.com/p/measureit
0 stars 0 forks source link

Spikes on appliace power reading #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Randomly happens during the day

I expect to see normal consuption values, but some spikes (16.xxx kW, 7.yyy kW, 
32.762 kW) happens during the night at owen (not in use) or during the day at 
fridge (while working), or randomly on every appliace...

If you make a sum of appliances consuption, you'll find a result 10 times 
greater than the Sensor 0 (whole hose sensor).
I.e. today Sensor 0 shows 12 kWh, the sum of the other sensors is more than 29 
kWh.

I run the 114 version on a Raspberry PI 512MB Version B.
Measure_it, mysql, etc, was manually installed on a RasPBX (debian wheezy) SD 
with an additional home automation server (eibd+linknx). The serial interface 
is the original by CurrentCost (the white one with the blue led).
Please, could you suggest to me if some tests can be performed in order to 
check if the problem is software or hardware?
Thank you!

Original issue reported on code.google.com by evazzo...@gmail.com on 18 Apr 2013 at 9:40

Attachments:

GoogleCodeExporter commented 9 years ago
...and this is the oven that turns on during the night and eat up more than 16 
kWh...
I'm not python expert but, how many times the value is readed on the serial 
port before taken as "confirmed"?
Thanks.

Original comment by evazzo...@gmail.com on 19 Apr 2013 at 7:18

Attachments:

GoogleCodeExporter commented 9 years ago
The grabber is listen permanently on the output from the Envi. If the Envi 
sends new usage data for this sensor and it is different to the lastest it will 
be written into the database.

To test if the usage data from the envi is wrong or if there is a bug in the 
grabber I need your help.
Start the grabber in debug mode and pipe the output into a file.

You can do this with the parameter "test"

python /path/to/grabber/data-input.py test > file

f.e.: 
/usr/bin/python /usr/local/measureit/python/data-input.py test > /tmp/test.txt

In the test.txt file you will find the original xml output from the Envi in 
this format:

<msg><src>CC128-v1.29</src><dsb>00392</dsb><time>08:22:20</time><tmpr>22.9</tmpr
><sensor>1</sensor><id>03118</id><type>1</type><ch1><watts>00073</watts></ch1></
msg>

If you get an other spike you can look in the file

Original comment by lalelu...@gmail.com on 19 Apr 2013 at 3:40

GoogleCodeExporter commented 9 years ago
Thank you for the reply and suggestion.
I did the test and isolate the spike. I think we're not so far to the solution 
but I'm like a donkey with regex and python is an alien for me... ;-)

So, I found this spike:

<msg><src>CC128-v0.12</src><dsb>00659</dsb><time>07:17:30</time><tmpr>27.5</tmpr
><sensor>4</sensor><id>03074</id><type>1</type><ch1><watts>00255</watts></ch1><c
h2><watts>32767</watts></ch2><ch3><watts>32766</watts></ch3></msg>

I observe that normally rows are shorter than this:

<msg><src>CC128-v0.12</src><dsb>00659</dsb><time>07:17:36</time><tmpr>27.5</tmpr
><sensor>4</sensor><id>03074</id><type>1</type><ch1><watts>00000</watts></ch1></
msg>

and only <ch1> is posted on the serial port. My sensor 1 has <ch1> only (I 
suppose) because it's an appliance.
Measureit, in the case of the spike, takes a different channel than ch1 (I 
don't know if ch2 or ch3) with a bad value.
This happens with sensor 5, too.

I attach a complete log for your better analysis.
I tried to sync Current Cost time with os time. "Tried" means "forgive some 
seconds of difference".
Thank you so much!

Original comment by evazzo...@gmail.com on 20 Apr 2013 at 8:17

Attachments:

GoogleCodeExporter commented 9 years ago
Sorry, "My sensor 4 has <ch1> only (I suppose) because it's an appliance."

Original comment by evazzo...@gmail.com on 20 Apr 2013 at 8:19

GoogleCodeExporter commented 9 years ago
Ok. I take a look at the data

The <ch1> is the default channel you get with an iam or with a sensor with 1 
clamp.

Are there more than 1 clamp you get more channels. <ch2> and if there are 3 
clamps at the sensor <ch3>

The Envi told measureit there is a sensor with 3 clamps. For whatever reason....

<msg><src>CC128-v0.12</src><dsb>00659</dsb><time>07:17:30</time><tmpr>27.5</tmpr
><sensor>4</sensor><id>03074</id><type>1</type><ch1><watts>00255</watts></ch1><c
h2><watts>32767</watts></ch2><ch3><watts>32766</watts></ch3></msg>

If there is more than 1 clamp measureit count up each channel to get the 
complete usage and insert the value into the database to the sensor with the id 
4 and if there are clamps configured in the admin from measureit it will add 
each usage to the clamp.
I test this with your xml and measureit wants to insert 65788 watts which is 
correct.

65788 = 255 + 32767 + 32766

<ch1><watts>00255</watts></ch1>
<ch2><watts>32767</watts></ch2>
<ch3><watts>32766</watts></ch3>

I can not figure out why measureit uses only the data from <ch2> on your system

However I insert a test that looks if the clamp is configured in measureit 
admin and only in that case the consumption is counted up.

I am not sure that this is a good solution but test it with this version from 
the grabber

https://code.google.com/p/measureit/source/browse/trunk/measureit_system_files/p
ython/data-input.py

Original comment by lalelu...@gmail.com on 20 Apr 2013 at 11:48

GoogleCodeExporter commented 9 years ago
Hi.
The version on the link seems to fixed the problem (after a night and a day of 
test)... Thank you so much!
I suppose the problem is the sensor: current cost uses the same hw for all 
sensors, and for the new IAMs, too.
They probably have the electronic circuit for 2nd and 3rd probe, but without 
probe and pull-down resistor they read EM interferences as a value...

I still have a problem on sensor 0 (it was there before): a "spike to zero" 
occurs really often (see attach).
I tried to watch the LCD for a while and I never seen a value of 0 in the total 
(it's impossible because of the standby of some appliances connected).
The test logfile shows these zero, so I have they in the graph, in the log, but 
not while watching the LCD display on the current cost monitor.
Does measureit "interpret"/decode the serial output into the XML we see in the 
log file or is the logfile a RAW version of the serial output?

My Envi is CC128-v0.12, is very old, I need to be sure if there is a problem in 
sensor reading in order to decide to buy a new revised one...
Thank you.

Original comment by evazzo...@gmail.com on 22 Apr 2013 at 9:35

Attachments:

GoogleCodeExporter commented 9 years ago
The XML in the log file is the raw output from the envi.

If you found 0 watt usages in there so the Envi told measureit there is 
currently 0 watt usage.

Original comment by lalelu...@gmail.com on 22 Apr 2013 at 4:40

GoogleCodeExporter commented 9 years ago
FIxed with current Version 115

Original comment by lalelu...@gmail.com on 23 Jun 2013 at 12:52

GoogleCodeExporter commented 9 years ago

Original comment by lalelu...@gmail.com on 24 Jun 2013 at 5:01