Announcement

Collapse
No announcement yet.

Controlling multiple devices with one Slider - Solved!

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Originally posted by Rupp View Post
    OK, after thinking about this a bit more this is what I came up with. See if this works for you.
    • Create the slider in the designer
    • Select the Actions Actions When Selected... Collection
    • Add an action
    • Select HomeSeer: HomeSeer: Run a HomeSeer script with values from elements(s)
    • Select slider.vb (code below)
    • SciptProcedure: Main
    • Parameters - ScriptParameter1: select your slider from the drop down screen
    • Select OK to dismiss the Action Editor

    Here's the content of the slider.vb script
    Code:
    Sub Main(parm as object)
      hs.writelog("HSTouch", parm(0))
      hs.Transmit("D2","DDim",parm(0),0,False,False)
      hs.Transmit("D3","DDim",parm(0),0,False,False)
    End Sub
    Change the hs.Transmit calls to your other lights.

    The way this works is you grab the slider and when you let go it runs the script.
    Yes it works for me.

    What would be the script and the parms in the action section of HSTouch using D2 and D3 as parms instead of hardcoded in slider.vb?
    I tried to parm it but I can't get that to work.

    Comment


      #17
      I like the way this works. The lights associated show dim levels while the slider is being changed, which is different from what I am seeing when I have the dimmer directly control a light switch. Unless there is a way to get the sliders to do this without the code, I will be re-writing it to have the device passed as well and looping through to get them so I can have one script for all sliders.


      Originally posted by Rupp View Post
      OK, after thinking about this a bit more this is what I came up with. See if this works for you.
      • Create the slider in the designer
      • Select the Actions Actions When Selected... Collection
      • Add an action
      • Select HomeSeer: HomeSeer: Run a HomeSeer script with values from elements(s)
      • Select slider.vb (code below)
      • SciptProcedure: Main
      • Parameters - ScriptParameter1: select your slider from the drop down screen
      • Select OK to dismiss the Action Editor


      Here's the content of the slider.vb script
      Code:
      Sub Main(parm as object)
        hs.writelog("HSTouch", parm(0))
        hs.Transmit("D2","DDim",parm(0),0,False,False)
        hs.Transmit("D3","DDim",parm(0),0,False,False)
      End Sub
      Change the hs.Transmit calls to your other lights.

      The way this works is you grab the slider and when you let go it runs the script.
      Karl S
      HS4Pro on Windows 10
      1070 Devices
      56 Z-Wave Nodes
      104 Events
      HSTouch Clients: 3 Android, 1 iOS
      Google Home: 3 Mini units, 1 Pair Audios, 2 Displays

      Comment


        #18
        Multiple device slider

        Hey guys !

        I used this script on many interfaces back then and we have a new client that would make a good use of this. We setup the whole thing to control multiple devices with this script based on yours :

        Sub Main(parm as object)
        hs.writelog("HSTouch", parm(0))
        hs.Transmit("\13","DDim",parm(0),0,False,False)
        hs.Transmit("\21","DDim",parm(0),0,False,False)
        hs.Transmit("\12","DDim",parm(0),0,False,False)
        hs.Transmit("\14","DDim",parm(0),0,False,False)
        End Sub



        We get this error and only the FIRST device in the script gets dimmed to the slider's level :

        Running script, script run or compile error in file: Slider4.vb.txt1006:Expected ')' in line 1 More info: Expected ')'

        Anyone ? ! Thx

        Comment


          #19
          Was this one of the reasons I am not upgrading to HS3? There were a couple things that were not working in HS3 and I thought this might be one. I may be wrong, though. I believe my Wayne Dalton Garage Door method is the big reason. I just thought there was a Touch reason as well. But I have been so busy remodeling that I have not been on the forums for a while.
          Karl S
          HS4Pro on Windows 10
          1070 Devices
          56 Z-Wave Nodes
          104 Events
          HSTouch Clients: 3 Android, 1 iOS
          Google Home: 3 Mini units, 1 Pair Audios, 2 Displays

          Comment


            #20
            Using HS2 :/

            Comment


              #21
              Can anyone tell me where it's missing the ")" ?
              Or any other way to control multiple devices using one slider ?

              I cant believe this is not more commonly used as an option, is it implemented in HS3 ?

              Either, I need an HS2 solution for now.

              Comment


                #22
                Sorry if this is a stupid question... Did you save it with a .vb extension?

                Nevermind, looks like you did.

                Comment


                  #23
                  In my case I am using an alpha-numeric device code. You have \#. Do you have an alpha-numeric code for these as well? If so, have you tried using it instead? Also, are those zeros or do you have capitol o prior to the two False parameters? Last, make sure the quote marks are not begin and end quote marks by replacing each. I have seen where either the source is not simple quotes or a copy/paste replace these with opening/closing quotes as opposed to the plain quote.

                  Originally posted by loowee View Post
                  Hey guys !

                  I used this script on many interfaces back then and we have a new client that would make a good use of this. We setup the whole thing to control multiple devices with this script based on yours :

                  Sub Main(parm as object)
                  hs.writelog("HSTouch", parm(0))
                  hs.Transmit("\13","DDim",parm(0),0,False,False)
                  hs.Transmit("\21","DDim",parm(0),0,False,False)
                  hs.Transmit("\12","DDim",parm(0),0,False,False)
                  hs.Transmit("\14","DDim",parm(0),0,False,False)
                  End Sub



                  We get this error and only the FIRST device in the script gets dimmed to the slider's level :

                  Running script, script run or compile error in file: Slider4.vb.txt1006:Expected ')' in line 1 More info: Expected ')'

                  Anyone ? ! Thx
                  Karl S
                  HS4Pro on Windows 10
                  1070 Devices
                  56 Z-Wave Nodes
                  104 Events
                  HSTouch Clients: 3 Android, 1 iOS
                  Google Home: 3 Mini units, 1 Pair Audios, 2 Displays

                  Comment


                    #24
                    You look to have two file extensions in the script and I guess it is using the last one, it says Slider4.vb.txt on the error so the .txt needs to be removed. Concerning HS3 then you will need to research CAPI as hs.transmit has gone.

                    Comment


                      #25
                      Hi guys !

                      I cant beleive i did not see that but you were right, I got my tech to create the files from another pc and he did not have the extensions displayed for known file types.

                      So simple I never tought about looking at the files

                      Script is working fine ! Thx a lot for this !!

                      P.s.: Joe, it wasnt the question that was stupid. It's the guy were asking it to ! LoL

                      Comment


                        #26
                        CAPI Replacement Script

                        Has anyone written a replacement script for HS3 that achieves the same purpose? I would really appreciate a share

                        Thanks

                        Vodden

                        Comment


                          #27
                          I have something similar working which I wrote to control multiple devices. I have a Virstual device associated with each light and placed a checkbox for each in HSTouch. If the box is checked, that light is controlled. Here is the script:

                          Code:
                          Sub Main(Parms As Object)
                          '  hs.writelog("Parameter Test",CInt(Parms(0)))
                          
                          
                          Dim SelectorRef As Integer
                          Dim DevRef As Integer
                          
                          'Ceiling Fan
                          SelectorRef = hs.GetDeviceRefByName("Ceiling Fan Light Selector")
                          DevRef = hs.GetDeviceRefByName("Ceiling Fan Light")
                          
                          If hs.IsOn (SelectorRef) then
                          hs.CAPIControlHandler(hs.CAPIGetSingleControl(DevRef,false,CInt(Parms(0)),false,true))
                          end if
                          
                          'Fireplace Outside Cans
                          SelectorRef = hs.GetDeviceRefByName("HSTouch -Fireplace Outside Cans Selector")
                          DevRef = hs.GetDeviceRefByName("Fireplace Outside Lights")
                          If hs.IsOn (SelectorRef) then
                            hs.CAPIControlHandler(hs.CAPIGetSingleControl(DevRef,false,CInt(Parms(0)),false,true))
                          end if
                          
                          DevRef = hs.GetDeviceRefByName("Fireplace Inside Lights")
                          SelectorRef = hs.GetDeviceRefByName("HSTouch -Fireplace Inside Cans Selector")
                          If hs.IsOn (SelectorRef) then
                            hs.CAPIControlHandler(hs.CAPIGetSingleControl(DevRef,false,CInt(Parms(0)),false,true))
                          end if
                          
                          DevRef = hs.GetDeviceRefByName("Entrance Light @ Door")
                          SelectorRef = hs.GetDeviceRefByName("HSTouch - Foyer Selector")
                          If hs.IsOn (SelectorRef) then
                            hs.CAPIControlHandler(hs.CAPIGetSingleControl(DevRef,false,CInt(Parms(0)),false,true))
                          end if
                          
                          DevRef = hs.GetDeviceRefByName("Light Outside Powder Room")
                          SelectorRef = hs.GetDeviceRefByName("HSTouch - Light Outside Powder Room Selector")
                          If hs.IsOn (SelectorRef) then
                            hs.CAPIControlHandler(hs.CAPIGetSingleControl(DevRef,false,CInt(Parms(0)),false,true))
                          end if
                          
                          SelectorRef = hs.GetDeviceRefByName("HSTouch - Stairs Light Selector")
                          DevRef = hs.GetDeviceRefByName("Main Stairs Lights @ Top of Steps")
                          If hs.IsOn (SelectorRef) then
                            hs.CAPIControlHandler(hs.CAPIGetSingleControl(DevRef,false,CInt(Parms(0)),false,true))
                          end if
                          
                          End Sub
                          The lighter area in the screen is the living room area. The slider controls all the items with check boxes in that area.

                          Click image for larger version

