Announcement

Collapse
No announcement yet.

Zooz ZEN32 using scene "held down" trigger to dim another

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

    Zooz ZEN32 using scene "held down" trigger to dim another

    I am trying to create a scene were holding one of the 4 scene keys will dim another device. I know how to create a scene and all that just not sure how to handle controlling the other device where the longer you hold the button the brighter it gets. I am assuming I will need some sort of a scritp which I never had a pleasure of creating for homeseer. Any help would be greatly appreciated.

    #2
    I think that the Zen32 supports multilevel commands when you associate devices to groups 3, 5, 7, 9 and 11. ie press and hold to dim up or down. release to stop. press again and it dims up/down the opposite way.

    however since you mentioned scrips, here is how I solved that very issue using a script

    Imports System.Threading, System.Convert
    Public Sub Main(ByVal Parms As Object)
    '' This script should be called when a central scene is set to "held down"
    '' it dims A dimmable device either up Or down until the central scene becomes "key released" or the load hits 99 or 0
    '' Parameters '<target device ref #>|< source device ref central scene #>|up|<dimrate>' or '<target device ref #>|< source device ref central scene #>|down|<dimrate>'
    '' ie: 79|78|up|10

    Dim ParmArray() As String
    ParmArray = Parms.ToString.Split(ToChar("|"))

    Dim DeviceRef As Integer = Integer.Parse(ParmArray(0))
    Dim DeviceValue As Integer = hs.DeviceValue(DeviceRef)
    Dim DeviceRefCS As Integer = Integer.Parse(ParmArray(1))
    Dim DeviceValueCS As Integer
    Dim Keyreleased As Integer = 1001

    Dim UpDown As String = ParmArray(2)

    '' DimStep is the increment value for each dim setting
    Dim DimStep As Integer = 3

    If UpDown = "down" Then DimStep = DimStep * -1
    If UpDown = "down" Then Keyreleased = 2001

    '' DimRate is how long to take between dim levels; ie the rate of dimming in milliseconds
    Dim DimRate As Integer = Integer.Parse(ParmArray(3))


    For value As Integer = 0 To 100

    '' increment the dim% value then set min and max values
    DeviceValue = DeviceValue + DimStep
    If DeviceValue > 99 Then DeviceValue = 99
    If DeviceValue < 0 Then DeviceValue = 0

    '' set the device to the current value
    Dim cc As HomeSeerAPI.CAPIControl = hs.CAPIGetSingleControl(DeviceRef, True, "Dim (value)%", False, False)
    cc.ControlValue = DeviceValue
    Dim cr As HomeSeerAPI.CAPIControlResponse = hs.CAPIControlHandler(cc)

    '' get current central scene value
    DeviceValueCS = hs.DeviceValue(DeviceRefCS)

    '' check to see if we should exit the loop
    If DeviceValue = 0 Or DeviceValue = 99 Or DeviceValueCS = Keyreleased Then Exit Sub

    Thread.Sleep(DimRate)
    Next

    End Sub​
    HS4 Pro on Shuttle NC10U, Win10; Z-NET
    Number of Devices: 1005
    Number of Events: 293

    Plug-Ins: BLLock, DirecTv, EasyTrigger, Honeywell WiFi Thermostat, Marquis monoprice Amp, MeiHarmonyHub, PHLocation2, Pushover 3P, UltraM1G3, rnbWeather, Worx Landroid, Z-Wave

    External applications: Homebridge-homeseer, Geofency, EgiGeoZone.

    Comment


      #3
      i did this for a Zen32 and a Homeseer WX-300 using associations. Works like a charm. I associated 4 to the switch for On/Off and 5 to the switch for Dim Up and then Dim Down...

      The downside is that I am still going through the forum to see how to update the Zen32 scene button lights when the WX-300 switch is used manually.

      Comment


        #4
        Originally posted by jmaddox View Post
        I think that the Zen32 supports multilevel commands when you associate devices to groups 3, 5, 7, 9 and 11. ie press and hold to dim up or down. release to stop. press again and it dims up/down the opposite way.

        however since you mentioned scrips, here is how I solved that very issue using a script
        Can you please explain to me where I would put the target device id and the source of the scene controller?

        If I read this correctly this is the line I need to edit..


        Dim DeviceRef As Integer = Integer.Parse(ParmArray(0))
        Dim DeviceValue As Integer = hs.DeviceValue(DeviceRef)
        Dim DeviceRefCS As Integer = Integer.Parse(ParmArray(1))
        Dim DeviceValueCS As Integer
        Dim Keyreleased As Integer = 1001​

        Comment


          #5
          Code:
          '' This script should be called when a central scene is set to "held down"
          '' it dims A dimmable device either up Or down until the central scene becomes "key released" or the load hits 99 or 0
          '' Parameters '<target device ref #>|< source device ref central scene #>|up|<dimrate>' or '<target device ref #>|< source device ref central scene #>|down|<dimrate>'
          '' ie: 79|78|up|10
          You pass the RefID of the target device (dimmer), the “Up” device (button you want to initiate the dim up) as parameters when you call the script. When you press the button for dim up, the script will run increasing the level until it reaches 99 or the the button is released, then the script exits. Down works the same way except dimming down until the load is 0 or the button is released.
          HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

          Comment


            #6
            Originally posted by randy View Post
            Code:
            '' This script should be called when a central scene is set to "held down"
            '' it dims A dimmable device either up Or down until the central scene becomes "key released" or the load hits 99 or 0
            '' Parameters '<target device ref #>|< source device ref central scene #>|up|<dimrate>' or '<target device ref #>|< source device ref central scene #>|down|<dimrate>'
            '' ie: 79|78|up|10
            You pass the RefID of the target device (dimmer), the “Up” device (button you want to initiate the dim up) as parameters when you call the script. When you press the button for dim up, the script will run increasing the level until it reaches 99 or the the button is released, then the script exits. Down works the same way except dimming down until the load is 0 or the button is released.
            Sorry this is all new to me, so I added the script to my script tolder exactly as copied from here, created an event. In the Parameters of the event, this is where I would enter those info?

            What would my parameter look like if say my target device IE: Smart bulb dimmer is 841 and my scene controller is 849?

            Click image for larger version

