Announcement

Collapse
No announcement yet.

Open HSTouch Window From Script?

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

    Open HSTouch Window From Script?

    I have several phones/tablets that I need to change screens on individually and I can't find a way to do it from a script.

    Maybe I am missing something, but the only method I can find is through an event. My workaround was to create an event for each individual HSTouch client, but I'd rather not do that.

    My quick solution was to pass the tablet/phone name to the script as a parameter, then run the script:

    Code:
    	Dim TabletName
    	' Get Tablet origin from HSTouch
    	TabletName = parm(0).ToString ' get input code
    
    		If TabletName = "iPad_1"
    			hs.TriggerEvent("Open User Management HSTouch Screen iPad 1")
    		End If
    
    		If TabletName = "Android_1"
    			hs.TriggerEvent("Open User Management HSTouch Screen Android 1")
    		End If
    
    		If TabletName = "Android_2"
    			hs.TriggerEvent("Open User Management HSTouch Screen Android 2")
    		End If
    	
    		If TabletName = "Android_3"
    			hs.TriggerEvent("Open User Management HSTouch Screen Android 3")
    		End If
    It's a clumsy solution, not to mention that I also have to have a separate HSTouch Designer setup for each individual client (and remember to change all of them any time I edit a screen) to pass the correct ID to the script - does anyone know of a way to open a screen on a specific HSTouch Client from within a script?

    Thanks in advance!
    Last edited by jgreenberg01; June 19, 2018, 02:53 PM.

    #2
    This is what I use to change screens. Substitute your client name for 'Client:Client'.

    PHP Code:
    hs.PluginFunction("HSTouch Server""""ClientAction", New Object() {60Client ":" Client"Splash Screen"""}) 

    Here are most of the available methods.

    The parameters are:

    1) Action number, listed below
    2) The client to send the action to like: Android:Android (name:instance)
    3) parm1
    4) parm2

    parm1 and parm2 are parameters required for the action, for example action number 89 is set
    screen brightness so parm1 would be the brigtness value,
    in this 0->1.

    You can get the parameters by looking at the action in the designer when you add an action.

    Here are the action numbers:

    Control_Select = 10
    Control_Deselect = 20
    Control_TriggerChange = 25
    Control_Activate = 30
    Control_DeActivate = 35
    Control_ActDeActToggle = 37
    Control_AdjustLevelUp = 38
    Control_AdjustLevelDown = 39
    Control_Hide = 40
    Control_Set_Filter = 41
    Control_Set_Image_Norm = 42
    Control_Set_URL_Norm = 43
    Control_Set_RSS_Index = 44
    Control_Set_Text = 45
    Control_Next_RSS_Index = 46
    Control_Set_Alpha = 47
    Control_UnHide = 50
    Control_Disable = 51
    Control_Enable = 52
    Control_Append_Text = 53
    Control_Clear_Text = 54
    Device_Control = 55
    Device_Control_With_Element = 56
    Trigger_Event = 57
    Run_Script_With_Parms = 58
    Device_Set_Selector_Back = 59
    Screen_Show_Only = 60
    Events_Set_Selector_Back = 61
    Device_Set_Selector_Mode = 62
    Screen_Show_Also = 70
    Screen_Show_Also_Modal = 71
    Screen_Close = 80
    Application_Exit = 81
    Launch_Application = 82
    MinimizeApp = 83
    ScreenBrightness = 89
    Pause_Wait = 90
    Play_WAV = 100
    Set_Volume = 101
    Music_PlaySelection = 110
    Music_Set_Selector_Mode = 111
    Music_Mute_On = 112
    Music_Set_Selector_Back = 113
    Music_Mute_Off = 114
    Music_Shuffle_Shuffle = 116
    Music_Shuffle_Order = 118
    Music_Shuffle_Sort = 120
    Music_Repeat_One = 122
    Music_Repeat_All = 124
    Music_Repeat_Off = 126
    Music_Play = 128
    Music_Pause = 130
    Music_PlayIfPaused = 132
    Music_PauseIfPlaying = 134
    Music_TogglePlayPause = 135
    Music_Stop = 136
    Music_Next_Track = 138
    Music_Prev_Track = 140
    Music_Add_Track_To_Playlist = 141
    Music_Volume_Up = 142
    Music_Volume_Down = 144
    Music_SkipToTrack = 146
    Therm_Set_Heat_Setpoint = 147
    Therm_Set_Cool_Setpoint = 148
    Therm_Set_Mode = 149
    Therm_Set_Fan = 150
    Therm_Raise_Lower_Cool_Setpoint = 151
    Therm_Raise_Lower_Heat_Setpoint = 153
    Therm_Set_Hold = 155
    Therm_Next_Mode = 156
    Therm_Next_Fan = 157
    Therm_Raise_Lower_Setpoint = 158
    Don

    Comment


      #3
      Thank you so much Don, that was exactly what I needed!!!!

      Comment


        #4
        Glad it helped. Love HomeSeer but the documentation....
        Don

        Comment


          #5
          Originally posted by donstephens View Post
          Glad it helped. Love HomeSeer but the documentation....
          The "documentation" indeed. I found the hs.PluginFunction in the "End User Documentation", but couldn't find the action numbers anywhere. Is there an available document you got them from?

          Also, one more question: do you know if there is a command that will return the name of the client that a script was run from?

          Comment


            #6
            Originally posted by jgreenberg01 View Post
            Also, one more question: do you know if there is a command that will return the name of the client that a script was run from?
            Not that I'm aware of. Nor could I find a method of getting a list of the HSTouch clients, like you can pull a list of speaker clients.

            The commands in my previous post came from HS2, but appear to work for HS3.
            Don

            Comment

            Working...
            X