I must say that I really hate LUA .. I'm more familiar with PHP and other stuff than this s**tty LUA ...

I've done a API for my 3D printer and it's returning JSON.
If the JSON value is not equal to Domoticz then update Domoticz
I'm trying to get my LUA script to compare 2 values.
Using the HTTP poller plugin
Code: Select all
-- Retrieve the request content
s = request['content'];
local g_enclosure_temp = domoticz_applyJsonPath(s,'g_enclosure_temp')
local g_job_name = domoticz_applyJsonPath(s,'g_job_name')
local g_bed_temp_actual = domoticz_applyJsonPath(s,'g_bed_temp_actual')
local g_tool_temp_actual = domoticz_applyJsonPath(s,'g_tool_temp_actual')
commandArray = {}
if g_job_name ~= commandArray ["3D Print file"] then
domoticz_deviceChanged(3520,'',g_job_name)
end
return commandArray