Name:	Wells-Fargo-Transaction.png
Views:	261
Size:	79.8 KB
ID:	1582388

            Comment


              #7
              Originally posted by dannieboiz View Post

              Sorry this is all new to me, so I added the script to my script tolder exactly as copied from here, created an event. In the Parameters of the event, this is where I would enter those info?

              What would my parameter look like if say my target device IE: Smart bulb dimmer is 841 and my scene controller is 849?

              Click image for larger version  Name:	Wells-Fargo-Transaction.png Views:	0 Size:	79.8 KB ID:	1582388
              No worries!

              If for the up key it would be 841|849|up|10. 10 is the dim rate. For the down key it would be the same except replace 849 with the Ref of the down key and change up to down.

              Put that string in the field labeled Parameters at the bottom.

              You don’t want to use Easy Trigger as the trigger. Use the HS “This Device had its value set to..”. This is the correct way to Trigger on Central Scene devices. You will need two buttons and two Events. One for dim up and a second for dim down.
              HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

              Comment


                #8
                So I set it up as recommend and added an up and down event. This is what both looks like except one says up one say down but it doesn't seem to do anything. However, the event does show that it was executed.

                Here's my down event
                Click image for larger version  Name:	image.png Views:	0 Size:	75.0 KB ID:	1582438
                Here's the up

                Click image for larger version  Name:	image.png Views:	0 Size:	52.7 KB ID:	1582439​​

                Comment


                  #9
                  Give me an hour or two and I will test. It looks like it should work, but I never used it.
                  HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

                  Comment


                    #10
                    OK. I see the problem. These controllers have only one Central Scene Device, so the script will not work. I should have caught that at first.
                    HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

                    Comment


                      #11
                      Originally posted by randy View Post
                      OK. I see the problem. These controllers have only one Central Scene Device, so the script will not work. I should have caught that at first.
                      Thanks for looking into this. Gotta find another way.

                      Comment


                        #12
                        Which is why I wanted to use the Association functions of the Zen32 which would have worked exactly like desired -- each button would be on/off as well as dimming up and down directly to the targeted load. Which when I tested it worked exactly as expected.

                        Unfortunately, in Production, my loads are on one Network and the switch is going to have to be on another since it is too far away from the loads' Z-net to be reachable. Simple solution would be to merge Z-net onto the same Primary network but apparently under 4.1.x.x Z-wave Plugin this is impossible. So getting this to work is going to be very important here...

                        Using the single Central scene one would have to not only manage the dim level base on hold/release, but also direction (up/down) via toggle since it is one button to be used as up for one press&hold and then down next time and so on. If one could associate with a virtual device then you could simply 'match' the virtual device to the actual device.

                        The Zen32 has a lot of internal smarts for those 4 buttons - but it really was designed to be used via Associations to the end device/load...

                        Comment

                        Working...
                        X