Data not in InfluxDB
Posted: Friday 13 March 2020 17:21
Hello.
From other post I understood that virtual device will not be pushed to Inlux even if you set this up in settings - push data - influx.
I found a program that I modified and put in dzVents. After start I do not get any error message but it is not shown in the influx database.
In the log file I get this series of messges.
What do I do wrong??
Edit
I now see that the setting in Domoticz ( at settings - push data - influxdb.) is 8086 while it posts the data to 8080. But I see nowhere in the script where I can adapt that.
From other post I understood that virtual device will not be pushed to Inlux even if you set this up in settings - push data - influx.
I found a program that I modified and put in dzVents. After start I do not get any error message but it is not shown in the influx database.
Code: Select all
return {
on = {
devices = {
'WP Opgewekt'
}
},
logging = { level = domoticz.LOG_DEBUG,
marker = 'Push to Influx',
},
execute = function(dz, item)
dz.log('Device ' .. item.name .. ' was changed ' .. item.rawData[1], dz.LOG_DEBUG)
local function pushToInfluxdb(idx , nValue, myData )
local nValue = nValue or 0
dz.log('idx: ' .. idx, dz.LOG_DEBUG)
dz.log('nValue: ' .. nValue, dz.LOG_DEBUG)
dz.log('sValue: ' .. myData, dz.LOG_DEBUG)
local url = dz.settings['Domoticz url'] .. '/json.htm?type=command¶m=udevice&idx=' .. idx ..
'&nvalue=' .. nValue ..
'&svalue=' .. myData
dz.openURL(url)
end
pushToInfluxdb(64, 0, tostring(dz.devices(64).rawData[1]))
end
}Code: Select all
2020-03-13 17:08:06.157 Status: dzVents: Debug: Push to Influx: Device WP Opgewekt was changed 1564
2020-03-13 17:08:06.157 Status: dzVents: Debug: Push to Influx: idx: 64
2020-03-13 17:08:06.157 Status: dzVents: Debug: Push to Influx: nValue: 0
2020-03-13 17:08:06.158 Status: dzVents: Debug: Push to Influx: sValue: 1564
2020-03-13 17:08:06.158 Status: dzVents: Debug: Push to Influx: OpenURL: url = http://127.0.0.1:8080/json.htm?type=command¶m=udevice&idx=64&nvalue=0&svalue=1564
2020-03-13 17:08:06.158 Status: dzVents: Debug: Push to Influx: OpenURL: method = GET
2020-03-13 17:08:06.159 Status: dzVents: Debug: Push to Influx: OpenURL: post data = nil
2020-03-13 17:08:06.159 Status: dzVents: Debug: Push to Influx: OpenURL: headers = nil
2020-03-13 17:08:06.159 Status: dzVents: Debug: Push to Influx: OpenURL: callback = nil
Edit
I now see that the setting in Domoticz ( at settings - push data - influxdb.) is 8086 while it posts the data to 8080. But I see nowhere in the script where I can adapt that.