Is there interest for Tellstick (Duo) support?

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

Moderator: leecollings

Rivvern
Posts: 6
Joined: Thursday 08 September 2016 10:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Rivvern »

Will do!
Rivvern
Posts: 6
Joined: Thursday 08 September 2016 10:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Rivvern »

It worked, as soon as i set the permissions to correctly. Thanks! (Check marked the Execute/Enter on the scripts).

But creating two scripts for each switch is pretty tedious.
Id rather use the script below. Anyone had any luck getting it to work?
Brighthead wrote:In the below script I've taken a slightly different path than in the scripts above: Instead of using the device id I use the device name. This means that the script does not need to be changed whenever I add or remove a device from Domoticz. Obviously tellstick.conf needs to be changed so that the devices have the exact same name in tellstick.conf and Domoticz.

I've also implemented basic DIM functionality in addition to just ON and OFF. This setup works perfectly for me. I'm running Domoticz and tdtool on a Raspberry B (256MB) with a USB-connected Tellstick (original).
Please let me know of any improvements you can see.

Note that the script requires BASH rather than SH as some builtin functionality is used.

Code: Select all

#!/bin/bash

startup_path=$1
hardware_id=$2
device_id=$3
status=$4
status2=$5
devname=$6
LOGFILE=<filename of logfile or /dev/null>

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

# This part of the script interfaces with a Tellstick device via tdtool
#
# Requirements: A working Tellstick installation with tdtool and configured tellstick.conf
#               All controlled devices needs to be defined with exactly the same name in tellstick.conf and Domoticz.
#               The device type in Domoticz can be anything. I use X10 as I am not using that for anything else.
#               To identify Tellstick devices a Dummy virtual device needs to be defined in Domoticz. I named it "Tellstick" and Domoticz
#               assigned it hardware_id "2" which is what the logic below uses to determine if it is a Tellstick device

# Tellstick Hardware has hardware_id=2
if [ "${hardware_id}" = "2" ] ; 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

# 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
      tdtool --dimlevel $dimlevel --dim "$devname" >>$LOGFILE
    else
      echo "Changing" "$devname" "to" $tdcmd >>$LOGFILE
      tdtool --$tdcmd "$devname" >>$LOGFILE
    fi
  fi

fi
# End of Tellstick section
Flopp
Posts: 279
Joined: Sunday 03 January 2016 14:55
Target OS: -
Domoticz version:
Location: Sweden
Contact:

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

Post by Flopp »

Rivvern wrote:It worked, as soon as i set the permissions to correctly.
Please tell me what you had to do with permission so I can add it to the Guide.

"sudo chmod 777 script.sh" ?
Rivvern wrote:Check marked the Execute/Enter on the scripts.
Please explain
Rivvern
Posts: 6
Joined: Thursday 08 September 2016 10:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Rivvern »

Well. I didnt use putty to change the permission so i dont know the syntax.
I was browsing the file structure with WinSCP when i right clicked my scripts noticing the lack of permissions.
Flopp
Posts: 279
Joined: Sunday 03 January 2016 14:55
Target OS: -
Domoticz version:
Location: Sweden
Contact:

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

Post by Flopp »

Thanks
Flopp
Posts: 279
Joined: Sunday 03 January 2016 14:55
Target OS: -
Domoticz version:
Location: Sweden
Contact:

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

Post by Flopp »

Updated 1. with correct link
viewtopic.php?f=17&t=7807&p=95905#p95905
bjacobse
Posts: 85
Joined: Tuesday 06 September 2016 9:08
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Sorø, DK
Contact:

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

Post by bjacobse »

I am trying to get Tellstick working in Domoticz. And I am unsure which path to follow.
Tellstick is working via command line, amd I have added the tellstick in Hardware - no devices will show up in Devices.
I try to manually add in the switch upper left corner, Manual Light/Switch. I am not able to have the test to switch on my Lamp/switch
tellstick_CMD_ on.png
tellstick_CMD_ on.png (8.33 KiB) Viewed 3457 times
I can se that my lamp is switched on, CMD is working
tell_conf.png
tell_conf.png (15.88 KiB) Viewed 3457 times
hw.png
hw.png (114.61 KiB) Viewed 3457 times
bjacobse
Posts: 85
Joined: Tuesday 06 September 2016 9:08
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Sorø, DK
Contact:

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

Post by bjacobse »

And then I will add this lamp manually in Domoticz - but I am not able to switch the lamp on?
IS this approach wrong? and I should go and use the "old" way with dummy switches hat are executing shell scripts?
manual_switch.png
manual_switch.png (28.27 KiB) Viewed 3457 times
my system is RPI3
uname -a
Linux bjadomoticz 4.4.26-v7+ #915 SMP Thu Oct 20 17:08:44 BST 2016 armv7l GNU/Linux

Domoticz ver 3.5837 updated a few days ago with /domoticz/updaterelease script
(I have not tried Tellstick with older Domoticz variants)
Flopp
Posts: 279
Joined: Sunday 03 January 2016 14:55
Target OS: -
Domoticz version:
Location: Sweden
Contact:

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

Post by Flopp »

bjacobse wrote:And then I will add this lamp manually in Domoticz - but I am not able to switch the lamp on?
IS this approach wrong? and I should go and use the "old" way with dummy switches hat are executing shell scripts?
manual_switch.png
my system is RPI3
uname -a
Linux bjadomoticz 4.4.26-v7+ #915 SMP Thu Oct 20 17:08:44 BST 2016 armv7l GNU/Linux

