new here ... i trying to transfer sensordata from my second domoticz device to the first using dzvents scripting.
So far i have a start, but i can't get it up and runing ...
Code: Select all
local server = ('http://192.168.xxx.xxx:xxxx')
local callbackString = ('RemoteDataPush_callback')
return {
on = {
--devices = {},
timer = {
'every minute',
},
--variables = {},
--scenes = {},
--groups = {},
--security = {},
httpResponses = {
callbackString,
},
--customEvents = {},
--system = {},
},
logging = {
-- level = domoticz.LOG_ERROR, marker = "ERROR Logging ",
-- level = domoticz.LOG_DEBUG, marker = "DEBUG Logging ",
level = domoticz.LOG_INFO, marker = "INFO Logging ",
marker = "Tempz",
},
execute = function(domoticz, item, info)
local T_Woonk = domoticz.devices('Woonkamer') --94 THP
local T_Kantoor = domoticz.devices('Kantoor') --13 TP
local T_Slaapk = domoticz.devices('Slaapkamer') --95 THP
local T_Keuken = domoticz.devices('Keuken') --96 THP
local T_Slaapk = domoticz.devices('Balkon') --80 TH
local T_Keuken = domoticz.devices('Hal') --98 THP
if (item.isTimer) then
domoticz.openURL({url = server .. '/json.htm?type=command¶m=udevice&idx=' .. 94 ..'&nvalue=0&svalue=' .. T_Woonk.temperature .. ";" .. T_Woonk.humidity .. ";" .. T_Woonk.humidityStatus .. ";" .. T_Woonk.pressure .. ";" .. forecast, callback = callbackString})
elseif (item.isHTTPResponse) then
if (item.json.status == 'OK') then
domoticz.log('Updated the remote device succesfully.')
domoticz.log(item.json)
else
domoticz.log('Something went wrong updating the remote device', domoticz.LOG_ERROR)
domoticz.log(item.json, domoticz.LOG_ERROR)
end
else
domoticz.log('Unknown script trigger.', domoticz.LOG_ERROR)
end
end
}

Harry