Page 1 of 1
timer, every 5 minutes ?
Posted: Thursday 15 March 2018 21:11
by tontze
Do i remember wrong, or DID domoticz have "every nn:nn" timer at some point under switch preferences ?
I would like to flip a switch every 5 minutes, but i really cannot use "on time" for this ...
-T
Re: timer, every 5 minutes ?
Posted: Thursday 15 March 2018 22:54
by waaren
You need a script to do this. With dzVents it would be very simple to implement.
Code: Select all
return {
on = { timer = {"every 5 minutes"} },
execute = function(domoticz, _)
local myDevice = domoticz.devices("your device name")
if myDevice.state == "On" then
myDevice.switchOff()
else
myDevice.switchOn()
end
end
}
Re: timer, every 5 minutes ?
Posted: Friday 16 March 2018 6:38
by tontze
dont have dzvents, what it looks like in lua ?
Re: timer, every 5 minutes ?
Posted: Friday 16 March 2018 7:19
by waaren
dzVents is integrated in domoticz. So unless you have a very old version of domoticz you should have it.
[ad alert] dzVents /diː ziː vɛnts/, short for Domoticz Easy Events, brings Lua scripting in Domoticz to a whole new level. Writing scripts for Domoticz has never been so easy. Not only can you define triggers more easily, and have full control over timer-based scripts with extensive scheduling support, dzVents presents you with an easy to use API to all necessary information in Domoticz. No longer do you have to combine all kinds of information given to you by Domoticz in many different data tables. You don't have to construct complex commandArrays anymore. dzVents encapsulates all the Domoticz peculiarities regarding controlling and querying your devices. And on top of that, script performance has increased a lot if you have many scripts because Domoticz will fetch all device information only once for all your device scripts and timer scripts. And ... it is 100% Lua! So if you already have a bunch of event scripts for Domoticz, upgrading should be fairly easy. [ad alert]
Re: timer, every 5 minutes ?
Posted: Friday 16 March 2018 20:32
by tontze
waaren wrote: Friday 16 March 2018 7:19
dzVents is integrated in domoticz. So unless you have a very old version of domoticz you should have it.
[ad alert] dzVents /diː ziː vɛnts/, short for Domoticz Easy Events, brings Lua scripting in Domoticz to a whole new level. Writing scripts for Domoticz has never been so easy. Not only can you define triggers more easily, and have full control over timer-based scripts with extensive scheduling support, dzVents presents you with an easy to use API to all necessary information in Domoticz. No longer do you have to combine all kinds of information given to you by Domoticz in many different data tables. You don't have to construct complex commandArrays anymore. dzVents encapsulates all the Domoticz peculiarities regarding controlling and querying your devices. And on top of that, script performance has increased a lot if you have many scripts because Domoticz will fetch all device information only once for all your device scripts and timer scripts.
And ... it is 100% Lua! So if you already have a bunch of event scripts for Domoticz, upgrading should be fairly easy. [ad alert]
Ah okay, i just remember back in time when i installed it for the test
