Blame | Last modification | View Log | Download
--[[script to get and decode settings]]--local scriptVar = 'getSettings'local uVarProgram = 'dzSensorTimeout'return{on ={timer = { 'every 30 minutes' , --- change to your liking},httpResponses = { scriptVar,},system = {'start'},},logging ={level = domoticz.LOG_DEBUG, -- change to domoticz.LOG_ERROR when all okmarker = 'Dz-Settings',},execute = function(dz, item)local settingsEncoded ={ClickatellTo = true,HTTPPostContentType = true,HTTPURL = true,EmailUsername = true,EmailPassword = true,ClickatellAPI = true,HTTPPostContentType = true,IFTTTAPI = true,MyDomoticzPassword = true,}local function showSettings(t)for key, value in pairs(t) doif settingsEncoded[key] thenvalue = dz.utils.fromBase64(value)enddz.log(key .. ': ' .. dz.utils._.str(value) )endendif item.isTimer or item.isDevice or item.isSystemEvent thensettingsURL = dz.settings['Domoticz url'] .. '/json.htm?type=settings'dz.openURL({url = settingsURL,callback = scriptVar})elseif item.isJSON then--showSettings(item.json)dz.variables(uVarProgram).set(item.json["SensorTimeout"])dz.log("Trying to get one value, SensorTimeout = " .. item.json["SensorTimeout"], dz.LOG_DEBUG)elsedz.log('There was a problem handling' .. item.trigger, dz.LOG_ERROR)dz.log(item, dz.LOG_DEBUG)endend}