Domoticz ver 3.5837 updated a few days ago with /domoticz/updaterelease script
(I have not tried Tellstick with older Domoticz variants)
See my post above(number 36), my guide should be ok if not please tell me and I will change any faults.
Yes, use old way with dummy and script
bjacobse
Posts: 85
Joined: Tuesday 06 September 2016 9:08
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Sorø, DK
Contact:

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

Post by bjacobse »

Ok,
Then I will make an update guide
bjacobse
Posts: 85
Joined: Tuesday 06 September 2016 9:08
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Sorø, DK
Contact:

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

Post by bjacobse »

Create a dummy device: Setup->Hardware
hw_dummy_device.png
hw_dummy_device.png (150.18 KiB) Viewed 3437 times
Create a dummy device: Click on "Create virtual Sensors" and add a device name that makes sense for you. Mine is a Kitchen Pouls Henningsen 43cm lamp
dummy_sw.png
dummy_sw.png (14.2 KiB) Viewed 3437 times
goto your "Switch" tab that contains all your switches, and search in the bottom at the page
Click "Edit" and add your stuff like I did (My device id is 5 in etc/tellstick.conf)
edit_dummy_sw.png
edit_dummy_sw.png (118.56 KiB) Viewed 3437 times
You shall use the device id that you have in your /etc/tellstick.conf
bjacobse
Posts: 85
Joined: Tuesday 06 September 2016 9:08
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Sorø, DK
Contact:

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

Post by bjacobse »

place this script here: /domoticz/scripts

Code: Select all

 touch tellstick_script
chmod a+x tellstick_script

to create and make it executeable

My script:

Code: Select all

#!/bin/bash
# Domoticz Script to execute tellstick commands via dummy device
# Created 2016,by Brian Jacobsen, [email protected]
# execute command like below, action is "on" or "off" device id is from etc/tellstick.conf
# tellstick_script action  device id
# example:
# tellstick_script off 5
# tellstick_script on 2

tdtool  --$1 $2
Last edited by bjacobse on Friday 04 November 2016 20:49, edited 1 time in total.
bjacobse
Posts: 85
Joined: Tuesday 06 September 2016 9:08
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Sorø, DK
Contact:

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

Post by bjacobse »

Then the script is used for all your Tellstick dummy devices, add a device switch for each device id that you have in your /etc/tellstick.conf (read: replace "5" with maybe "2" or "3" )
Lillios
Posts: 8
Joined: Sunday 04 December 2016 22:07
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Lillios »

Where should the script be placed.
You have two scripts, one "to make it executeable"?

For me it is not working.
If i use Putty i can send command tdtool -n 1 or tdtool --on 1 and it is working.
But cant get it working in Domoticz.
Melotron
Posts: 62
Joined: Tuesday 22 November 2016 21:04
Target OS: Linux
Domoticz version: 2020.2
Location: Gothenburg
Contact:

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

Post by Melotron »

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

Regards Magnus Svensson
bjacobse
Posts: 85
Joined: Tuesday 06 September 2016 9:08
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Sorø, DK
Contact:

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

Post by bjacobse »

Lillios wrote:Where should the script be placed.
You have two scripts, one "to make it executeable"?

For me it is not working.
If i use Putty i can send command tdtool -n 1 or tdtool --on 1 and it is working.
But cant get it working in Domoticz.
I have only 1 script and it's placed in your home folder/pi and then : /domoticz/scripts
bjacobse
Posts: 85
Joined: Tuesday 06 September 2016 9:08
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Sorø, DK
Contact:

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

Post by bjacobse »

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

Regards Magnus Svensson
Sorry I'm not able to support/add Telldus live
Uffe
Posts: 2
Joined: Monday 06 February 2017 21:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.6630
Location: Gothenburg, SE
Contact:

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

Post by Uffe »

Is the only way to get Tellstick DUO support to use this Dummy hardware and Virtual Devices?

I use an RPI2
I downloaded the latest version of Domoticz
Downloaded and compiled Telldus Core. Telldus core works and I can turn on and off lamps using tdtool
I can also receive my sensors

When I start Domoticz and select add HW I can see Tellstick as an option, but when added I can see no devices. Shouldn't this list be populated from tellsick.conf?

If I have to use virtual devices how do I recieve my sensor signals?

I've been running HA for a long time and is already automating alot, but this is my first attempt with Domoticz.
I'm planning on adding z-wave support on my RPI, but I wanted to make sure I can use my old Tellstick DUO as well since I have over 20 devices connected.

Thanks for all help I can get.

/Uffe
User avatar
PeGe
Posts: 25
Joined: Tuesday 31 January 2017 14:21
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.6328
Location: Sollentuna, Sweden
Contact:

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

Post by PeGe »

I don't know if it helps you at all, but I recently posted the following:

http://www.domoticz.com/forum/viewtopic ... 06#p118006

It might be somewhat useful, when/if you want to grab and replicate the sensor values from your Tellstick Duo.

/P-G
Uffe
Posts: 2
Joined: Monday 06 February 2017 21:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.6630
Location: Gothenburg, SE
Contact:

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

Post by Uffe »

Thanks, but not really what I was after. My main concern is if it's possible to use the Tellstick without using Dummy hardware and virtual devices
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests