Announcement

Collapse
No announcement yet.

Looking for help with script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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

    #2
    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.548, NUC i3

    HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

    Comment


      #3
      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

      Comment


        #4
        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.
        Mike____________________________________________________________ __________________
        HS3 Pro Edition 3.0.0.548, NUC i3

        HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

        Comment


          #5
          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

          Comment


            #6
            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.

            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.
            Mike____________________________________________________________ __________________
            HS3 Pro Edition 3.0.0.548, NUC i3

            HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

            Comment


              #7
              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

              Comment


                #8
                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 Files
                Mike____________________________________________________________ __________________
                HS3 Pro Edition 3.0.0.548, NUC i3

                HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

                Comment


                  #9
                  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.

                  Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	8.1 KB
ID:	1195349

                  Click image for larger version

Name:	Capture1.PNG
Views:	1
Size:	136.5 KB
ID:	1195348
                  Last edited by randy; February 14, 2018, 09:25 PM.
                  HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

                  Comment


                    #10
                    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

                    Comment


                      #11
                      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.
                      Mike____________________________________________________________ __________________
                      HS3 Pro Edition 3.0.0.548, NUC i3

                      HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

                      Comment


                        #12
                        Are the smaller images in the device manager screen automatically resized from the larger images? Thanks again....Rick

                        Comment


                          #13
                          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.
                          HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

                          Comment


                            #14
                            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

                            Comment


                              #15
                              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.

                              Comment

                              Working...
                              X