[ANSWERED]Help With Action Group Script Setting?

Posted on
Wed Jun 18, 2014 4:40 pm
thomasw offline
Posts: 135
Joined: Feb 13, 2011

[ANSWERED]Help With Action Group Script Setting?

Hi all,
I'm creating a new Action Group, and I need to know how to write the Script in the Embedded Applescript box.
I need the script to first do a 60 second delay, and then check the on/off status of a device (an appliance linc). If the device is found to be on, then I need the script to send an "on" command to a EZI/O40 Linc on contact -3. If the status of the device was found to be "off", then I don't want anything done. I'm attaching a pic of what I'm trying to write in the Action Group, that isn't working. Just to be clear, the device it needs to check, an appliance linc, is named "CamLR". The name of the I/O is "EZI/O40 Linc Contact".
Attachments
NewActionGroup.png
NewActionGroup.png (66.92 KiB) Viewed 3038 times

Posted on
Wed Jun 18, 2014 4:46 pm
ckeyes888 offline
Posts: 2425
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Help With Action Group Script Setting?

For the delay you definitely don't want to have that in an embedded script as it will
hang the server.

Maybe just do an external script or use the "Delay by" menu at the bottom of screen.

Carl

Posted on
Wed Jun 18, 2014 4:57 pm
kw123 offline
User avatar
Posts: 8392
Joined: May 12, 2013
Location: Dallas, TX

Re: Help With Action Group Script Setting?

select python(*) script, and copy and paste into script box:

Code: Select all
if  (indigo.devices["CamLR"].onState) :  indigo.device.turnOn("EZI/040")



For the delay: check the "DELAY by" check box and enter your 30 seconds delay.

DO NOT delay the script in the script: indigo will kill any active script that runs longer than 10 seconds.


hope that helps

Karl
(*) forgot how to do it with applescript

Posted on
Wed Jun 18, 2014 7:01 pm
kw123 offline
User avatar
Posts: 8392
Joined: May 12, 2013
Location: Dallas, TX

Re: Help With Action Group Script Setting?

or simply
create a trigger and set the action with xx delay:
Attachments
Screen Shot 2014-06-18 at 8.00.38 PM.png
Screen Shot 2014-06-18 at 8.00.38 PM.png (51.44 KiB) Viewed 3010 times
Screen Shot 2014-06-18 at 7.59.17 PM.png
Screen Shot 2014-06-18 at 7.59.17 PM.png (31.9 KiB) Viewed 3010 times

Posted on
Thu Jun 19, 2014 3:06 pm
thomasw offline
Posts: 135
Joined: Feb 13, 2011

Re: Help With Action Group Script Setting?

Hi Ky123,
I tried what you said, see the attached picture. But, it returns an error, and can't find the output of #3. This EZI/O40 has 4 different outputs that do different things.
I need it to turn "on" only the output #3 for this to work. And, like I said, it must be dependent on checking the state of the device "CamLR" which is just an Insteon Appliance Linc.
When the housedoorswitch sends and "on" to Indigo, this starts Trigger that executes this "new action group 1". I can put a 1 min delay in the Trigger itself, before it executes the action group. Then I just need the action group to check the state of the "CamLR", and if it is "on", then send "on" to output #3 of EZI/O40 linc. If "CamLR" is "off", then I don't want it to do anything. Oh, and I just changed the name of the EZI/O40 linc. To make it simpler, it is now named "EZIO40LincAlarm", the first o is the captial letter O, followed by numbers 40, then LincAlarm.
I don't know anything at all about Python scripts, so I appreciate your help!
The error shows up this way in the event log:

Jun 19, 2014 4:42:51 PM
Schedule TEST-HouseDoorSwitch (delayed action)
Action Group new action group 1
Script Error embedded script: 'Boost.Python.function' object has no attribute 'output3'
Script Error Exception Traceback (most recent call shown last):

embedded script, line 1, at top level
AttributeError: 'Boost.Python.function' object has no attribute 'output3'
Attachments
PythonScriptProblem.png
PythonScriptProblem.png (71.6 KiB) Viewed 2960 times
PythonScriptProblem.png
PythonScriptProblem.png (71.6 KiB) Viewed 2960 times

Posted on
Thu Jun 19, 2014 3:39 pm
matt (support) offline
Site Admin
User avatar
Posts: 21429
Joined: Jan 27, 2003
Location: Texas

Re: Help With Action Group Script Setting?

For the 2nd line in the script try this:

indigo.iodevice.setBinaryOutput("EZI/040", 2, True)

The second argument is zero based, so I'm not sure if you want 2 or 3 there. The last argument is True to close the relay, False to open it.

Image

Posted on
Thu Jun 19, 2014 5:23 pm
thomasw offline
Posts: 135
Joined: Feb 13, 2011

Re: Help With Action Group Script Setting?

Hi Matt,
I'll give that a try on the EZI/O40 Linc. But, while I was waiting, I swapped out the EZI/O40 for a regular I/O Linc with only 1 output for this. (The EZI/O40 does other things)
Then I selected the embedded applescript, and tried a few things, finally getting it to cooperate. Attached are the pics of what IS working for this.
The main problem was that it kept saying it could not get the device state of CamLR (an appliance linc at least not by using a Python Script).
If I go on the main page of Indigo and send status request, it returns with on or off with no problems?
Anyway, I just had the applescript check a variable instead, and that is working now.
-Tom
Attachments
DoorScriptWorking1.png
DoorScriptWorking1.png (73.83 KiB) Viewed 2946 times
DoorScriptWorking2.png
DoorScriptWorking2.png (63.94 KiB) Viewed 2946 times
DoorScriptWorking3.png
DoorScriptWorking3.png (64.64 KiB) Viewed 2946 times

Posted on
Thu Jun 19, 2014 10:35 pm
thomasw offline
Posts: 135
Joined: Feb 13, 2011

Re: Help With Action Group Script Setting?

Hi again Matt,
While this IS now working with the Applescript checking the Variable, and then executing one of 2 Action Groups, depending on the variable.
I still can't get it to work with checking the Device State instead of checking the Variable? This "CamLR" is just an Insteon Appliance Linc model: 2456S3
I would rather have the applescript check to see if the "CamLR" is on or off, instead of checking the variable. The reason is sometimes the variable takes too long to change from "true" to "false".
I put in the following Applescript in the picture, and get the following error in the event log:

Jun 20, 2014 12:19:17 AM
Schedule TestHouseDoorSwitch (delayed action)
Action Group new action group 1
Error script error: around characters 30 to 36
Error script error: Can’t get value of device "CamLR". (-1728)
Attachments
NewActionGroupDeviceNotWork.png
NewActionGroupDeviceNotWork.png (73.46 KiB) Viewed 2922 times

Posted on
Thu Jun 19, 2014 10:39 pm
matt (support) offline
Site Admin
User avatar
Posts: 21429
Joined: Jan 27, 2003
Location: Texas

Re: Help With Action Group Script Setting?

Instead use:

Code: Select all
if on state of device "CamLR" is true then

Image

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests