www.homeseer.com    
 

Go Back   HomeSeer Message Board > Developer Support > Scripts & Plug-Ins:Development and Libraries > HS3 Scripting

HS3 Scripting Discussions related to the scripting under HS3.

Reply
 
Thread Tools Display Modes
  #1  
Old February 12th, 2018, 10:53 PM
Rick Bonari Rick Bonari is offline
Seer Master
 
Join Date: Oct 2002
Location: Bremerton, Washington (USA)
Posts: 631
Looking for help with script

I have a secu16 I/O interface and am using input 7 (I/O point 6) to detect mailbox open or closed. Closed is 0 logic level and Open is logic high. I am using Bruce's cpuxa plugin for x-10 and I/O interfacing. I have the older adicon leopard 1 display/controller.

What I want to do is detect when the mailbox is open and speak a message and display a mailbox open graphic. When the mailbox is closed it will display a mailbox closed graphic. If the mailbox is left open, after 10 minutes it will speak the message "mailbox still open". If still open needs to speak this message every 5 minutes until the mailbox is closed and then the script will stop and be waiting for the next time the mailbox is open.

Your help on this will be much appreciated and will give me a good sense of scripting for new homeseer software.
Also wondering if in the HS3 software all of this could be done strictly with an event? Seems the event capabilities in the new HS3 software are more substantial. Interested what your thoughts are on these matters and thanks for your help ahead of time !!!!!! Rick
Reply With Quote
  #2  
Old February 13th, 2018, 11:10 AM
Uncle Michael's Avatar
Uncle Michael Uncle Michael is offline
OverSeer
 
Join Date: Feb 2006
Location: Rochester, NY
Posts: 5,938
Quote:
Originally Posted by Rick Bonari View Post
Also wondering if in the HS3 software all of this could be done strictly with an event?
Not with one event, probably, but certainly with a couple of them. The device graphic can be set up to change automatically (no event needed for that).

Event one: detect the mailbox device changing and becoming open.
Event action: Speak open message

Event two: detect the mailbox has been open for more than 10 minutes
Event action: Speak still open message
set a cannot retrigger time of 5 minutes
__________________
Mike____________________________________________________________ __________________
HS3 Pro Edition 3.0.0.435

HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF, Rain8Net+ | RFXCOM | QSE100D | Vantage Pro | Green-Eye | X10:
Compose, XTB-232, -IIR | Edgeport/8 | Way2Call | Ecobee3

Reply With Quote
  #3  
Old February 13th, 2018, 02:50 PM
Rick Bonari Rick Bonari is offline
Seer Master
 
Join Date: Oct 2002
Location: Bremerton, Washington (USA)
Posts: 631
Hello Mike,

I live in Bremerton Washington and I think you are in Fall City Washington if my memory serves me correctly. Many years ago you did a custom script for me for the mailbox event using homeseer v1.7.3. Of course that script won't work with HS3.

Thanks for the ideas on the events to do this in HS3. In the second event, it replays the open message every five minutes but does the event stop automatically when the mailbox is closed? What tells the event that the mailbox has been closed to stop event until next time that the mailbox is open?
I have the text for the old script if you would like me to send it to you to check out how you set the script up for the old version of homeseer software. Let me know if I have you confused for someone else? Thanks again for all your help !!!! Rick
Reply With Quote
  #4  
Old February 13th, 2018, 06:08 PM
Uncle Michael's Avatar
Uncle Michael Uncle Michael is offline
OverSeer
 
Join Date: Feb 2006
Location: Rochester, NY
Posts: 5,938
Rick,
I think you have me confused with someone else. I live in upstate New York and started HS with v2, so have no experience with v1.

Regarding your question about how the event 'knows' that the mailbox is closed, it's trigger is "the mailbox has been open for at least 10 minutes". The event is not a one shot that just repeats. It checks its trigger conditions every time it runs. So as soon as the mailbox is closed, its trigger condition is no longer true.
Reply With Quote
  #5  
Old February 14th, 2018, 02:40 AM
Rick Bonari Rick Bonari is offline
Seer Master
 
Join Date: Oct 2002
Location: Bremerton, Washington (USA)
Posts: 631
I created an event that is triggered IF GTS CPUXA SECU16 Unit 1 Input 7 changes and becomes on THEN Speak (The mailbox is open. Please get the mail.).

Then created an event that is triggered IF GTS CPUXA SECU16 Unit 1 Input 7 has been on for at least 10 minutes THEN Speak (The mailbox is still open. Please close it.). Next in this second event options I checked "can not rerun for 5 minutes.

My understanding of these two events is that when mailbox is first open it speaks "Mailbox is open. Please get the mail.". Then this event is not triggered again until the mailbox has been closed and reopened again.

The second event is triggered if mailbox is open for at least ten minutes and speaks "The mailbox is still open. Please close it.". If the mailbox still isn't closed after another 5 minutes it speaks the message again and then repeats every 5 minutes until mailbox is closed and when closed this event stops. If the mailbox is closed prior to 10 minutes then this event is never executed.

Is this rundown of how these events work correct?
One question I have is that for these events to work, homeseer software must cycle through events to check triggers and then acts on them and keeps checking triggers until they become false. Would this assumption also be correct? Thanks again for all your help !!!!! Look forward to hearing your comments !!!!!! Rick
Reply With Quote
  #6  
Old February 14th, 2018, 11:43 AM
Uncle Michael's Avatar
Uncle Michael Uncle Michael is offline
OverSeer
 
Join Date: Feb 2006
Location: Rochester, NY
Posts: 5,938
Quote:
Originally Posted by Rick Bonari View Post
My understanding of these two events is that when mailbox is first open it speaks "Mailbox is open. Please get the mail.". Then this event is not triggered again until the mailbox has been closed and reopened again.

The second event is triggered if mailbox is open for at least ten minutes and speaks "The mailbox is still open. Please close it.". If the mailbox still isn't closed after another 5 minutes it speaks the message again and then repeats every 5 minutes until mailbox is closed and when closed this event stops. If the mailbox is closed prior to 10 minutes then this event is never executed.

Is this rundown of how these events work correct?
That is what I expect. The best way to find out is to give them a try.

Quote:
One question I have is that for these events to work, homeseer software must cycle through events to check triggers and then acts on them and keeps checking triggers until they become false. Would this assumption also be correct?
I have no special knowledge of the inner workings of HS, but operationally, that is what appears to occur, though that may not be the exact way it is accomplished.
Reply With Quote
  #7  
Old February 14th, 2018, 07:01 PM
Rick Bonari Rick Bonari is offline
Seer Master
 
Join Date: Oct 2002
Location: Bremerton, Washington (USA)
Posts: 631
Hello Michael,

The scripting was a success and worked as advertised. Not sure how to handle the images for mailbox open and and mailbox closed. I have the images but not sure what folder in homeseer to put them in and how to activate them at the proper times. Would I be correct in assuming that if all is working as it should these images will appear on the device management page when activated? This is new territory for me as alot of HS3 is new to me. Your help on the image issue for this event is much appreciated. Thanks again for all your help and for steering me in the right direction on this event !!!!! Rick
Reply With Quote
  #8  
Old February 14th, 2018, 09:44 PM
Uncle Michael's Avatar
Uncle Michael Uncle Michael is offline
OverSeer
 
Join Date: Feb 2006
Location: Rochester, NY
Posts: 5,938
The most direct way to handle graphics of this sort is to include them on the Status/Graphics tab of the device. I've attached an image of the tab for one of my devices. I store the image files in a subfolder of the HTML folder.

In your case, I'm assuming you'd have two states and an image for open and another for closed. You can use any values you want for the two states. Default is 0 for Off and 100 for On, but those values are not required.
Attached Images
 
Reply With Quote
  #9  
Old February 14th, 2018, 10:13 PM
rprade's Avatar
rprade rprade is offline
OverSeer
 
Join Date: Jan 2014
Location: Colorado
Posts: 6,799
I am assuming you want the images to show in the Device Manager.

I grabbed a couple of images off the Internet, resized them to 200x200 (HomeSeer's standard status image size) and made the backgrounds transparent. They are put in \HomeSeer HS3\html\images\status where all of the other status images are stored. The images are assigned to the values for Open and Closed. The images are resized again when displayed in Device Manager.

Name:  Capture.PNG
Views: 124
Size:  8.1 KB

Name:  Capture1.PNG
Views: 125
Size:  136.5 KB
__________________
Randy Prade
Aurora, CO
Prades.net

PHLocation - Pushover - EasyTrigger - UltraECM3 - Ultra1Wire3 - Arduino

Last edited by rprade; February 14th, 2018 at 10:25 PM.
Reply With Quote
  #10  
Old February 14th, 2018, 10:42 PM
Rick Bonari Rick Bonari is offline
Seer Master
 
Join Date: Oct 2002
Location: Bremerton, Washington (USA)
Posts: 631
Michael and Randy,

Thanks much, that is awesome !!!!!! Would I be correct in assuming these images are also displayed or can be displayed in custom HsTouch Screens? Thanks again for all your help !!!!!! Rick
Reply With Quote
  #11  
Old February 15th, 2018, 11:34 AM
Uncle Michael's Avatar
Uncle Michael Uncle Michael is offline
OverSeer
 
Join Date: Feb 2006
Location: Rochester, NY
Posts: 5,938
Quote:
Originally Posted by Rick Bonari View Post
Would I be correct in assuming these images are also displayed or can be displayed in custom HsTouch Screens?
Yes.
Reply With Quote
  #12  
Old February 15th, 2018, 11:36 PM
Rick Bonari Rick Bonari is offline
Seer Master
 
Join Date: Oct 2002
Location: Bremerton, Washington (USA)
Posts: 631
Are the smaller images in the device manager screen automatically resized from the larger images? Thanks again....Rick
Reply With Quote
  #13  
Old February 16th, 2018, 09:50 AM
rprade's Avatar
rprade rprade is offline
OverSeer
 
Join Date: Jan 2014
Location: Colorado
Posts: 6,799
Yes, the status images are resized for the Device Manager. I think they are constrained to 32x32. That is the size of the legacy icons. HomeSeer stated when the switch to the new icon style was rolled out that a 200x200 image resized looks better than a 32x32 image displayed without resizing.
Reply With Quote
  #14  
Old February 16th, 2018, 04:49 PM
Rick Bonari Rick Bonari is offline
Seer Master
 
Join Date: Oct 2002
Location: Bremerton, Washington (USA)
Posts: 631
Do the images have to be exactly 200x200 pixels? Also in addition to .png images can you use .bmp, .gif and other image types or does everything need to be converted to .png format? Thanks again !!!! You all have been very helpful !!! Between you and Michael I have learned a great deal !!!! Rick
Reply With Quote
  #15  
Old February 16th, 2018, 06:11 PM
Krumpy's Avatar
Krumpy Krumpy is offline
Seer Master
 
Join Date: Apr 2001
Location: Minneapolis, MN
Posts: 1,209
Ok, so how are you guys adding electronics to the mailbox that does not cause the US Mail organization to freak out. I figure wires dangling out of the mailbox will make the mailman freak thinking that it is a bomb.... I would like to add something so that I can monitor when the mail comes... Or how often the door is opened....

On the other hand, it is not fair to the mail carriers that they had to deal (directly or indirectly) with anthrax scares, etc.
__________________
HomeSeer 2, HomeSeer 3, Allonis myServer, Amazon Alexa Dots, ELK M1G, ISY 994i, HomeKit, BlueIris, and 6 "4k" Cameras using NVR, and integration between all of these systems. Home Automation since 1980.
Reply With Quote
  #16  
Old February 16th, 2018, 06:25 PM
rprade's Avatar
rprade rprade is offline
OverSeer
 
Join Date: Jan 2014
Location: Colorado
Posts: 6,799
Quote:
Originally Posted by Rick Bonari View Post
Do the images have to be exactly 200x200 pixels? Also in addition to .png images can you use .bmp, .gif and other image types or does everything need to be converted to .png format? Thanks again !!!! You all have been very helpful !!! Between you and Michael I have learned a great deal !!!! Rick
They do not have to be 200x200. Any size will work, though larger than 200x200 would likely make it difficult to manage the Status Graphics Page. An image between 32x32 and 200x200 would be best. I just use 200x200 to be consistent.
Reply With Quote
  #17  
Old February 16th, 2018, 06:32 PM
rprade's Avatar
rprade rprade is offline
OverSeer
 
Join Date: Jan 2014
Location: Colorado
Posts: 6,799
Quote:
Originally Posted by Krumpy View Post
Ok, so how are you guys adding electronics to the mailbox that does not cause the US Mail organization to freak out. I figure wires dangling out of the mailbox will make the mailman freak thinking that it is a bomb.... I would like to add something so that I can monitor when the mail comes... Or how often the door is opened....

On the other hand, it is not fair to the mail carriers that they had to deal (directly or indirectly) with anthrax scares, etc.
Mine is a thin DSC magnetic window sensor on a non-alarm zone of my security system. I originally had an Ecolink Z-Wave tilt sensor, but it was unreliable. The DSC is supervised and has much better range.

Using the DSC we get a TTS notification every time the door is opened and additional warnings if it is not closed. The dog even goes to the front door to bark (stereotypes anyone?) when Zira (Micro$oft voice) announces it.
Reply With Quote
  #18  
Old February 16th, 2018, 06:36 PM
jquincy jquincy is offline
Seer
 
Join Date: May 2015
Location: MO - Missouri
Posts: 47
This worked for me. Simple magnetic contact closures used in alarm systems. Painted it and works great for me. Remember to anticipate you are someone in household putting mail in the mail box.Sorry the picture is sideways. Guess I need to paint the wires also.
Attached Images
 
Reply With Quote
  #19  
Old February 16th, 2018, 09:13 PM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is online now
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,705
Radio Shack sold a mailbox monitor that had s little coin-battery sized sender that was stuck on the door of the mailbox. When it sees light (and RD is not obstructed by metal enclosure) it notifies the receiver. No wires in the mailbox.

My mailbox is about 600 ft from the house, but so do have road lights. On the one nearest to the mailbox I interfaced the receiver with a UPB-IO and sent notification via power line back to the house. Tears of outdoor exposure and the receiver no longer works. I am looking at LoRa now, but have not finalized my source of power at the mailbox.
Reply With Quote
  #20  
Old February 16th, 2018, 10:47 PM
Rick Bonari Rick Bonari is offline
Seer Master
 
Join Date: Oct 2002
Location: Bremerton, Washington (USA)
Posts: 631
These types of mailbox devices have been out for about 20 years or more. I think mail carriers are very used to these types of devices. I have had various mailbox units for many years and have had no questions asked about them ever. I have a mailbox on the side wall right outside the front door. It has a cover that lifts up to get the mail. I have a tilt switch that mounts under the top cover that triggers a small RF Module mounted to side of mailbox that is not visible. It triggers an RF Reciever inside that connects to homeseer via secu16 input module. Hope this helps....Rick
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Script to list events that have script actions - Discussion Thread sparkman Script & Plug-In Library Discussion 41 February 20th, 2017 10:13 PM
[script][vbs] CNN breaking news announcement script (updated: version 2.2 - 11/01/2002) electron Script & Plug-In Library Discussion 82 July 28th, 2004 12:52 PM
[Script][Asp] Script to Map a PalmPad to multiple other house code devices. sbessel Script & Plug-In Library 0 January 10th, 2004 12:45 AM
[Script] Lutron RadioRa Serial Library Script (Beta) DonaldSmith Script & Plug-In Library 0 June 11th, 2002 10:29 AM
[script][vbs] CNN breaking news announcement script (updated: version 2.2) electron Script & Plug-In Library 0 February 2nd, 2002 11:18 PM


All times are GMT -4. The time now is 11:26 PM.


Copyright HomeSeer Technologies, LLC