Page 1 of 1

tellstick duo

Posted: Thursday 02 February 2017 16:15
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)

Re: tellstick duo

Posted: Friday 03 February 2017 15:39
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

Re: tellstick duo

Posted: Tuesday 07 February 2017 18:08
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