more G-Labs products

Author Topic: Arm / Disarm Alarm by code  (Read 1107 times)

July 30, 2016, 11:47:09 AM
Read 1107 times

Peter1977

  • *
  • Information
  • Newbie
  • Posts: 24
Its Probably easy but i can't find it...

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

Thanks!

July 31, 2016, 11:17:01 AM
Reply #1

Peter1977

  • *
  • Information
  • Newbie
  • Posts: 24
What i would like to do is: Turn on a certain light at a certain time ONLY when the homegenie alarmsysteem is Disarmed

August 01, 2016, 06:58:19 PM
Reply #2

Peter1977

  • *
  • Information
  • Newbie
  • Posts: 24
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 :)

August 01, 2016, 11:13:21 PM
Reply #3

nolio

  • *****
  • Information
  • Global Moderator
  • Posts: 544
Hi,
Did you try with :
Code: [Select]
securityAlarm.Level.On()Instead
Code: [Select]
$$.boundModules.on();?
Bye

August 25, 2016, 10:46:57 AM
Reply #4

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
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
« Last Edit: August 25, 2016, 10:52:27 AM by dani »

August 25, 2016, 11:12:07 AM
Reply #5

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
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