HomeGenie Forum

Automation Program Plugins and Wizard Scripting => Help => Topic started by: Peter1977 on July 30, 2016, 11:47:09 AM

Title: Arm / Disarm Alarm by code
Post by: Peter1977 on July 30, 2016, 11:47:09 AM
Its Probably easy but i can't find it...

How do I Arm or Disarm the Alarm Security System by code ?

Thanks!
Title: Re: Arm / Disarm Alarm by code
Post by: Peter1977 on July 31, 2016, 11:17:01 AM
What i would like to do is: Turn on a certain light at a certain time ONLY when the homegenie alarmsysteem is Disarmed
Title: Re: Arm / Disarm Alarm by code
Post by: Peter1977 on August 01, 2016, 06:58:19 PM
with some search on the forum i found this line to get info is Alarm is armed or not.
But my code (in the new Sheduler) is not working, does someone know whats wrong ?

Code: [Select]
var securityAlarm = Modules.WithName("Security Alarm System").get(); // or Modules.WithAddress("90").Get();

if (securityAlarm.Level < 1)
{
$$.boundModules.on();
}

Thanks :)
Title: Re: Arm / Disarm Alarm by code
Post by: nolio on August 01, 2016, 11:13:21 PM
Hi,
Did you try with :
Code: [Select]
securityAlarm.Level.On()Instead
Code: [Select]
$$.boundModules.on();?
Bye
Title: Re: Arm / Disarm Alarm by code
Post by: dani on August 25, 2016, 10:46:57 AM
Hi,

// Alarme ArmAway
Found the module
var alarme = $$.modules.withAddress("90").get();
Or
var alarme = $$.modules.inDomain("HomeAutomation.HomeGenie.Automation").withAddress("90").get();

I try all of this, nothing works :
alarme.Control.ArmAway();
alarme.Control.On();
alarme.Level.On();


With the script alarme.Level.On(); we got an Error ( Object as no method On )
With the other script we got only Error ()

An idea ?
Cheers
Title: Re: Arm / Disarm Alarm by code
Post by: dani on August 25, 2016, 11:12:07 AM
Hi All,

I found the way in Script Scheduler for Arm Security Alarm System :
// Arm alarm
var alarm = $$.modules.inDomain("HomeAutomation.Homegenie.Automation").withAddress("90").get();
if( alarm.Exists )
  alarm.On();


For found the module you can use only :
var alarm = $$.modules.withAddress("90").get();
but I prefer specify the domain.

For desarm use : alarm.Off();

Cheers
Dani