Temperature measurement on hahnodes
Got my second hahnode working - I thought I would connect it to the hot water tank.
It works however I get a flip from +51degrees to -51 degrees as you can see from the
24 hour track on https://cosm.com/feeds/13194?pachube_redirect=true
Feed number 6
The DS18B20 datasheet says it does -50 to plus 125 degrees celsius.
But the roomnode.lua refers to -50 to +50 so presumably I am going out of range.
I can also see in the change log the following:
Allow HAHnodes a temperature offset like r376. It does this with toff and toff2 as part of the HAHnode endpoint configuartion. Wiki will need updating after this has been released.
So is the solution to put a toff entry somewhere (livebox.ini) to at least get the graph looking right
and then try and find a way to change the -50/+50 range to -20/+80 or somesuch?
Ideas in aid of my crude programming skills much appreciated.
Regards
Kim
Here is a solution for you that might work.
Copy the roomNode.lua applet into /etc/plugboard and rename it something like boilerNode.lua
Modify this line in the file and remove the sign bit for the 10 bits of data coming from the Node.
Find This -> local li, mo, hu, te, lo = jeenode.bitslicer(data,8,1,7,-10, 1)
Modify like this -> local li, mo, hu, te, lo = jeenode.bitslicer(data,8,1,7,10, 1)
Modify your jeeNodeApplet.lua and use this newly modifyed node type.
BoilerNode = require("boilerNode").RoomNode
Then you should be able to use it like the standard room node except now the temperature will be in the range 0..102.4C as long as you're boiler is below that limit you should be good.
Brett
Kim,
You are making a bit of a dogs breakfast of my instructions.
They where brief and assumed some knowledge about how things work. It would seem you are missing this knowledge and perhaps I should have been a little more verbose in my explanation.
At least you had fun trying - now when I give you the solution as files I know you've given it your best effort !
Given I'm not now trying to tell you how to do it as I'm supplying code I've made other changes beyond my instructions to make it more clear. The jeenodeApplet.lua is for example purposes to show you how the boilernode could be used - don't use it.
If you compare the boilernode.lua with roomnode.lua you'll see there are very minimal changes involved.
- rename the class from RoomNode to BoilerNode
- change the module location path as its hosted locally in /etc/plugboard
- change the 10bits so that the sign bit isn't interpreted
Enjoy, Brett
Attachment | Size |
---|---|
boilernode.lua | 1.53 KB |
jeenodeApplet.lua | 1008 bytes |
The are only 10 bits assigned to the temperature structure being sent over the RF. A range of 10 bits [ -2^(n-1) to 2^(n-1)-1 where n in the number of bit ] will give -512 to 511 so our range is -51.2c to 51.1c
This code was not modifed when forked from the JeeLabs RoomNode sketch only the PIR logic was fixed. Really the right solution would be to allocate 12 bits to the temperature giving a range of -204.8 to 204.7 which more than covers the dynamic range of the DS18B20 and them some.
There is no problem with me making the code changes BUT, and this is the big BUT, everybody will need to reflash every room node that they currently have operational at the same time as they upgrade to a later version of the HAH that has this change in the roomnode.lua code.
Hacking with toff and toff2 really isn't the right solution to this problem.
Brett