pointbre / node-red-contrib-rflink

A Node-red node to encode/decode the messages from/to the RFLink gateway.
MIT License
2 stars 5 forks source link

Negative temperature calculation error #4

Closed kisamartin closed 6 years ago

kisamartin commented 6 years ago

Node translate negative temperature incorrectly.

800a calculates to 3277.8 degree, should be -1

from Rflink protocol http://www.rflink.nl/blog2/protref

TEMP=9999 => Temperature celcius (hexadecimal), high bit contains negative sign, needs division by 10 (0xC0 = 192 decimal = 19.2 degrees) => (example negative temperature value: 0x80DC, high bit indicates negative temperature 0xDC=220 decimal the client side needs to divide by 10 to get -22.0 degrees

Exampel

RFlink message:

20;ED;DKW2012;ID=002c;TEMP=800a;HUM=99;WINSP=0000;WINGS=0018;RAIN=007b;WINDIR=0008;BAT=OK;

After rflink node

msg.payload : Object object name: "DKW2012" id: "002c" temp: 3277.8 hum: 99 winsp: 0 wings: 24 rain: 12.3 windir: 8 bat: "OK"

pointbre commented 6 years ago

Hi, I believe the recent change done by fab33 has fixed this issue.

vzorglub commented 5 years ago

Hello @pointbre , That recent change was not committed or at least has not made it's way to npm. When loading the node through node-red, the negative temps are returned as '0' The current npm code doesn't have the changes done by @fab33