No announcement yet.

Writing script for secu16 I/0 input pin change

  • Filter
  • Time
  • Show
Clear All
new posts

    Writing script for secu16 I/0 input pin change

    Hello Bruce,

    Have been away from homeseer setup for awhile and just getting back into it and in particular using your plugin.

    I have an input connected to an SECU16 I/O Unit input 7 (I/O point 6) that reports if mailbox is opened or closed. Just wondering how I would set up a script to monitor this I/O point? There are examples in your docs on scripting an output but haven't seen anything on inputs. Would like to detect if mailbox is open and speak message. Every 5 minutes after mailbox is open need to see if mailbox is still open and if it is speak an appropriate message every 5 minutes until mailbox is closed. When mailbox is closed script would wait for next opening of mail box. Also have images of mailbox open and mailbox closed to incorporate into script.

    Your help is much appreciated and thanks for the help !!!!!! Rick

    Hi Rick,
    You would use an event to do want you are asking. The trigger would be your mailbox input and then you could use conditions and actions to do whatever else you need to do. You can use hs.DeviceValue to get status but I don't think that's what you want to do.

    I haven't done a lot with HS3 events but if you read up here I believe you can figure it out


      Hi Bruce,

      There are some applications where I will be doing scripting on the secu16 inputs. This is an old example but wondering if the commands still apply or if there is an updated version:

      Sub Main ()

      dim v
      V=cpuxa.GetPoint (1,0)

      End Sub

      1 = secu16 unit number
      0 = I/O Point 0 - Input #1

      Will the cpuxa.GetPoint () function work with your plugin in HS3? Again your docs show an output example but no input example. Thanks again for all your help !!!!!! Rick


        You can get input status using hs.DeviceValue.
        You can find the input device's reference ID on the Advanced tab of the device's configuration page.

        0 is OFF
        1 is ON

        Sub Main(Parm As Object)
        Dim x As Integer
        x = hs.DeviceValue(dvRef) 'dvRef is the input device's reference ID.
        End Sub