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.
Announcement
Collapse
No announcement yet.
Zooz ZEN32 using scene "held down" trigger to dim another
Collapse
X
-
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 SubHS4 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.
-
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
-
Originally posted by jmaddox View PostI 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
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
-
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
HS4 Pro, 4.2.18.3 Windows 10 pro, Supermicro LP Xeon
Comment
-
Originally posted by randy View PostCode:'' 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
What would my parameter look like if say my target device IE: Smart bulb dimmer is 841 and my scene controller is 849?
Comment
-
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?
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.18.3 Windows 10 pro, Supermicro LP Xeon
Comment
-
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
Comment