I'm kind off new to Domoticz, but I'm already able to control all of my lights, Somfy shutters, make some Blocky scripts, ...
The one thing that won't work for now is activating my alarmsystem. I made an "Off" switch that's sending the right IR code, however I need to press the Off button twice in a row to get my alarm to listen to it.
I tried this:
Code: Select all
commandArray = {}
function blinkLight(light, times)
times = times or 2
local pause = 0
for i = 1, times do
commandArray[#commandArray + 1]={[light]='On AFTER '..pause }
pause = pause + 3
commandArray[#commandArray + 1]={[light]='Off AFTER '..pause }
pause = pause + 3
end
end
-- if (devicechanged['AlarmOff'] == 'Off') then
blinkLight("AlarmOff") -- blink device 75 the default number of times (which is 2)
-- end
return commandArray
The second script I tried was
Code: Select all
commandArray = {}
-- if (deviceName=='AlarmOff') then
if devicechanged['AlarmOff'] == 'Off' then
commandArray['AlarmOff']='On'
commandArray[1]={['AlarmOff']='Off'}
commandArray[2]={['AlarmOff']='On'}
commandArray[3]={['AlarmOff']='Off'}
commandArray[4]={['AlarmOff']='On'}
end
return commandArray
Do I need to use a variabel?
Anyone that can help me out please?
Kind regards!