Is there any way to use dzVents to run SQL queries directly on the database?
I tried to search the forum for this but the search ignores "SQL" because it is less than four characters

Moderator: leecollings
Not natively but via popen it can be doneChrisKerswell wrote: ↑Friday 24 August 2018 1:17 Hi,
Is there any way to use dzVents to run SQL queries directly on the database?
I tried to search the forum for this but the search ignores "SQL" because it is less than four characters![]()
Code: Select all
return {
on = { devices = { "your trigger device" }},
logging = { level = domoticz.LOG_DEBUG,
marker = "dataBase query" },
execute = function(dz)
local command = 'sqlite3 tempdatabase.db \"select distinct(DeviceRowID) from Temperature_Calendar\" '
local handle = assert(io.popen(command))
for line in handle:lines() do
dz.log(line,dz.LOG_DEBUG)
end
handle:close()
end
}
Users browsing this forum: No registered users and 0 guests