SecuritySpy: Arm camera via python - SOLVED

Posted on
Tue Feb 12, 2019 7:56 pm
rafsel offline
Posts: 51
Joined: Feb 24, 2009

SecuritySpy: Arm camera via python - SOLVED

I would appreciate an example of how to do this in a python script.
Thanks,
Martin
Last edited by rafsel on Fri Feb 15, 2019 8:02 am, edited 1 time in total.

Posted on
Tue Feb 12, 2019 8:08 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: SecuritySpy: Arm camera via python

Look at the Actions.xml in the plugin wrapper. Look for the "arm" section, which looks like this:

Code: Select all
    <Action id="arm" deviceFilter="indigo.device,self.camera" uiPath="DeviceActions">
        <Name>Arm Camera</Name>
        <CallbackMethod>set_arm</CallbackMethod>
      <ConfigUI>
          <Field id="type" type="menu" defaultValue="motion">
             <List>
               <Option value="MotionCapture">Motion</Option>
               <Option value="ContinuousCapture">Continuous</Option>
               <Option value="Actions">Actions</Option>
              </List>
             <Label>Type</Label>
          </Field>
          <Field id="value" type="menu" defaultValue="true">
             <List>
                <Option value="arm">Arm (enable)</Option>
                <Option value="disarm">Disarm (disable)</Option>
                <Option value="toggle">Toggle (change)</Option>
             </List>
          </Field>
      </ConfigUI>
    </Action>


Also, look in Info.plist for:
Code: Select all
   <key>CFBundleIdentifier</key>
   <string>org.cynic.indigo.securityspy</string>


With that info, your code looks like:

Code: Select all
    ss_plugin = indigo.server.getPlugin("org.cynic.indigo.securityspy")
    if ss_plugin.isEnabled:
        ss_plugin.executeAction("arm", deviceId=1234567, props={u"type": "MotionCapture", u"value": "arm" })


You need to provide the correct deviceId, and pick the appropriate "type" and "value" to do that you want.
Last edited by FlyingDiver on Tue Feb 12, 2019 8:25 pm, edited 1 time in total.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue Feb 12, 2019 8:18 pm
rafsel offline
Posts: 51
Joined: Feb 24, 2009

Re: SecuritySpy: Arm camera via python

Perfect!
Many thanks.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests