dzVents new function request

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

Moderator: leecollings

Post Reply
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

dzVents new function request

Post by emme »

Ciao,

I'm approacing dzVents and I'm quite hentusiastic about!
I love the new function included in 2.3.0 and willing to see more in the future :P :P

I would like to ask if you can consider to add some more function like:

.switchOn().once(<period in mins>)
whenever a script is execute, there are action that should not be performed all the time.... so a function that can control this would be nice...
Example: I need to switch on a device once a day, the first time a switch goes on (while the switch can toggle several times a day)

Code: Select all

return {
	on = {
		devices = {
			'myDevice'
		}
	},
	execute = function(domoticz, device)
		if device.state == 'On then domoticz.devices('myDevice2').switchOn().once(1440) -- Once a day
	end
}
the period can be evaluated using the lastUpdate value
I actually workaround this using a variable that I reset all days at midnight

.quit()
well... this is almost an impossible thing.. but... a function that will remove all delayed command will the the best ever way to easely control the system...
Example: I issue a command like domoticz.devices('myDevice').switchOff().afterMin(20)
actually there is no way to remove such command.... the .quit() should be the function that remove the code-scheduled action

...please don't yell at me :oops: :oops: :oops:
ciao
M
The most dangerous phrase in any language is:
"We always done this way"
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: dzVents new function request

Post by dannybloe »

Thanks for the compliments :)
So, the quit() is interesting.... I'd put it differently: mySwitch.cancelSchedule() or something like that. However, it probably requires some changes in Domoticz. I'll ask around if that is possible at all.
The once(xx) is different. I wonder if that is something that should and could be added. Not sure about that.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest