Page 1 of 1

Standard dzVents template afterMin

Posted: Tuesday 21 November 2017 21:39
by DomoticaRob
There is an error in the standard dzVents template:

afterMin.png
afterMin.png (23.01 KiB) Viewed 1133 times

It must be:

afterMin2.png
afterMin2.png (16.93 KiB) Viewed 1133 times

Suc6!

Re: Standard dzVents template afterMin

Posted: Wednesday 22 November 2017 8:16
by dannybloe
Ah, good catch. Fixed it in the next version. Thanks.

Re: Standard dzVents template afterMin

Posted: Thursday 30 November 2017 22:04
by DomoticaRob
Hello Danny,

I have cachet another one:

I think it must be scenes.

scenes.png
scenes.png (57.05 KiB) Viewed 1061 times
Suc6!

Re: Standard dzVents template afterMin

Posted: Thursday 30 November 2017 22:05
by DomoticaRob
Can I make my own template?

Where is it stored?

Re: Standard dzVents template afterMin

Posted: Thursday 30 November 2017 22:07
by dannybloe
Not really. It is sort of hard coded into the editor unfortunately :(

Re: Standard dzVents template afterMin

Posted: Thursday 30 November 2017 22:36
by DomoticaRob
No problem.

I made my own already, called it dz_Template.lua, start with this one, make my changes and save it with a new name.

Re: Standard dzVents template afterMin

Posted: Thursday 30 November 2017 22:47
by dannybloe
what's the template look like?

Re: Standard dzVents template afterMin

Posted: Sunday 03 December 2017 11:15
by DomoticaRob
Hello Danny,

I just use yours with the two corrections -> 'afterMin' and 'scenes'

As soon as I have some time I will make a more extended version with statements I will use often.

Code: Select all

-- Check the wiki at
-- http://www.domoticz.com/wiki/%27dzVents%27:_next_generation_LUA_scripting
return {

	-- 'active' controls if this entire script is considered or not
	active = true, -- set to false to disable this script

	-- trigger
	-- can be a combination:
	on = {
		devices = {
			-- scripts is executed if the device that was updated matches with one of these triggers
			'device name', -- device name
			'abc*', -- triggers for all devices which name begins with abc
			258, -- id
		},

		timer = {
			-- timer triggers.. if one matches with the current time then the script is executed
			'at 13:45',
			'at 18:37',
			'every 3 minutes on mon,tue,fri at 16:00-15:00'
		}
	},

	-- actual event code
	-- in case of a timer event or security event, device == nil
	execute = function(domoticz, device)
		--[[

		The domoticz object holds all information about your Domoticz system. E.g.:

		local myDevice = domoticz.devices('myDevice')
		local myVariable = domoticz.variables('myUserVariable')
		local myGroup = domoticz.groups('myGroup')
		local myScene = domoticz.scenes('myScene')

		The device object is the device that was triggered due to the device in the 'on' section above.
		]] --
		-- example
		if (device.state == 'On') then
			device.switchOff().afterMin(2)
			domoticz.notify('Light info', 'The light ' .. device.name .. ' will be switched off soon')
		end
	end
}