15.09.2022, 09:23
You're sending string data (10:57 and Thu 15-09-2022) which Influx does not understand. String values must be enclosed in quotes.
Try replacing lines 35..42 with this:
Currently this script sends values for all objects. There should be some filtering implemented so only the required data is pushed.
Try replacing lines 35..42 with this:
Code:
local body
if type(value) == 'boolean' or type(value) == 'number' then
body = string.format('%s,name=%s,addr=%s state=%s', table, name, addr, value)
elseif type(value) == 'string' then
body = string.format('%s,name=%s,addr=%s value=%q', table, name, addr, value)
else
log('invalid data type', addr, type(value))
return
end
Currently this script sends values for all objects. There should be some filtering implemented so only the required data is pushed.