For my apps I receive occasional donations. I thought I would give it a good use. Well, according to my wife it is an absolutely senseless investment. But hey, it was only 30 euro, and I had never created a 433MHz app before. So here we go.
I bought this device to be able to see how full my rain barrel is.
Since Homey’s 433 range is terrible, I do hope that Homey can receive the signal. The barrel is only 8m outside the wall where my Homey is placed. Edit: I just installed it on the rain barrel outside, and yes Homey receives the data .
After receiveing the device I started to record the signal. It appears to be sent exactly every 3 minutes. I used GTKWave to visualize the signal:
I know it has temperature, distance and maybe battery state in there. Googling for TF-FT002 I discovered that the protocol was already figured out by others. Unfortunately I also found out that there are multiple ‘flavors’ of this protocol, and my flavor had not been deciphered by anyone yet. So a time consuming reverse engineering effort was started by me.
First step was to figure out the type of signal. It looked like ones and zero’s were encoded as different pulse-timings. Also I saw that the signal always had the same starting bits. I used that info to set up a Homey app that would trigger reception on the starting sequence, and to decode the pulse-timings into a string of bits.
Secondly I slowly increased the temperature of the sensor by 0.1 degrees, and kept everything else unchanged. I figured that a 0.1 change in temp would shift one bit somewhere.
Actually multiple bits changed, and I figured that also a checksum (CRC) was in the signal, probably in the end of the string.
Thirdly, after manually (via excel) breaking up the string of bits in numerous ways I eventually found what parts of the string were forming ‘nibbles’, which are half bytes. But the temperature change only made sense if I inverted the ones and zero’s, and then secondly I needed to reverse 4 bits per nibble, and thirdly I needed to combine 3 nibbles spread randomly across the bit stream, and lastly I had to substract 400 degrees. Wow, I still don’t know how I figured that out. But I did
After figuring out how to decode the temperature, I started to find the distance measurement. The distance is used to know how deep the water level is in my rain barrel. Knowing the crazy thinking of the device developers by now, I soon figured out also how to decode the distance. It appears to be measured in cm (as I was able to confirm with a tape measure).
This weekend I hope to find a battery state or battery alarm. I put some batteries in the device that were empty (or so I thought), but the sensor has been able to run on them already for 2 days without a battery alarm . I will try putting it in my fridge and see if the batteries start dying then.
So stay tuned for more progress. EDIT: The app is finished