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