Flip a switch AFTER seconds not working

Post Reply
Posts: 9
Joined: Wednesday 15 November 2017 20:40
Target OS: NAS (Synology & others)
Domoticz version: 3.8740
Location: Belgium

Flip a switch AFTER seconds not working

Post by sieth » Tuesday 05 June 2018 19:58

I wrote a little script (noob) to flip a switch after some seconds.
If I fill in 3 seconds, it works. Anything else wont work...
I couldn't find the problem.
Has anyone an idea??

This is the script:

Code: Select all

commandArray = {}
-- Alarm AAN
if (uservariables['alarmarm01'] == "1") or (uservariables['alarmarm02'] == "1") or (uservariables['alarmarm03'] == "1") then
        print("Alarm Armed")
        commandArray[#commandArray + 1]={['Variable:Alarmtssn1'] = tostring (1)} --Bepaald of alarm effectief aan staat
        commandArray[#commandArray + 1]={['Alarm STATUS']='On AFTER 3'} --alarm aan AFTER in seconden
        commandArray[#commandArray + 1]={['Alarmlicht']='On AFTER 10'} --Alarmlicht aan AFTER seconden
-- Alarm Uit
        commandArray['Variable:Alarmtssn1'] = tostring (0)
        print("Alarm Disarmed")
        commandArray[#commandArray + 1]={['Alarm STATUS']='Off'} --Bepaald of alarm effectief uit staat
        commandArray[#commandArray + 1]={['Alarmlicht']='Off'}
        commandArray[#commandArray + 1]={['$Alarm toestand']='Off'}
return commandArray
Info about the setup:
Domoticz 3.9439
On a Synology NAS
Saved the scriped as Alarm_arm with dropbox selection "All"
Variables are strings
Swithes are on-off

Thanks in advance!!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest