more G-Labs products

Author Topic: AeonLabs Multisensor - negative temperatures displayed incorrectly  (Read 3627 times)

December 30, 2014, 01:50:28 PM
Read 3627 times

sylwesterr

  • *
  • Information
  • Newbie
  • Posts: 4
Hi,

I have, on my RPi B+ installed HG, Z-Wave Stick (latest one) and Mutisensor configured. The problem is that the negative temperatures (below 0 centigrade) are displayed as for example at this moment: 6546,7 - that is the representation of -6,8 degrees C, I assume, as my "analogue" thermometer shows around -7, and in addition: (65535/10)-6546,7=6,8 - does it make sense?.

So, my question is, is that something that can be corrected by configuration or is it a bug in some HG binary?

Cheers,
Sylwester

December 30, 2014, 03:52:41 PM
Reply #1

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Perhaps this is an HG bug.
Could you provide debug output when temperature is reported from sensor?
eg.
Code: [Select]
SPI > 01 0C 00 04 00 16 06 31 05 01 2A 03 3B C0
You'll have to run HG from a terminal in order to get debug messages from Z-Wave controller.

Cheers,
g.

December 30, 2014, 10:45:22 PM
Reply #2

NicoVermeir

  • ****
  • Information
  • Sr. Member
  • Posts: 122
    • My blog
I can confirm this, getting the same bug.
will check for debug output when it starts freezing again

December 31, 2014, 01:29:23 PM
Reply #3

sylwesterr

  • *
  • Information
  • Newbie
  • Posts: 4
Hi,

Here is the data:

[13:16:01.919123] SPI > 01 0C 00 04 08 04 06 31 05 01 22 FF EC F9

I believe that's what you need.
Let me know if you need additional data.

Cheers,
Sylwester

P.S. Happy new year :)


December 31, 2014, 02:29:54 PM
Reply #4

sylwesterr

  • *
  • Information
  • Newbie
  • Posts: 4
Some more data:

[14:28:02.434286] SPI > 01 09 00 04 08 04 03 80 03 29 57
[14:28:02.436840] SPO < 06
2014-12-31T14:28:02.4408020+01:00       HomeAutomation.ZWave    4       ZWave Node      ZWaveNode.Battery       41
2014-12-31T14:28:02.4546170+01:00       HomeAutomation.ZWave    4       ZWave Node      Status.Battery  41
[14:28:02.489522] SPI > 01 09 00 04 00 04 03 80 03 29 5F
[14:28:02.491793] SPO < 06
2014-12-31T14:28:02.4931620+01:00       HomeAutomation.ZWave    4       ZWave Node      ZWaveNode.Battery       41
2014-12-31T14:28:02.5080570+01:00       HomeAutomation.ZWave    4       ZWave Node      Status.Battery  41
[14:28:02.893504] SPI > 01 0C 00 04 08 04 06 31 05 03 0A 03 BC 7F
[14:28:02.895720] SPO < 06
2014-12-31T14:28:02.9002190+01:00       HomeAutomation.ZWave    4       ZWave Node      Sensor.Luminance        956.0
[14:28:02.946048] SPI > 01 0C 00 04 00 04 06 31 05 03 0A 03 BC 77
[14:28:02.948461] SPO < 06
2014-12-31T14:28:02.9538260+01:00       HomeAutomation.ZWave    4       ZWave Node      Sensor.Luminance        956.0
[14:28:03.551153] SPI > 01 0C 00 04 08 04 06 31 05 05 01 4D 00 80
[14:28:03.553301] SPO < 06
2014-12-31T14:28:03.5600960+01:00       HomeAutomation.ZWave    4       ZWave Node      Sensor.Humidity 77.0
[14:28:03.603356] SPI > 01 0C 00 04 00 04 06 31 05 05 01 4D 00 88
[14:28:03.605581] SPO < 06
2014-12-31T14:28:03.6074660+01:00       HomeAutomation.ZWave    4       ZWave Node      Sensor.Humidity 77.0
[14:28:04.057375] SPI > 01 0C 00 04 08 04 06 31 05 01 22 FF EF FA
[14:28:04.059632] SPO < 06
2014-12-31T14:28:04.0634920+01:00       HomeAutomation.ZWave    4       ZWave Node      Sensor.Temperature      6551.9
[14:28:04.109737] SPI > 01 0C 00 04 00 04 06 31 05 01 22 FF EF F2
[14:28:04.112076] SPO < 06
2014-12-31T14:28:04.1202770+01:00       HomeAutomation.ZWave    4       ZWave Node      Sensor.Temperature      6551.9
[14:28:04.564225] SPI > 01 08 00 04 00 04 02 84 07 76
[14:28:04.566839] SPO < 06


January 01, 2015, 05:30:45 PM
Reply #5

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Have no clue on how to convert

01 0C 00 04 08 04 06 31 05 01 22 FF EF FA

FF EF to something close to a -7 value.

Are you sure this is not a bug of the device? Have you tried updating firmware?
@NicoVermeir have you done some testing about this issue already?

Cheers,
g.

January 02, 2015, 08:42:19 AM
Reply #6

NicoVermeir

  • ****
  • Information
  • Sr. Member
  • Posts: 122
    • My blog
haven't done any testing no, just seeing this bug as soon as the temperature drops below zero (I'm on the latest sensor firmware).

a quick search does show that it's not HG related, here's a review from Amazon:

Quote
As long as the temperature is above 32 degrees Fahrenheit they report accurate temperature. However once the temperature falls below freezing all bets are off. Somewhere between freezing and 0 deg. F. the temperature reports start showing up as 6000 degrees or higher. This makes it more of a challenge to trigger events based on temperature. For example, I wanted to switch the heater in a bird bath on when the temperature is below 35 degrees. It works great until the temperature report jumps to 11820 degrees so the heater goes off and the water freezes.

Motion detection becomes unpredictable at cold temperatures as well. They will detect my presence one time and not the next.
I might believe that I just have a bad device, but all four of the outdoor devices have the same issue, while the indoor unit works fine.

I contacted Aeon Labs support about these issues, I was told that they are not designed to work at "such low temperatures". They blame the Z-Wave modules for this limitation. They say the working temperature is 5-140 degrees F.

http://www.amazon.com/Aeon-Labs-Aeotec-Z-Wave-Multi-Sensor/product-reviews/B008D5TYGU

January 02, 2015, 10:08:06 AM
Reply #7

NicoVermeir

  • ****
  • Information
  • Sr. Member
  • Posts: 122
    • My blog
quick update:

I've contacted aeotec support about this, they told me the same story as the guy on Amazon, that the outside temp probably falls outside of sensor range. I told him that according to the specs it should operate in the -20°C - 60°C range and that it's currently only -1°C outside.

awaiting response now, I'll keep you posted

January 02, 2015, 09:16:53 PM
Reply #8

sylwesterr

  • *
  • Information
  • Newbie
  • Posts: 4
Guys,

I think it should not be difficult. Considering the fact that in computers world everything is based on binary system, it is clear that Aeon Labs uses the "2's compliment" representation of negative numbers (see: http://simple.wikipedia.org/wiki/Signed_number_representations).
In case of FFEF you have:
0xFFEF=1111 1111 1110 1111 = 65519
if you flip the bits you get:
0x0010=0000 0000 0001 0000 = 16
tadaaaa :)
that means that FFEF is: -1.6 degrees Celsius

If working on hex you can subtract the value from FFFF (65535) or if working in decimal, you can subtract the value from 65535 and divide it by 10.

Hope that it helps :)

January 02, 2015, 09:52:52 PM
Reply #9

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Thanks for the hint... but how do I test the value in order to know that is a negative one?
Is there a "negative" bit to be tested against?

g.

January 02, 2015, 09:56:26 PM
Reply #10

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
"It's like sign and magnitude; a negative number starts with a 1 and a positive number starts with a 0."

so it is the first bit to be tested I guess. But is it just Aeon Labs convention or will this work for Z-Wave protocol in general?

g.

January 02, 2015, 10:44:08 PM
Reply #11

NicoVermeir

  • ****
  • Information
  • Sr. Member
  • Posts: 122
    • My blog
just got a reply from aeon support, they're taking it up with the engineers. I should here from them within 24 hours.

guess they'll have the answer :)

January 02, 2015, 11:02:16 PM
Reply #12

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
I ended up porting this piece of code:

https://github.com/dcuddeback/open-zwave/blob/master/cpp/src/command_classes/CommandClass.cpp#L289

For the input:
01 0C 00 04 08 04 06 31 05 01 22 FF EF FA

it returns -1,7.

g.

January 02, 2015, 11:09:07 PM
Reply #13

RoChess

  • ***
  • Information
  • Full Member
  • Posts: 61
I just scored some Fibaro 4-in-1 motion sensors last week (dare I say adorable, the size of a ping pong ball, on lithium CR123A battery so more accurate in freezing temperatures).

Their manual includes the engineering info, and they state for their temperature:

66. TEMPERATURE OFFSET
The value to be added to the actual temperature, measured by the
sensor (temperature compensation).
Available settings: 0 - 100 (0 to 100oC) or 64536 - 65535 (-100 to
-0.10oC)
Default setting: 0
Parameter size: 2 [bytes]

With 65535 = 0xFFFF

Now this is the offset to manually calibrate/adjust their sensor, but I assume the actual temperature values follow the same method (have not debugged it yet, and it is currently +2C outside).

Perhaps Aeon-Labs follows the same principle? I have two of those as well, so will be able to test.

January 02, 2015, 11:11:37 PM
Reply #14

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
I uploaded r453 that should fix the issue:

https://sourceforge.net/projects/homegenie/files/testing/

please help testing all of these:

03/01/2015 1.00 beta rev 453
    - Fixed bug introduced with r452 and that was preventing modules config from being saved
    - Fixed parsing of negative sensor values in ZWaveLib
    - Fixed "NaN" issue in group values indicator for locales using "," as decimal separator
    - Added modules.xml fields encryption
    - Fixed missing scheduler config restore from a backup

Cheers,
g.