dzvents script does not trigger

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

Moderator: leecollings

Post Reply
manjh
Posts: 859
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

dzvents script does not trigger

Post by manjh »

I am very sure this is a solid user error on my side, but I have been staring at this for a while and simply donot see what is wrong.
I want to create a dzvents script that is triggered every minute.
Using the Domoticz editor, I created a script:
Name "test", type "dzVents", triggered by "all" (I also tried "timer")

Code could not be simpler:

Code: Select all

return {
	active = true,
	on = {
		['timer'] = 'every 1 minutes'
	},
	execute = function(domoticz)

		domoticz.log('@@@@@@@@@@@@@@@@@@@@@@@@@@ test', domoticz.LOG_INFO)

	end
}
I expect to see the line of text every minute, but nothing happens.
Checked in Setup-->Settings-->Other: dzVents is enabled, log is on "Errors+forced messages".

As said, I am sure I am missing something but I don't see it.

Help?
Hans
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: dzvents script does not trigger

Post by dannybloe »

Please look at the timer examples in the documentation carefully. You have to use the proper syntax:

Code: Select all

on = {
    timer = { 'every minute' }
}
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
manjh
Posts: 859
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: dzvents script does not trigger

Post by manjh »

dannybloe wrote: Monday 08 October 2018 19:22 Please look at the timer examples in the documentation carefully. You have to use the proper syntax:

Code: Select all

on = {
    timer = { 'every minute' }
}
Thanks, makes sense. It was a user error, but in my defense: I "borrowed" a script from the forum and inherited the error... :mrgreen:

It now stumbles over this statement:

Code: Select all

local minutes = domoticz.devices[name].lastUpdate.minutesAgo
Error is "attempt to index field 'devices' (a function value)".
Hans
manjh
Posts: 859
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: dzvents script does not trigger

Post by manjh »

Sorry, got it. Similar mistake.
This one works:

Code: Select all

local minutes = domoticz.devices(name).lastUpdate.minutesAgo
Hans
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest