Posts in category tellstick-duo

New ways to script execution from signals

If you have tried to script tasks for TellStick and TellStick Duo you know it is very easy using tdtool. But tdtool is limited to only transmitting signals. What if you want to react on incoming signals from TellStick Duo?

If you want to script execution on incoming signals you either need to script in a third party application such as NexaHome or EventGhost or you need to write your own deamon and listen for callback. Both variants has it quirks. For example you need Windows for EventGhost.

What do you do if you have an headless Linux computer? Or you just don't want the complicated setup with callbacks?

From version 2.1.2 we have added the possibility to add a script to a predefined directory. Any executable script found in those folders will be executed and the parameters are sent as environmental variables. Let's first show an example. Create the file /usr/local/share/telldus/scripts/sensorevent/myscript.sh with the following content and make it executable.

#!/bin/bash
if [ "${DATATYPE}" -eq 1 ]; then
        notify-send --expire-time 3000 "Temperature ${VALUE}°C"
fi

When a sensor is detected the currently temperature will be shown as a popup in my KDE environment.

All callbacks from the C API are available.

/usr/local/share/telldus/scripts/deviceevent/
Environmental variables: DEVICEID, METHOD, METHODDATA
C API equivalent: TDDeviceEvent

/usr/local/share/telldus/scripts/devicechangeevent/
Environmental variables: DEVICEID, CHANGEEVENT, CHANGETYPE
C API equivalent: TDDeviceChangeEvent

/usr/local/share/telldus/scripts/rawdeviceevent/
Environmental variables: RAWDATA, CONTROLLERID
C API equivalent: TDRawDeviceEvent

/usr/local/share/telldus/scripts/sensorevent/
Environmental variables: PROTOCOL, MODEL, SENSORID, DATATYPE, VALUE, TIMESTAMP
C API equivalent: TDSensorEvent

/usr/local/share/telldus/scripts/controllerevent/
Environmental variables: CONTROLLERID, CHANGEEVENT, CHANGETYPE, VALUE
C API equivalent: TDControllerEvent

After adding or removing a script you need to restart telldusd.

For now, this is a Linux only feature. Patches are welcome for other platforms.

Source code for TellStick Duo released

A while ago we released the source code for TellStick Net. We have now also released it for TellStick Duo.

It is released from our servers as well as GitHub and Gitorious.
TellStick Duo
 https://github.com/telldus/tellstick-duo
 https://gitorious.org/telldus/tellstick-duo

For installation instructions see the README

Python for TellStick

Did you know that Python can be used to control a TellStick or TellStick Duo?

Our examples show you how to interact with the library directly using ctypes but there is also three third party wrappers to ease the development.

The first one is also based on ctypes but hides the nasty details of the c-library such as memory cleanup. Please check it out:  https://bitbucket.org/davka003/pytelldus/

The second one is a native wrapper. This has been merged to our repository here: bindings/python/native

The third one also provides a object oriented interface. Available on github:  https://github.com/erijo/telldus-py

So if you are a Python fan, go on and write applications for TellStick using your favourite language.

Barbeque

We have just verified that the Weber Style Digital Thermometer works great with TellStick Duo and TellStick Net. It is a wireless thermometer for food.

From the manufacturer:

Your feasts will never be over or underdone again with this digital thermometer. Simply insert the probe into the food, select the doneness setting, and clip on the remote. The thermometer beeps when your food is done.

Why not barbeque like you should in the 21th century? Keep the meat perfect with your smartphone.

http://c777793.r93.cf2.rackcdn.com/Weber_Style_Digital_Thermometer700x350.jpg  http://www.weber.com/accessories/product-detail/66