Creating an email alert for garage door open

Posted on
Thu Apr 21, 2016 10:10 am
rgspb offline
Posts: 217
Joined: Apr 24, 2009
Location: Florida

Creating an email alert for garage door open

I've been using the Wiki instructions to do this, but I'm getting stumped at the Python script stage. The first line reads dev = indigo.devices[IOLINCID] # "IO Linc" but I keep getting an error

Script Error embedded script: global name 'IOLINCID' is not defined
Script Error Exception Traceback (most recent call shown last):

embedded script, line 1, at top level
NameError: global name 'IOLINCID' is not defined

I don't know what to change here! I did figure out that I needed to change "ADDRESSHERE" to my email address, even though the directions don't indicate doing this. Please remember not all of us are programmers and need things spelled out specifically ; )

Posted on
Thu Apr 21, 2016 10:17 am
DaveL17 offline
User avatar
Posts: 6756
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Creating an email alert for garage door open

Right click on your IOLINC and then select copy ID. Paste that number in place of IOLINCID in the script.

Dave


Sent from my iPhone using Tapatalk

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Thu Apr 21, 2016 10:48 am
rgspb offline
Posts: 217
Joined: Apr 24, 2009
Location: Florida

Re: Creating an email alert for garage door open

Ah! Beautiful, works like a charm! Thanks so much, I never would have figured that out on my own.

Posted on
Thu Apr 21, 2016 11:39 am
DaveL17 offline
User avatar
Posts: 6756
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Creating an email alert for garage door open

rgspb wrote:
Ah! Beautiful, works like a charm! Thanks so much, I never would have figured that out on my own.

No problem whatsoever! Glad to hear that it's working for you.

Dave

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Fri Jun 16, 2017 4:01 pm
qcvictor offline
Posts: 80
Joined: Apr 23, 2015
Location: Quebec, Canada

Re: Creating an email alert for garage door open

I don't use iolinc but door sensor 2845, when i run the script I get
Code: Select all
Script Error                    embedded script: 'key binaryInput1 not found in dict'
   Script Error                    Exception Traceback (most recent call shown last):

     embedded script, line 2, at top level
KeyError: 'key binaryInput1 not found in dict'

any clue for adapted this script ?

Posted on
Fri Jun 16, 2017 4:46 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Creating an email alert for garage door open

You'll need to modify the trigger conditions to use the door sensor of course, but this script should work:

Code: Select all
door = indigo.devices[DOORSENSORID] # "Door Sensor"
# the door is open if the onState property is True
if door.onState:
    indigo.server.sendEmailTo("ADDRESSHERE", subject="The garage door is OPEN!!")

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sat Jun 17, 2017 3:29 am
qcvictor offline
Posts: 80
Joined: Apr 23, 2015
Location: Quebec, Canada

Re: Creating an email alert for garage door open

tks for the quick reply Jay, the script works good, however if the garage door is closed before the delay he send the email anyway!
Timers and pesters will be more appropriated for this functions ?

Posted on
Sat Jun 17, 2017 10:57 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Creating an email alert for garage door open

It shouldn't if you have everything configured correctly. Does the door sensor show "off" as the state when the garage door is closed?

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sat Jun 17, 2017 12:47 pm
qcvictor offline
Posts: 80
Joined: Apr 23, 2015
Location: Quebec, Canada

Re: Creating an email alert for garage door open

My setting:
Image
The log
capture
Code: Select all
17 juin 2017 14:31:26
   Received INSTEON                "Door Sensor Test" off (button 1)
   Trigger                         Garage Door Opened

17 juin 2017 14:32:28
   Received INSTEON                "Door Sensor Test" on (button 1)

17 juin 2017 14:33:26
   Schedule                        Garage Door Opened (delayed action)
   Email Sent                      to "xxxxxx@gmail.com"; subject "The garage door is OPEN!!"

Posted on
Sat Jun 17, 2017 1:05 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Creating an email alert for garage door open

You want the trigger to fire when the device becomes on (the door is open) not when it closes (off).

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sat Jun 17, 2017 1:07 pm
qcvictor offline
Posts: 80
Joined: Apr 23, 2015
Location: Quebec, Canada

Re: Creating an email alert for garage door open

When he come off !

Also my side doors managed by my dsc panel/DSC alarm plugin, give me this error :
Code: Select all
   Embedded script executor host started
   Script Error                    embedded script: 'Device' object has no attribute 'onState'
   Script Error                    Exception Traceback (most recent call shown last):

     embedded script, line 3, at top level
AttributeError: 'Device' object has no attribute 'onState'

Posted on
Sat Jun 17, 2017 5:18 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Creating an email alert for garage door open

Sorry, I think we need to step back here. The How-To mentioned above is to make sure a garage door (the roll up kind that let's the car in) doesn't stay open too long. You keep mentioning random things that don't seem to relate to garage doors, so I think maybe you need to FULLY describe your environment and exactly what you want to do...

When he come off !


I have no clue what you mean.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Jun 19, 2017 7:34 am
qcvictor offline
Posts: 80
Joined: Apr 23, 2015
Location: Quebec, Canada

Re: Creating an email alert for garage door open

I'm so sorry too much things in the same times :oops:
I have 2 separate garage,
-One is monitored with sensor 2845, the script work if garage door condition is On when door is open but it's not my case, garage door is open when the 2845 state is off (button pushed)
Trigger work well when he goes off but he sent anyway the email even when released before the delay asked !
Code: Select all
19 juin 2017 09:31:48
   Received INSTEON                "Door Sensor Test" off (button 1)
   Trigger                         Garage Door Opened
   Received INSTEON                "Door Sensor Test" on (button 1)
   Schedule                        Garage Door Opened (delayed action)
   Email Sent                      to "xxxxxx@gmail.com"; subject "The garage door is OPEN!!"

-The other door is monitored with my alarm, I use the DSC plugin for get the state, the script need to be adapted for reflect this new sensor .... (sensor state is closed when closed and open when the garage door is open)

Posted on
Mon Jun 19, 2017 8:40 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Creating an email alert for garage door open

qcvictor wrote:
-One is monitored with sensor 2845, the script work if garage door condition is On when door is open but it's not my case, garage door is open when the 2845 state is off (button pushed)


Ah, that explains it (fully describing the environment is always key in getting help). In that case, you need the script to check to see if the onState is False, not True:

Code: Select all
door = indigo.devices[DOORSENSORID] # "Door Sensor"
# the door is open if the onState property is True
if not door.onState:
    indigo.server.sendEmailTo("ADDRESSHERE", subject="The garage door is OPEN!!")


Notice the not in the if statement - that negates the test so it's now checking to see if door.onState is False (open in your case).

qcvictor wrote:
-The other door is monitored with my alarm, I use the DSC plugin for get the state, the script need to be adapted for reflect this new sensor .... (sensor state is closed when closed and open when the garage door is open)


I don't know how the DSC plugin works - you'd need to figure out the correct DSC device and the state that indicates if the door is open or closed.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Jun 19, 2017 12:31 pm
qcvictor offline
Posts: 80
Joined: Apr 23, 2015
Location: Quebec, Canada

Re: Creating an email alert for garage door open

Many tks Jay for your patience, it's working now for my 2845.
Where I can find the "device type" for my dsc plugin? this information is available somewhere or need to ask on the dedicated plugin thread ?

Who is online

Users browsing this forum: No registered users and 5 guests