Announcement

Collapse
No announcement yet.

need help with event script

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

  • Malosa
    replied
    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))

    Leave a comment:


  • mrhappy
    replied
    Does this work?

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

    Leave a comment:


  • Malosa
    replied
    i soldev it already was a space in the script
    Last edited by Malosa; June 13, 2016, 01:28 PM.

    Leave a comment:


  • Malosa
    started a topic need help with event script

    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
Working...
X