Trying to write three values to influxdb database
Posted: Monday 02 March 2020 22:52
Hi I trying to write at least three values to influxdb database using domoticz.openURL and multiple points to multiple series at the same time by separating each point with a new line as described on https://docs.influxdata.com/influxdb/v1 ... ting_data/
But only the last value "Dom_faza3" is saved:
But only the last value "Dom_faza3" is saved:
Code: Select all
return {
on = {
devices = { 35 }
},
execute = function(domoticz, item)
local totalcurrent_str = domoticz.devices(35) -- three phase current sensor1
local totalcurrent_fer = domoticz.devices(65) -- three phase current sensor2
local totalcurrent_dom = domoticz.devices(69) -- subtraction 1-2 three phase sensor3
totalcurrent_dom.updateCurrent(
totalcurrent_str.current1 - totalcurrent_fer.current1,
totalcurrent_str.current2 - totalcurrent_fer.current2,
totalcurrent_str.current3 - totalcurrent_fer.current3
)
domoticz.openURL({
url = 'http://127.0.0.1:8086/write?db=domoticz&u=domoticz&p=domoticz&precision=ms',
method = 'POST',
-- headers = 'application/x-www-form-urlencoded',
-- callback = 'trigger',
postData = 'Dom_faza1 value='..totalcurrent_dom.current1..'\r\n'..'Dom_faza2 value='..totalcurrent_dom.current2..'\r\n'..'Dom_faza3 value='..totalcurrent_dom.current3
})
end
}