Announcement

Collapse
No announcement yet.

need help with event script

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

    need help with event script

    hi all,

    im building a script to make an event when running..
    but there is one thing i dont get , i get an error: ')' expected.

    this is the script:

    the line what gives the error is this one
    hs.AddDeviceActionToEvent(EvRef,hs.CAPIGetSingleControl(hs.G etDeviceRef("1623"),true,"on",false,true))

    i use tenscript aid. but where to put this line?
    hs.CAPIControlHandler(hs.CAPIGetSingleControl(1623,True,"Off ",False,False))

    Code:
    Sub CreateEvent(StartTime,StartDate,Delay,DeviceName)
    Dim EvRef As Integer
    Dim EvTime As Date
    dim CC as CAPIControl
    
    
    EvTime = "09:30"
    
    ' Create the Event
    EvRef = hs.NewEventEx("New Test Event","Test","")
    ' Set the time trigger
    hs.EventSetTimeTrigger(EvRef,EvTime)
    ' Add the device action "A13 On" which is the water heater
    hs.AddDeviceActionToEvent(EvRef,hs.CAPIGetSingleControl(hs.G etDeviceRef("1623"),true,"on",false,true))
    
    
    
    
    ' Enable the Event
    hs.DeleteAfterTrigger_Set(EvRef)
    hs.EnableEventByRef(EvRef)
    End Sub
    Preferred -> Jon's Plugins, Pushover, Phlocation, Easy-trigger,
    Rfxcom, Blade Plugins, Pushbullet, homekit, Malosa Scripts




    HS3Pro 4.0.8.0 on windows 10 enterprise X64 on hp quadcore laptop 8 GB.

    #2
    i soldev it already was a space in the script
    Last edited by Malosa; June 13, 2016, 01:28 PM.
    Preferred -> Jon's Plugins, Pushover, Phlocation, Easy-trigger,
    Rfxcom, Blade Plugins, Pushbullet, homekit, Malosa Scripts




    HS3Pro 4.0.8.0 on windows 10 enterprise X64 on hp quadcore laptop 8 GB.

    Comment


      #3
      Does this work?

      Code:
      hs.AddDeviceActionToEvent(EvRef,hs.CAPIGetSingleControl(1623,True,"Off",False,False))

      Comment


        #4
        Thanks Adam ,

        thanks , i found my fault already , there was a blank space in my script , thats why it didn't trigger.

        do you know how i can add more actions to the script so i can make more ones like :

        1.delay
        2.event is manually triggered
        3.recurring


        im still learning scripting ,

        regards

        Originally posted by mrhappy View Post
        Does this work?

        Code:
        hs.AddDeviceActionToEvent(EvRef,hs.CAPIGetSingleControl(1623,True,"Off",False,False))
        Preferred -> Jon's Plugins, Pushover, Phlocation, Easy-trigger,
        Rfxcom, Blade Plugins, Pushbullet, homekit, Malosa Scripts




        HS3Pro 4.0.8.0 on windows 10 enterprise X64 on hp quadcore laptop 8 GB.

        Comment

        Working...
        X