Basic Tellstick functionality with Domoticz/Install Telldus core latest release RaspberryPi
This guide shows how to setup the latest Telldus core software for controlling remote switches using a Tellstick USB device on a Raspberry PI.
To prepare your Raspberry Pi with Domoticz, follow this guide: Preparing_RaspberryPI_(Debian-Wheezy)_for_Domoticz
Information source
The information in this document is compiled with a lot of help from this source.
Disclaimer
This haven't been verified 100% yet, feel free to test and update the wiki page with your findings
Download software
Command to download the latest source code from Trunk for Tellstick software.
git clone http://git.telldus.com/telldus.git
Install prerequisites
Install the required software to build the source code.
sudo apt-get install libftdi1 libftdi-dev libconfuse0 libconfuse-dev
Build the software
Enter the subfolder telldus and its subfolder telldus-core.
cd telldus/telldus-core/
Configure
Configure the source code from Trunk for the hardware.
sudo cmake -DFORCE_COMPILE_FROM_TRUNK=True
Compile
Compile the source code.
sudo make
Example output:
[ 1%] Building CXX object common/CMakeFiles/TelldusCommon.dir/Event.cpp.o [ 3%] Building CXX object common/CMakeFiles/TelldusCommon.dir/Message.cpp.o [ 5%] Building CXX object common/CMakeFiles/TelldusCommon.dir/Mutex.cpp.o [ 7%] Building CXX object common/CMakeFiles/TelldusCommon.dir/Strings.cpp.o [ 9%] Building CXX object common/CMakeFiles/TelldusCommon.dir/Thread.cpp.o [ 11%] Building CXX object common/CMakeFiles/TelldusCommon.dir/Event_unix.cpp.o [ 13%] Building CXX object common/CMakeFiles/TelldusCommon.dir/EventHandler_unix.cpp.o [ 15%] Building CXX object common/CMakeFiles/TelldusCommon.dir/Socket_unix.cpp.o Linking CXX static library libTelldusCommon.a [ 15%] Built target TelldusCommon Scanning dependencies of target telldusd [ 17%] Building CXX object service/CMakeFiles/telldusd.dir/ClientCommunicationHandler.cpp.o [ 19%] Building CXX object service/CMakeFiles/telldusd.dir/Controller.cpp.o [ 21%] Building CXX object service/CMakeFiles/telldusd.dir/ControllerManager.cpp.o [ 23%] Building CXX object service/CMakeFiles/telldusd.dir/ControllerMessage.cpp.o [ 25%] Building CXX object service/CMakeFiles/telldusd.dir/Device.cpp.o [ 27%] Building CXX object service/CMakeFiles/telldusd.dir/DeviceManager.cpp.o [ 29%] Building CXX object service/CMakeFiles/telldusd.dir/Log.cpp.o [ 31%] Building CXX object service/CMakeFiles/telldusd.dir/Sensor.cpp.o [ 33%] Building CXX object service/CMakeFiles/telldusd.dir/Settings.cpp.o [ 35%] Building CXX object service/CMakeFiles/telldusd.dir/TelldusMain.cpp.o [ 37%] Building CXX object service/CMakeFiles/telldusd.dir/TellStick.cpp.o [ 39%] Building CXX object service/CMakeFiles/telldusd.dir/Timer.cpp.o [ 41%] Building CXX object service/CMakeFiles/telldusd.dir/EventUpdateManager.cpp.o [ 43%] Building CXX object service/CMakeFiles/telldusd.dir/ConnectionListener_unix.cpp.o [ 45%] Building CXX object service/CMakeFiles/telldusd.dir/main_unix.cpp.o [ 47%] Building CXX object service/CMakeFiles/telldusd.dir/SettingsConfuse.cpp.o [ 49%] Building CXX object service/CMakeFiles/telldusd.dir/TellStick_libftdi.cpp.o [ 50%] Building CXX object service/CMakeFiles/telldusd.dir/Protocol.cpp.o [ 52%] Building CXX object service/CMakeFiles/telldusd.dir/ProtocolBrateck.cpp.o [ 54%] Building CXX object service/CMakeFiles/telldusd.dir/ProtocolComen.cpp.o [ 56%] Building CXX object service/CMakeFiles/telldusd.dir/ProtocolEverflourish.cpp.o [ 58%] Building CXX object service/CMakeFiles/telldusd.dir/ProtocolFineoffset.cpp.o [ 60%] Building CXX object service/CMakeFiles/telldusd.dir/ProtocolFuhaote.cpp.o [ 62%] Building CXX object service/CMakeFiles/telldusd.dir/ProtocolGroup.cpp.o [ 64%] Building CXX object service/CMakeFiles/telldusd.dir/ProtocolHasta.cpp.o [ 66%] Building CXX object service/CMakeFiles/telldusd.dir/ProtocolIkea.cpp.o [ 68%] Building CXX object service/CMakeFiles/telldusd.dir/ProtocolMandolyn.cpp.o [ 70%] Building CXX object service/CMakeFiles/telldusd.dir/ProtocolNexa.cpp.o [ 72%] Building CXX object service/CMakeFiles/telldusd.dir/ProtocolOregon.cpp.o [ 74%] Building CXX object service/CMakeFiles/telldusd.dir/ProtocolRisingSun.cpp.o [ 76%] Building CXX object service/CMakeFiles/telldusd.dir/ProtocolSartano.cpp.o [ 78%] Building CXX object service/CMakeFiles/telldusd.dir/ProtocolScene.cpp.o [ 80%] Building CXX object service/CMakeFiles/telldusd.dir/ProtocolSilvanChip.cpp.o [ 82%] Building CXX object service/CMakeFiles/telldusd.dir/ProtocolUpm.cpp.o [ 84%] Building CXX object service/CMakeFiles/telldusd.dir/ProtocolWaveman.cpp.o [ 86%] Building CXX object service/CMakeFiles/telldusd.dir/ProtocolX10.cpp.o [ 88%] Building CXX object service/CMakeFiles/telldusd.dir/ProtocolYidong.cpp.o Linking CXX executable telldusd [ 88%] Built target telldusd Scanning dependencies of target telldus-core [ 90%] Building CXX object client/CMakeFiles/telldus-core.dir/CallbackDispatcher.cpp.o [ 92%] Building CXX object client/CMakeFiles/telldus-core.dir/CallbackMainDispatcher.cpp.o [ 94%] Building CXX object client/CMakeFiles/telldus-core.dir/Client.cpp.o [ 96%] Building CXX object client/CMakeFiles/telldus-core.dir/telldus-core.cpp.o Linking CXX shared library libtelldus-core.so Copying OS X content client/Headers/telldus-core.h [ 96%] Built target telldus-core Scanning dependencies of target tdtool [ 98%] Building CXX object tdtool/CMakeFiles/tdtool.dir/main.cpp.o Linking CXX executable tdtool [ 98%] Built target tdtool Scanning dependencies of target tdadmin [100%] Building CXX object tdadmin/CMakeFiles/tdadmin.dir/main.cpp.o Linking CXX executable tdadmin [100%] Built target tdadmin
Install
Install the software (it will be installed into /usr/local).
sudo make install
Example output:
[ 15%] Built target TelldusCommon [ 88%] Built target telldusd [ 96%] Built target telldus-core [ 98%] Built target tdtool [100%] Built target tdadmin Install the project... -- Install configuration: "" -- Installing: /usr/local/sbin/telldusd -- Installing: /etc/tellstick.conf -- Installing: /var/state/telldus-core.conf -- Installing: /usr/local/lib/libtelldus-core.so.2.1.2 -- Installing: /usr/local/lib/libtelldus-core.so.2 -- Installing: /usr/local/lib/libtelldus-core.so -- Installing: /usr/local/include/telldus-core.h -- Installing: /usr/local/bin/tdtool -- Removed runtime path from "/usr/local/bin/tdtool" -- Installing: /usr/local/sbin/tdadmin -- Removed runtime path from "/usr/local/sbin/tdadmin" -- Installing: /etc/udev/rules.d/05-tellstick.rules -- Installing: /usr/local/share/telldus-core/helpers/udev.sh
After installation, update the system's library cache.
sudo ldconfig
Install service
Before the switches can be used, the telldusd service daemon must be running (and the Tellstick must be connected to your Raspberry PI).
Create an init-script for the service by copying and modifying the /etc/init.d/skeleton file.
cd /etc/init.d sudo cp skeleton telldusd
Open the newly created file in your favorite editor (as root with sudo) and do these changes:
Line 3, change:
# Provides: skeleton
into:
# Provides: telldusd
Line 8-10, change:
# Short-Description: Example initscript # Description: This file should be used to construct scripts to be # placed in /etc/init.d.
into:
# Short-Description: Tellstick service daemon # Description: Tellstick service daemon controlling remote switches. #
Line 20-24, change:
PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC="Description of the service" NAME=daemonexecutablename DAEMON=/usr/sbin/$NAME DAEMON_ARGS="--options args"
into:
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin DESC="Tellsick service daemon" NAME=telldusd DAEMON=/usr/local/sbin/$NAME DAEMON_ARGS=""
Make the script executable.
sudo chmod +x telldusd
Test the init-script by starting the service and checking its status.
sudo service telldusd start sudo service telldusd status
Install the script to start at boot.
sudo update-rc.d telldusd defaults
Configure receivers
The software is configured with the /etc/tellstick.conf file. Since there are many types of receivers supported by Tellstick this document will not cover configuration options. For more information on configuration, please see http://developer.telldus.com/wiki/TellStick_conf.
Here is an example configuration using one Waveman receiver. The house and unit parameters is where you setup different switches.
user = "nobody" group = "plugdev" ignoreControllerConfirmation = "false" device { id = 1 name = "Livingroom lights" protocol = "waveman" model = "codeswitch" parameters { house = "A" unit = "1" } }
Each time you change the configuration, you also need to restart the service daemon.
sudo service telldusd restart
Test
To turn on a switch (the number is the device id for the switch in the configuration file).
tdtool --on 1
To turn off a switch.
tdtool --off 1
Done!
You have now the core software for controlling remote receivers using a Tellstick installed. Now you can go ahead and do more amazing things!
For example:
- install a web server and create a web page where you can control switches
- schedule switching on and off lights using cron
- and much more...
References
<references/>