Name:	Screenshot_2017-01-07-10-17-08.jpg
Views:	1
Size:	53.1 KB
ID:	1188452
                          Last edited by ksum; January 9, 2017, 07:15 AM. Reason: Fixed formattnig to wrap all of the code
                          Karl S
                          HS4Pro on Windows 10
                          1070 Devices
                          56 Z-Wave Nodes
                          104 Events
                          HSTouch Clients: 3 Android, 1 iOS
                          Google Home: 3 Mini units, 1 Pair Audios, 2 Displays

                          Comment


                            #28
                            CAPI Replacement Script

                            Originally posted by ksum View Post
                            I have something similar working which I wrote to control multiple devices. I have a Virstual device associated with each light and placed a checkbox for each in HSTouch. If the box is checked, that light is controlled.
                            Thank you for the quick reply ksum. I'm sure I will have a few more questions soon enough.

                            I will give this a try.

                            Thanks Again!

                            Comment


                              #29
                              Sounds good. I suggest you start a new thread, though.

                              Also note that I just edited my post as I had the code formatted incorrectly. It did not include the beginning portion. The section inside the Code area is now complete.
                              Karl S
                              HS4Pro on Windows 10
                              1070 Devices
                              56 Z-Wave Nodes
                              104 Events
                              HSTouch Clients: 3 Android, 1 iOS
                              Google Home: 3 Mini units, 1 Pair Audios, 2 Displays

                              Comment


                                #30
                                CAPI Replacement Script WORKING PERFECTLY!

                                Originally posted by Vodden View Post
                                Thank you for the quick reply ksum. I'm sure I will have a few more questions soon enough.

                                I will give this a try.

                                Thanks Again!
                                I made the reference changes to my project and deployed it and it worked perfectly!



                                Thanks ksum!

                                Comment

                                Working...
                                X