Bug in Plugin?

Posted on
Mon Feb 11, 2013 3:02 am
Sevilsivle offline
Posts: 122
Joined: Jan 11, 2013

Bug in Plugin?

Hi Robert,

first of all, thanks for providing us with the plugin. Being in Europe the possibilities for automation are pretty limited if you don't go for a full blown EIB/KNX system. Which not only cost thousands, you need to have the control wiring in place which usually rules out fitting it in an existing home. Therefore the relatively cheap and simple solution with the RFXCOM unit, compatible devices and Indigo is ideal.

I think however, that I have discovered a bug in the plugin.
I am using several different thermometers together with an RFXtrx433 and the plugin.
The temperatures are captured to a file every 15 minutes.
Now that the temperatures have dropped below 0°c I have noticed that the Max and Min values are no longer correct. It appears that the calculation does not take the "negative" part into account. So if during the day the temperature reaches +3 degrees and then goes down to -4 during the night the max is given as -4 and the min as 0. This seems to be true for all the sensors I am using, OS type 1, TFA Type 10 and TFA Type 8. I have a TFA Type 7 as well but this is only indoors so I can't see if this is also affected.
I am sure this will be easy to rectify. Let me know if you need more information.

EDIT:
I have checked this again today and the effect is slightly different to what I thought. At 23:45 the readings were
Temp: -3.3 Max:7.6 Min: -0.1 At 00:00 (which I thought would have started a new day) they were the same
Temp: -3.3 Max:7.6 Min: -0.1 At 00:15 they changed to
Temp: -3.4 Max:-3.4 Min: -3.3

The temperature actually then increased during the night up to 0.0 around 10:00 during this time the MIN increased in parallel with the temperature and the MAX stayed at -3.4!
When the temperatures hit 0.0 the MAX went to 0.0 and the MIN to -0.1? although the reading before that was -0.4. Now the MAX is increasing with the temperature and MIN is stuck at 0.0.
The data can be viewed here http://wetter.marston.it Beware! Work in Progress
/EDIT


regards

Tim

Posted on
Fri Feb 15, 2013 8:08 am
Sevilsivle offline
Posts: 122
Joined: Jan 11, 2013

Re: Bug in Plugin?

I think the reason for the problem is the fact that the temperatures are stored as strings in the IndigoDB and are not converted when parsed . The comparison of the new and existing temperatures does not therefore work as expectd as the minus sign is not considered.

regards

Tim

Posted on
Fri Feb 15, 2013 8:45 am
Sevilsivle offline
Posts: 122
Joined: Jan 11, 2013

Re: Bug in Plugin?

I have added a string to float conversion in the CalcMinMax function and this now seems to work correctly.

Code: Select all
else:
            if (float(lastValue) < float(self.tempList[sensor].states[minstateName])):
               self.tempList[sensor].updateStateOnServer(key=minstateName, value=lastValue)
            if (float(lastValue) > float(self.tempList[sensor].states[maxstateName])):
               self.tempList[sensor].updateStateOnServer(key=maxstateName, value=lastValue)


However I am NOT a programmer so this may not be the best solution. I am sure you can sort this out.

regards

Tim

Posted on
Mon Feb 18, 2013 1:47 pm
RJdeKok offline
Posts: 125
Joined: Mar 27, 2012

Re: Bug in Plugin?

Perfect solution, i'll put it in the next version

Posted on
Mon Feb 18, 2013 2:17 pm
Sevilsivle offline
Posts: 122
Joined: Jan 11, 2013

Re: Bug in Plugin?

I'm glad I could help.

regards

Tim

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests