Standard dzVents template afterMin

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

Moderator: leecollings

Post Reply
DomoticaRob
Posts: 80
Joined: Sunday 29 November 2015 14:03
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.9700
Location: Halle, the Netherlands
Contact:

Standard dzVents template afterMin

Post by DomoticaRob »

There is an error in the standard dzVents template:

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

It must be:

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

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

Re: Standard dzVents template afterMin

Post by dannybloe »

Ah, good catch. Fixed it in the next version. Thanks.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
DomoticaRob
Posts: 80
Joined: Sunday 29 November 2015 14:03
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.9700
Location: Halle, the Netherlands
Contact:

Re: Standard dzVents template afterMin

Post by DomoticaRob »

Hello Danny,

I have cachet another one:

I think it must be scenes.

scenes.png
scenes.png (57.05 KiB) Viewed 1060 times
Suc6!
DomoticaRob
Posts: 80
Joined: Sunday 29 November 2015 14:03
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.9700
Location: Halle, the Netherlands
Contact:

Re: Standard dzVents template afterMin

Post by DomoticaRob »

Can I make my own template?

Where is it stored?
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: Standard dzVents template afterMin

Post by dannybloe »

Not really. It is sort of hard coded into the editor unfortunately :(
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
DomoticaRob
Posts: 80
Joined: Sunday 29 November 2015 14:03
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.9700
Location: Halle, the Netherlands
Contact:

Re: Standard dzVents template afterMin

Post 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.
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: Standard dzVents template afterMin

Post by dannybloe »

what's the template look like?
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
DomoticaRob
Posts: 80
Joined: Sunday 29 November 2015 14:03
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.9700
Location: Halle, the Netherlands
Contact:

Re: Standard dzVents template afterMin

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

Who is online

Users browsing this forum: No registered users and 1 guest