I want these commands executed in sequence, but it works only if i have one line in commandArray not if
there are 2 lines. - What am i doing wrong ?
Code: Select all
commandArray = {}
if (devicechanged['vTest1'] == 'On') then
print('vTest Called...')
table.insert (commandArray, { ['Relay1'] = 'Off FOR 2 SECONDS REPEAT 8 INTERVAL 10 SECONDS' } )
table.insert (commandArray, { ['Relay1'] = 'On AFTER 5 SECONDS' } )
print('vTest Exit...')
end
return commandArray
Code: Select all
if (devicechanged['vDoor1'] == 'On') then
print('vDoor1 Called...')
commandArray[#commandArray + 0] = {['Relay1'] ='On AFTER 5 SECONDS' }
commandArray[#commandArray + 1] = {['Relay1'] ='Off FOR 2 SECONDS REPEAT 3 INTERVAL 15 SECONDS' }
commandArray[#commandArray + 2] = {['Relay1'] ='On AFTER 5 SECONDS' }
end
thanks Peter