tellstick duo

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
User avatar
jaha
Posts: 55
Joined: Thursday 26 January 2017 10:26
Target OS: Linux
Domoticz version:
Contact:

tellstick duo

Post by jaha »

Hi

trying to add telldus duo to my domoticz.

Running version 3.5837

Tdtool --list works and shows:

PROTOCOL MODEL ID TEMP HUMIDITY RAIN WIND LAST UPDATED
fineoffset temperaturehumidity 135 24.2° 20% 2017-02-02 16:15:02
fineoffset temperature 136 0.6° 2017-02-02 16:14:19

system@domoticz:~$



I can add tillstick via hardware tab in the browser but under devices my temp sensors are not showing up.
ldd ./domoticz | grep telldus then I get nothing. I should see this? libtelldus-core.so.2 => /usr/lib/libtelldus-core.so.2 (0xb6c02000)
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: tellstick duo

Post by PeGe »

Well, I really wouldn't expect it to work, since there are obviously some known limitations:
Right now there is only support for dimmers and on/off switches ...
In my case, I still also have some old "junkyard candidate" 433 MHz hardware up and running, but on a separate Raspberry Pi. Among a few other things, that envioronment communicates with an Oregon outdoor thermo-/hygometer, storing the temperature and humidity values received from that constantly chattering device.

With my more critical devices now operating on a less noisy frequency band, but that old sensor still working fine, I decided to keep it "as-is" and just grab the values for replication on a custom sensor device in my newer Domoticz environment, otherwise primarily used for Z-Wave equipment.

As I said, my Tellstick Duo runs on a separate Raspberry Pi, but that does not actually make any big difference for the solution I implemented. It just makes the (quick-and-dirty) code below slightly more complex, since I need to do an "ssh" call to the old Raspberry Pi that is hosting the Tellstick Duo. Which of course is easy to modify if the Tellstick Duo is instead locally connected. But still; This is the LUA script I'm using:

Code: Select all

-- Script name: script_time_Outdoor.lua

commandArray = {}
local m = os.date('%M')

if (m % 5 == 0) then
        print("Reading and updating outdoor sensor values")
        local sensorId = 27
        local handle = io.popen('ssh [email protected] tdtool --list-sensors | grep "id=246" | awk -F" " \'{print $5,$6}\'')
        if (handle) then
                local s = handle:read("*a")
                local t = s:gsub('temperature=',''):gsub(' humidity=',';'):match( "^%s*(.-)%s*$" ) .. ';0'
                commandArray[1] = {['UpdateDevice'] = sensorId .. '|0|' .. tostring(t)}
        end
end

return commandArray
Some explanations:
1. The variable "sensorId" refers to the index number of my virtual sensor in Domoticz.
2. The hard-coded string "id=246" matches the sensor id seen when executing "tdtool --list-sensors" on the old system. (Sure, it would have been nicer to use a variable, but I said it was a "quick-and-dirty"...)
3. Since the device doesn't provide any third value, which the virtual sensor expects, I simply pad on ";0" at the end of the value string.
4. The initial "if (m % 5 == 0)" limits the updates to 5 minute intervals.

No rocket science, but it works for me! You'll definitely have to tweak it to make it work for you, but at least you now have a skeleton...

/P-G
User avatar
jaha
Posts: 55
Joined: Thursday 26 January 2017 10:26
Target OS: Linux
Domoticz version:
Contact:

Re: tellstick duo

Post by jaha »

PeGe wrote:Well, I really wouldn't expect it to work, since there are obviously some known limitations:
Right now there is only support for dimmers and on/off switches ...
In my case, I still also have some old "junkyard candidate" 433 MHz hardware up and running, but on a separate Raspberry Pi. Among a few other things, that envioronment communicates with an Oregon outdoor thermo-/hygometer, storing the temperature and humidity values received from that constantly chattering device.

With my more critical devices now operating on a less noisy frequency band, but that old sensor still working fine, I decided to keep it "as-is" and just grab the values for replication on a custom sensor device in my newer Domoticz environment, otherwise primarily used for Z-Wave equipment.

As I said, my Tellstick Duo runs on a separate Raspberry Pi, but that does not actually make any big difference for the solution I implemented. It just makes the (quick-and-dirty) code below slightly more complex, since I need to do an "ssh" call to the old Raspberry Pi that is hosting the Tellstick Duo. Which of course is easy to modify if the Tellstick Duo is instead locally connected. But still; This is the LUA script I'm using:

Code: Select all

-- Script name: script_time_Outdoor.lua

commandArray = {}
local m = os.date('%M')

if (m % 5 == 0) then
        print("Reading and updating outdoor sensor values")
        local sensorId = 27
        local handle = io.popen('ssh [email protected] tdtool --list-sensors | grep "id=246" | awk -F" " \'{print $5,$6}\'')
        if (handle) then
                local s = handle:read("*a")
                local t = s:gsub('temperature=',''):gsub(' humidity=',';'):match( "^%s*(.-)%s*$" ) .. ';0'
                commandArray[1] = {['UpdateDevice'] = sensorId .. '|0|' .. tostring(t)}
        end
end

return commandArray
Some explanations:
1. The variable "sensorId" refers to the index number of my virtual sensor in Domoticz.
2. The hard-coded string "id=246" matches the sensor id seen when executing "tdtool --list-sensors" on the old system. (Sure, it would have been nicer to use a variable, but I said it was a "quick-and-dirty"...)
3. Since the device doesn't provide any third value, which the virtual sensor expects, I simply pad on ";0" at the end of the value string.
4. The initial "if (m % 5 == 0)" limits the updates to 5 minute intervals.

No rocket science, but it works for me! You'll definitely have to tweak it to make it work for you, but at least you now have a skeleton...

/P-G

Hi thanks for your input, actually got it working with sensors. First installing the telldus core, and then getting the newest domoticz version and then running cmake /make :D
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest