I think I should use "domoticz.devices().forEach(function(device)"
But how do I get this function to perform for instance on device 3, 6 and 10?
devices = 3,6,10
domoticz.devices().forEach(function(device)
Or domoticz.devices(3,6,10).forEach(function(device)
And do I understand it correctly that when I use the correct function the execute(dz,device) is not needed anymore?
To push to influx I want to use this code
Code: Select all
local function pushToInfluxdb(idx , nValue, rawData )
local sValue = table.concat(rawData,';')
local nValue = nValue or 0
local url = dz.settings['Domoticz url'] .. '/json.htm?type=command¶m=udevice&idx=' .. idx ..
'&nvalue=' .. nValue ..
'&svalue=' .. sValue
dz.openURL(url)
end
pushToInfluxdb( item.idx, 0, item.rawData )
dz.log('Device ' .. item.name .. item.rawData[1], dz.LOG_DEBUG)