Announcement

Collapse
No announcement yet.

How-To: HSTouch - Are You Sure?

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

  • How-To: HSTouch - Are You Sure?

    Here's a way to popup an "Are You Sure??" box when pressing a button in HSTouch. There may be better ways of doing it, but this method seems to work ok for me - hope it helps.

    <iframe width="420" height="315" src="http://www.youtube.com/embed/QtprBBe-Bfg" frameborder="0" allowfullscreen></iframe>
    HS3Pro Running on a Raspberry Pi3
    64 Z-Wave Nodes, 168 Events, 280 Devices
    UPB modules via OMNI plugin/panel
    Plugins: Z-Wave, BLRF, OMNI, HSTouch, weatherXML, EasyTrigger
    HSTouch Clients: 3 Android, 1 Joggler

  • #2
    great as always! This is something I had wanted to do for a while...such as for my open the garage door "button", it is actually the live video feed of the camera that watches the door.

    So, having it "popup" to confirm would be AWESOME!

    --Dan
    Tasker, to a person who does Homeautomation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

    Comment


    • #3
      Thanks Dan! I just ran across this scenario myself and thought I'd share.
      HS3Pro Running on a Raspberry Pi3
      64 Z-Wave Nodes, 168 Events, 280 Devices
      UPB modules via OMNI plugin/panel
      Plugins: Z-Wave, BLRF, OMNI, HSTouch, weatherXML, EasyTrigger
      HSTouch Clients: 3 Android, 1 Joggler

      Comment


      • #4
        I modified the script. It can now take in devices code OR name and automatically detects WHICH it needs to process - with ON/OFF/DIM as well as the event names as you had it.

        Do you want me to post it here?

        --Dan
        Tasker, to a person who does Homeautomation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

        Comment


        • #5
          Originally posted by drozwood90 View Post
          I modified the script. It can now take in devices code OR name and automatically detects WHICH it needs to process - with ON/OFF/DIM as well as the event names as you had it.

          Do you want me to post it here?

          --Dan
          Ah - very nice! Of course - go ahead and post here!
          HS3Pro Running on a Raspberry Pi3
          64 Z-Wave Nodes, 168 Events, 280 Devices
          UPB modules via OMNI plugin/panel
          Plugins: Z-Wave, BLRF, OMNI, HSTouch, weatherXML, EasyTrigger
          HSTouch Clients: 3 Android, 1 Joggler

          Comment


          • #6
            Basically, instead of entering the event name in the text box, put the event name ";" E to run the event. I did not like using ;, but the | must have been a key "string" that HS used. Everything after the | was being chopped off. I replaced that with the ; and everything started to work.

            Also, this can take a device NAME or device CODE ";" ON or OFF or DIM{value} (no braces...so for dim of 45, DIM45).

            Examples in the comments:

            scriptHSTouchInterface,vb

            Code:
            Private Function StringFind(ByVal strSearchIn As String, ByVal strSearchFor As String) As Boolean
                If InStr(1, strSearchIn, strSearchFor, vbTextCompare) > 0 Then
                    StringFind = True
                End If
            End Function
            
            Sub Main(ByVal parm as object)
               ' String definition:
               '     [3 digit device code] 
               '      or [device location and name] 
               '      or [event name] 
               '    ; 
               '      [ON] or [OFF] 
               '      or [E] or [Evt] 
               '      or [Event] or[DIM concatenated with a dim value]
               ' examples: 
               '  ^41;ON 
               '     will execute execx10 ON for device ^41
               '  Garage Cardoor;ON
               '     performs a device lookup for Garage Cardoor, then turns it on
               '  Turn Garage Car Door On;E
               '     executes the event "Turn Garage Car Door On"
               '  ^41;DIM50
               '     will dim device ^41 by 50
               
               Dim myCommand
            
               myCommand = Split(parm(0), ";")
                  
               if(StringFind(myCommand(1).ToUpper(),"E")) then
                  hs.triggerEvent(myCommand(0))
               elseif(StringFind(myCommand(1).ToUpper(),"DIM")) then
                  if(myCommand(0).Length() < 4) then
                     hs.execx10(myCommand(0),"DIM",Split(myCommand(1).ToUpper(),"M")(1))
                  else
                     hs.execx10(hs.GetDeviceCode(myCommand(0)),"DIM",Split(myCommand(1).ToUpper(),"M")(1))
                  end if
               else
                  if(myCommand(0).Length() < 4) then
                     hs.execx10(myCommand(0),myCommand(1))
                  else
                     hs.execx10(hs.GetDeviceCode(myCommand(0)),myCommand(1))
                  end if
               end if   
               
            End Sub
            Tasker, to a person who does Homeautomation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

            Comment

            Working...
            X