Persistent data not working

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
Number8
Posts: 374
Joined: Friday 23 May 2014 7:55
Target OS: Linux
Domoticz version: 2022.1
Location: Saint Pierre de Jards
Contact:

Persistent data not working

Post 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
}

Debian buster on NUC and three RPi with buster.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Persistent data not working

Post 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
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Number8
Posts: 374
Joined: Friday 23 May 2014 7:55
Target OS: Linux
Domoticz version: 2022.1
Location: Saint Pierre de Jards
Contact:

Re: Persistent data not working

Post by Number8 »

When one put the finger on it becomes obvious. What a fool I am! Thanks for helping
Debian buster on NUC and three RPi with buster.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest