interfacing lacrosse TX3-TH sensors to HAH

9 replies [Last post]
vores8
Offline
Joined: 1 Mar 2012

I have several temperature/humidity sensors located in my house. The are well-known lacrosse TX3-TH, transmitting data on 433 mhz. I have a simple arduino with 433 mhz receiver that receives and decodes the signals.

lacrosse arduino

Arduino is attached to serial port of HAH and feeds serial port with data in the form

id=505,type=t,value=24 (sensor with id 505 transmitted temperature with value of 24 centigrade)

or

id=900,type=h,value=24 (sensor with id 505 transmitted humidity with value of 24%)

Attached sript creates BSC endpoints and updates them from the serial (arduino) data. Endpoints can be displayed in xapflash

th data in xapflash

AttachmentSize
sensorsApplet.lua4.01 KB
brett
Offline
Providence, United States
Joined: 9 Jan 2010
Vores8,When creating a filter

Vores8,

When creating a filter you should filter only for messages originating from the PORT you are after.

f = xap.Filter() 
f:add("xap-header","class","Serial.Comms")
f:add("serial.received","port", port)
f:callback(update)

Then you would not need to bother with this line. As you know you must be having data from the filter.

if  not frame:isValue("Serial.Received", "data", xap.FILTER_ABSENT) then

good stuff.

Brett

vores8
Offline
Joined: 1 Mar 2012
Great, thanks! (and as usual,

Great, thanks! (and as usual, thanks for the gerat software :))

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Vores8,  You code is rather

Vores8,  You're code is rather long.  I've shortened it a little (see attached).  I've not compiled nor tested this but I think you get my drift.   It might just work first time too :)

Brett

AttachmentSize
sensorApplet.lua 1.17 KB
vores8
Offline
Joined: 1 Mar 2012
polished version

I've polished code a bit (see attached). Now it also helps with the situation when u r changig sensor's batteries which results in a new ID being assigned to the sensor. To identify new ID the script creates "unregistered" BSC endpoint which broadcasts data containing new sensor ID - so you just need to sniff these messages with say xfx viewer and modify sensors table accordingly

results happily flow to pachube (9 sensors each with temp and humi)

And again guys, thanks for the great software :)

AttachmentSize
sensorsApplet.lua 3.14 KB
brett
Offline
Providence, United States
Joined: 9 Jan 2010
You should not be using

You should not be using ep:sendInfo() you should be using ep:sendEvent()
xAPBSC.info is only used when no data has been seen for a timeout period when a change of value occurs that you wish to report you should use xAPBSC.event.

If you look at my Applet you would see that I only send an EVENT when the DATA is different.  This is how BSC works.

  if ep.text ~= value then
    ep:setText(value)
    ep:sendEvent()
  end

This is an important point as you are violating the BSC schema specification with your code.  Yes it might work but its not kosher.

Brett

vores8
Offline
Joined: 1 Mar 2012
Hmm... ok, will change it

Hmm... ok, will change it into a kosher code

kaloskagatos
Offline
France
Joined: 26 Nov 2012
Decode TX3-TH signal on arduino

Hi all, hi vores8, I'm planning to buy TX3-TH sensors to interface them with an Arduino. I made some research on the web to check if it has been done before, because I don't have the skills to do the reverse engineering myself. I found one project implementing the TX3 decoding : http://code.google.com/p/arduinoha/ and TH4 decoding https://github.com/kjordahl/Arduino-Weather-Station/ and I found this TX3 protocol description http://www.f6fbb.org/domo/sensors/tx3_th.php

Do you think I will be able to decode TX3 sensor with that ? One thing I can't figure out is : what if two sensor send a packet at the same time ? How did you handle the concurrent computing ? Did you write your own decoding library and maybe could you share it ?

Thanks in advance for your answer,

Johan

derek
Offline
Glasgow, United Kingdom
Joined: 26 Oct 2009
Fire and forget

>One thing I can't figure out is : what if two sensor send a packet at the same time ?

If two of these units happen to transmit at the very same time, the resulting signals will interfere with each other and the receiver won't get a message that it can decode. Fortunately, the transmissions are generally repeated a few times and more often than not, a valid message will get thru.

If you need 'reliable' messaging then you should use a bi-directional transceiver (e.g. http://www.dbzoo.com/livebox/hah_hahnode). These can request that a device send some readings. If the expected reading is not received, you can ask for a re-send.

I know that KevinT did some work with units like these TX3. See his writeup at http://netcompsys.wordpress.com/

Cheers,
Derek.

kaloskagatos
Offline
France
Joined: 26 Nov 2012
Ok, thanks for your answer. I

Ok, thanks for your answer. I am making the design of a controlling system for my electric heaters, and I was considering buying temperature wireless probes to report temperatures from the rooms instead of using 1-wire probes. As you say, I think it's not important if some messages are dropped.

But for the moment I don't have the skills of making the whole reverse engineering process myself. However thank you for the links, I didn't know the JeeNode solution.

Cheers.

Hardware Info