Is there interest for Tellstick (Duo) support?

Others (MiLight, Hue, Toon etc...)

Moderator: leecollings

Zuikkis
Posts: 43
Joined: Monday 20 February 2017 17:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Is there interest for Tellstick (Duo) support?

Post by Zuikkis »

Melotron wrote:Can you add Telldus live support this way, or do I need to have a usb stick ?

Regards Magnus Svensson
Telldus Live works fine with dummy device and domoticz_main script.

You just need tdtool.py:

http://developer.telldus.se/attachment/ ... sensors.py

That works just like the "tdtool" command, but uses Live server instead. You don't need to install telldusd or any other software, just this one python script. Run it once to get authentication credentials, it stores them to tdtool.conf.

Here is my script.. It is based on some script I found on this forum. :) It caches switch id's to /tmp/telldus.lst. The file is recreated if switch id is not found, for example if you have just added new one. You must use same switch name in domoticz and Telldus Live.

Code: Select all

#!/bin/bash

startup_path=$1
hardware_id=$2
device_id=$3
status=$4
status2=$5
devname=$6
LOGFILE=/dev/null

echo "startup_path=${startup_path}, hardware_id=${hardware_id}, device_id=${device_id}, status=${status}, status2=${status2}, devname=${devname}" >>$LOGFILE

# Tellstick Hardware has hardware_id=5
if [ "${hardware_id}" = "5" ] ; then

# tdtool commands are always lowercase whereas Domoticz uses mixed case for status. tdcmd is either "on" or "off" after this
  tdcmd=${status2,,}

# if command is to dim device we need to find dimlevel and set that
# Domoticz uses the status "Set Level: [n] %" where n is the dimlevel to use
  tmp="${tdcmd%:*}"
  if [ "$tmp" = "set level" ] ; then
# Get percentage which is found between : and %
    tmp="${tdcmd#*:}"
    dimlevel="${tmp//%/}"
# Tellstick dim level are 0-255 so we need to convert percentage
    dimlevel=$((dimlevel*255/100))
# Set tdtool command to use
    tdcmd="dim"
  fi

# get device id from name
telldus_id=`grep -w "$devname" /tmp/telldus.lst | cut -f1`
if [ 0$telldus_id -eq 0 ]; then
    /home/pi/SMA-EM/tdtool.py --list >/tmp/telldus.lst
    telldus_id=`grep -w "$devname" /tmp/telldus.lst | cut -f1`
fi

# Execute Tellstick command
# We need both command and devname set to execute tdtool
  if [ "${tdcmd}" != "" ] && [ "${tdcmd}" != "" ] ; then
    if [ "${tdcmd}" = "dim" ] ; then
      echo "Setting dim level for" $devname "to" $dimlevel >>$LOGFILE
      /home/pi/SMA-EM/tdtool.py --dimlevel $dimlevel --dim "$telldus_id" >>$LOGFILE
    else
      echo "Changing" "$devname" "to" $tdcmd >>$LOGFILE
      /home/pi/SMA-EM/tdtool.py --$tdcmd "$telldus_id" >>$LOGFILE
    fi
  fi

fi
# End of Tellstick section
Zuikkis
Posts: 43
Joined: Monday 20 February 2017 17:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Is there interest for Tellstick (Duo) support?

Post by Zuikkis »

A short update for Tellstick Net users..

There exists a modified firmware which has local access, instead of going through Telldus Live. This has the big advantage of having instant switch times, and more reliability because you don't rely on external servers.

You need a slightly modified telldusd running on your server too.

With this firmware and telldusd, Tellstick Net works directly with Domoticz internal Tellstick support. Sensors and everything.

Details here:
http://developer.telldus.com/ticket/114
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests