So I literally started using lua probably less than a week ago and pieced together some pretty simple ones. This one basically activated an armed home mode with my system. I am trying to figure out how to make it run only on Sunday through Thursday, its working fine on weekdays so I know the script is okay. Doing things with time and dates are a little confusing and I'm not a programmer, any help is appreciated.
time = os.date("*t")
weekday = os.date("%A")
commandArray = {}
if (time.hour == 22) and (time.min == 30) and (weekday ~= 'Weekend') then
commandArray['Armed Home'] = "On"
end
return commandArray
FYI, I'm using this with domoticz.
time = os.date("*t")
weekday = os.date("%A")
commandArray = {}
if (time.hour == 22) and (time.min == 30) and (weekday ~= 'Weekend') then
commandArray['Armed Home'] = "On"
end
return commandArray
FYI, I'm using this with domoticz.