Persistent data not working

Easy to use, 100% Lua-based event scripting framework.
Post Reply
Number8
Posts: 285
Joined: Friday 23 May 2014 7:55
Target OS: Raspberry Pi
Domoticz version: 3.5103
Location: Saint Pierre de Jards
Contact:

Persistent data not working

Post by Number8 » Monday 05 February 2018 11: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
}


User avatar
waaren
Posts: 607
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Persistent data not working

Post by waaren » Monday 05 February 2018 16:39

Number8 wrote:
Monday 05 February 2018 11: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
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave , dzVents 2.4.n, Amazon echo

Number8
Posts: 285
Joined: Friday 23 May 2014 7:55
Target OS: Raspberry Pi
Domoticz version: 3.5103
Location: Saint Pierre de Jards
Contact:

Re: Persistent data not working

Post by Number8 » Monday 05 February 2018 23:15

When one put the finger on it becomes obvious. What a fool I am! Thanks for helping

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest