Introduction
In the previous posts, I explained my motivation and how to setup FHEM with a jeelink (v3) USB RF stick.
Here I will describe how to connect the LaCrosse TX 29 IT temperature/humidity sensors to FHEM.
Requirements
- FHEM setup
- jeelink (v3)
- LaCrosse TX 29 ITDH sensor
Installation
The jeelink adapter can only handle one sketch per device. This is a limitation today but might change in the future. A sketch is, non-technically speaking, a definition used to adjust the device to particular sensor vendors.
- Download Flash file (http://sourceforge.net/p/fhem/code/HEAD/tree/trunk/fhem/contrib/arduino/)
cd /opt/fhem/contrib/arduino wget http://sourceforge.net/p/fhem/code/HEAD/tree/trunk/fhem/contrib/arduino/36_LaCrosse-LaCrosseITPlusReader.zip?format=raw -O 36_LaCrosse-LaCrosseITPlusReader.zip
- Unzip FLASH file
mkdir 36_LaCrosse-LaCrosseITPlusReader cd mkdir 36_LaCrosse-LaCrosseITPlusReader unzip ../36_LaCrosse-LaCrosseITPlusReader.zip
- Flash (FHEM) for LaCrosse
- In version 5.5 of FHEM this has to be done manually.
- Install helper tool
apt-get install avrdude
- Stop FHEM (just to ne on the save side)
/etc/init.d/fhem stop
- Flash jeelink
avrdude -p atmega328P -c arduino -P /dev/ttyUSB0 -D -U flash:w:/opt/fhem/contrib/arduino/36_LaCrosse-LaCrosseITPlusReader/HexFiles/LaCrosseITPlusReader10.hex
- Start FHEM
/etc/init.d/fhem start
- Install helper tool
- In later versions you can do this more comfortable.
- In version 5.5 of FHEM this has to be done manually.
attr myJeeLink0 hexFile /opt/fhem/contrib/arduino/36_LaCrosse-LaCrosseITPlusReader/HexFiles/LaCrosseITPlusReader10.hex
- Start flashing
set myJeeLink0 flash
- In version 5.5 of FHEM this has to be done manually.
- In version 5.5 of FHEM this has to be done manually.
Register and Define Sensors
After installing you can power-up your sensor(s). Best is, to do it one-by-one to be able to identify them more easily.
When you put the batteries in the sensor, it gets a random identifier. This we use to assign information and setup data.
- Put in Battery
- Look in log for an unknown device
tail -f log/fhem-2014-09.log
Define Temperature and Humidity Graph
- Define the sensor directly in the config file fhem.cfg (is is much easier)
###################### # Temperature / humidity sensors ## Office: 3D define 01Thermo LaCrosse 3D attr 01Thermo IODev myJeeLink0 attr 01Thermo alias Office attr 01Thermo event-min-interval state:60 attr 01Thermo group Temperatures attr 01Thermo icon scene_office attr 01Thermo room Plots #attr 01Thermo doAverage 1 define FileLog_01Thermo FileLog ./log/01Thermo-%Y.log 01Thermo:T:.* attr FileLog_01Thermo logtype temp4hum6:Temp/Hum,text define weblink_01Thermo SVG FileLog_01Thermo:weblink_01Thermo:CURRENT attr weblink_01Thermo alias Office attr weblink_01Thermo title "Office" attr weblink_01Thermo label "Temp. min.: $data{min1} °C, max: $data{max1} °C, Last: $data{currval1} °C __ Hum. min.: $data{min2} %, max: $data{max2} %, Last: $data{currval2} %" attr weblink_01Thermo room Plots
I had some problems, that FHEM was complaining about not finding weblink_01Thermo.gplot. To solve this, I played around a little and came up with the following solution – not nice but working:
Track Battery status
- Define the sensor directly in the config file fhem.cfg (is is much easier)
# LaCrosse Battery reading define rg_battery readingsGroup TYPE=LaCrosse:battery attr rg_battery alias Batteriestatus attr rg_battery commands { "battery.low" => "set %DEVICE replaceBatteryForSec 60" } attr rg_battery valueIcon {'battery.ok' => 'batterie', 'battery.low' => 'batterie\@red'}
Final Words
I added about 7 sensors and everything works fine. I am not yet happy about the log, because sometimes there is no entry for much more than 1 minute.