Page 1 of 1

Persistent data not working

Posted: Monday 05 February 2018 10:06
by Number8
Hello
This is driving me nuts.
I can't get this piece of code working. Am I doing something wrong ( 3.8199 on RaspPI). Log always returns nil.
Thank you

Code: Select all

return {
	active = true, -- optional
	on = { 
		--timer = {'every 1 minutes'}
		devices = { 'test' }
	},
	data = {
		previousTime = { initial = 5 }
	},
	logging = { 
		level = domoticz.LOG_INFO,
		marker = 'meteo'
	},
	execute = function (	domoticz, meteohubGet )
		print ('Previous time stamp value : ' .. tostring(previousTime))
		domoticz.data.previousTime = domoticz.data.previousTime + 1
	end
}


Re: Persistent data not working

Posted: Monday 05 February 2018 15:39
by waaren
Number8 wrote: Monday 05 February 2018 10:06 Hello
This is driving me nuts.
I can't get this piece of code working. Am I doing something wrong ( 3.8199 on RaspPI). Log always returns nil.
Thank you

Code: Select all

return {
	active = true, -- optional
	on = { 
		--timer = {'every 1 minutes'}
		devices = { 'test' }
	},
	data = {
		previousTime = { initial = 5 }
	},
	logging = { 
		level = domoticz.LOG_INFO,
		marker = 'meteo'
	},
	execute = function (	domoticz, meteohubGet )
		print ('Previous time stamp value : ' .. tostring(previousTime))
		domoticz.data.previousTime = domoticz.data.previousTime + 1
	end
}

try

Code: Select all

print ('Previous time stamp value : ' .. tostring(domoticz.data.previousTime))
:D

Re: Persistent data not working

Posted: Monday 05 February 2018 22:15
by Number8
When one put the finger on it becomes obvious. What a fool I am! Thanks for helping