Announcement

Collapse
No announcement yet.

secu16 problem

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

    secu16 problem

    I am new to scripting and I have wrote this script for garage door open/close event and my problem is error in log. Can someone possibly have a solution to to this. Running hs2.

    08/03/2007 1:40:25 PM - Error - Ocelot not configured

    I do have the ocelot plugin working and can run events to trigger input and output on the secu16

    Dim doorstatus

    ' Figure out the current door status.
    doorstatus =hs.DeviceStatus("`5") 'Reference to relay 0
    if doorstatus = 3 then
    hs.Speak "Garage door is already closed."
    else
    hs.Speak "I will close garage door."
    hs.WaitSecs 3
    cpuxa.SetPoint 1,0,1
    hs.WaitSecs 1
    cpuxa.SetPoint 1,0,0
    end if
    end sub

    #2
    Try putting this at the top of the script after the sub main()

    Dim cpuxa
    Set cpuxa = hs.Plugin("Applied Digital Ocelot")
    Jon

    Comment


      #3
      Perfect thanks again Jon. Have another question maybe you can help me with. I need to pulse a relay for the garage door. Seems what I have in my script doesn't work consistantly. The door either doesn't recieve the signal or it pulse once and then again so the door begins to close then reverses right away. Any better ideas would be great. I have tried a longer and a shorter wait time with the same results.

      Comment


        #4
        The script is relatively sound. I would suspect your problem is that the event that is triggering the script is re-triggering. In the event under the name tab, put a value of 15 seconds in the Cannot Re-trigger For: (seconds) box.

        If you want to make the script a little more robust, you could do something like:

        PHP Code:
        Sub main()

        Dim cpuxa
        Dim doorstatus
        Dim check

        Set cpuxa 
        hs.Plugin("Applied Digital Ocelot")

        doorstatus =hs.DeviceStatus("`5"'Reference to relay 0
        if doorstatus = 3 then
            hs.Speak "Garage door is already closed."
        else

            hs.Speak "I will close garage door."
            hs.WaitSecs 3

            '
        attempt to make sure the relay goes on routine
            
        For check=1 to 10
                cpuxa
        .SetPoint 1,0,1
                
        If cpuxa.Getpoint(1,0,1)= 0 then exit for 
            
        next

            hs
        .WaitSecs 2

            
        'attempt to make sure the relay goes off routine
            For check=1 to 10
                cpuxa.SetPoint 1,0,0
                If cpuxa.Getpoint(1,0,1)= 1 then exit for 
            next
        end if
        end sub 
        Jon

        Comment


          #5
          I will give that a try. Thanks again Jon.

          Comment

          Working...
          X