Announcement

Collapse
No announcement yet.

Homeseer start up variable question

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

    Homeseer start up variable question

    I am wanting to edit the homeseer3 startup script to look at a virtual device/flag in homeseer3 and determine if it is on/off and should manually start/run an event or not.
    Can someone tell me if this is even possible or not? If so can you tell me what the syntax for a addressing this variable would look like? I was thinking something like this (below), can anyone with a little more experience than me help with this?

    Dim DevRef As Integer
    DevRef = hs.GetDeviceRefByName("DeviceName")
    If hs.IsOn(DevRef) then
    hs.TriggerEvent("EventName")
    End If

    Last edited by carloski; April 17, 2018, 09:21 AM. Reason: Did some reading/found some scripting instructions

    #2
    Originally posted by carloski View Post
    I am wanting to edit the homeseer3 startup script to look at a virtual device/flag in homeseer3 and determine if it is on/off and should manually start/run an event or not.
    Can someone tell me if this is even possible or not? If so can you tell me what the syntax for a addressing this variable would look like? I was thinking something like this (below), can anyone with a little more experience than me help with this?

    Dim DevRef As Integer
    DevRef = hs.GetDeviceRefByName("DeviceName")
    If hs.IsOn(DevRef) then
    hs.TriggerEvent("EventName")
    End If

    If you edit \scripts\Startup.vb and include a row at the bottom, right above the End Sub row, like this:

    hs.TriggerEvent("Event Name Goes Here")

    Then in the event itself, you can include your device as a condition as to whether it runs or not.

    Let me know if you need more specifics on this
    cheeryfool

    Comment


      #3
      If you trigger the event from the start up the event would have to be manually triggered which would render any if statements to look at the device mute correct? How can that work?

      Comment


        #4
        Thanks for answering by the way. I may have not have been very clear. It seems to me that the event has to be manually triggered in order to run from the startup script. Since the event is manually triggered how would you include the IF then, Its already triggered to run. I think that is why I am going to have to do the if statement inside the startup script then trigger if true. If I am wrong please show me what I am missing.

        Comment


          #5
          I am thinking out loud here, but could it be possible to trigger an event from startup script, and the event itself runs a script that does the lf Then logic?

          Comment


            #6
            Originally posted by carloski View Post
            I am thinking out loud here, but could it be possible to trigger an event from startup script, and the event itself runs a script that does the lf Then logic?
            Yes.

            Alternatively, you could have the event run another event with the appropriate conditions. If you check the advanced option to run the event only if the conditions are satisfied, the second event will be contingent on the conditions being satisfied.
            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
              Originally posted by carloski View Post
              I am thinking out loud here, but could it be possible to trigger an event from startup script, and the event itself runs a script that does the lf Then logic?
              I run an event from the startup script called "Startup Occurred"
              Code:
              Sub Main(Parm As Object)
                  
                  hs.WriteLog("Startup", "(Startup.vb script) Scripting is OK and is now running Startup.vb")
                 	hs.triggerevent("Startup Occurred")
              triggered by this entry in the startup.vb file: hs.triggerevent("Startup Occurred"). As stated above, this event will run ignoring any conditions. Within the Event, I call other Events honoring conditions, send messages and run scripts. This Event takes care of everything I need done at startup such as polling critical devices, synchronizing lights with the time of day, and sending Pushover messages letting me know it started.

              Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	129.1 KB
ID:	1196466
              HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

              Comment

              Working...
              X