Hello,
Im new with Lua programming and im trying to make a little script without the
user variables. Im looking for a solution with local variables.
An example of my code:
commandArray = {}
local variable = uservariables['WhatsappTimer']
if (otherdevices['Test schakelaar 1'] == 'On') then
variable = 1 AFTER 3 SECONDS
commandArray['Test schakelaar 1'] = 'Off'
end
if (variable == 1) then
commandArray['Test schakelaar 2'] = 'On'
variable = (0)
end
return commandArray
Is it possible to make a script like this without the uservariable WhatsappTimer?
Local variables
Moderator: leecollings
-
- Posts: 744
- Joined: Saturday 30 May 2015 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Contact:
Re: Local variables
Instead of changing the variable to 1 after 3 seconds, why not simply switch the 2nd switch instead? Afterwards you can switch off switch 1.
When you are still learning lua, I'd advise you to use the domoticz dzvents for LUA. Much more straightforward than the original LUA scripting within domoticz.
When you are still learning lua, I'd advise you to use the domoticz dzvents for LUA. Much more straightforward than the original LUA scripting within domoticz.
Who is online
Users browsing this forum: No registered users and 1 guest