I have two HS-WS100+ switches connected to 12V DC supplies powering LED PWM Z-wave Solid Apollo Z-Wave LED Dimmer Controller dimmers. Electrically this works very well, smooth dimming with no buzzing to a very low light level. How do I implement behavior like press-and-hold to increase or decrease dimming? Double tap to full-brightness? I would like the scene controller to operate this external dimmer. Apologies if this is a newb question, please direct me to the appropriate resource.
Announcement
Collapse
No announcement yet.
HS-WS100+ scene to control dimmer
Collapse
X
-
The double tap to full brightness is the easiest thing to implement. Use your central scene "had its value set to Scene 001 Key Pressed 2 Times" to set the dimmer to 'on'
Dimming up/down when holding the dimmer up/down is harder to implement. I started working on this issue but then abandoned my work when I changed how my lights were configured. I had decided to use a script that was triggered by the central scene 'had its value set to Scene 001 (002) Key Held Down". The script would read the lights current value and increment/decrement it's value until the central scene was set to Scene 001 (002) Key released.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.
-
Originally posted by jmaddox View PostThe double tap to full brightness is the easiest thing to implement. Use your central scene "had its value set to Scene 001 Key Pressed 2 Times" to set the dimmer to 'on'
Dimming up/down when holding the dimmer up/down is harder to implement. I started working on this issue but then abandoned my work when I changed how my lights were configured. I had decided to use a script that was triggered by the central scene 'had its value set to Scene 001 (002) Key Held Down". The script would read the lights current value and increment/decrement it's value until the central scene was set to Scene 001 (002) Key released.
Dimmer level interface, electrical and software below:
Comment
-
With my system a dimrate of 100 works fairly well... the higher the number the finer your dimming control will be. Too low and you'll always either turn the load on or off before you have a chance to release the key.
Code: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 '<device ref #>|<device ref central scene #>|up|<dimrate>' or '<device ref #>|<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
-
Originally posted by jmaddox View PostWith my system a dimrate of 100 works fairly well... the higher the number the finer your dimming control will be. Too low and you'll always either turn the load on or off before you have a chance to release the key.
Comment
-
Originally posted by lifespeed View Post
Sorry for the slow reply, thanks for posting your code. Should the file extension be .VBS? Did your code work, you mentioned ditching it for a different solution? Are you able to provide some guidance on how this integrates in HS3? I copied the script into the scripts folder, but don't know where to find it in HS3 interface. Looking at the HS3 documentation now, we'll see how far that gets me.
you'll need to create two events. one to dim the light up, and one to dim it down. When you create your event you'll click the 'edit' button to browse to your script. You can also create a new script using the same dialog. When the Select a script file dialog pops up, either select a script you already have in that folder or append a new script name at the end of c:/program files/homeseer hs3/scripts/newscript.vb. You'll be given a blank script in the edit box dialog you can then paste into or alter as you wish. be careful in that if you use the same script name in multiple events, editing it in one, edits the script file which then affects all your events.
Here is a screen capture of the event I used to test dimming a light down. You'll need to change your parameters to reflect your device id's
when you click 'edit' this dialog will pop up, pick the script you saved, or create a new one by adding the name at the end of / and hitting submit.
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
-
Guest
Hi Jmaddox
I just found your script and is trying to get it to work. I´m using it the same way you do, but are getting an error in the log. The error is:
Running script C:\Program Files (x86)\HomeSeer HS3\scripts\Dim_Load.vb :Exception has been thrown by the target of an invocation.Object reference not set to an instance of an object.
you say I need to use the "Device Ref ID". Is that the value I can find under the device -> Advanced? Or is it located under the Device -> Z-wave -> Node ID
I´m trying to get it to work, but with no luck. Do you have any idea what that error means?
Happy New Year.
Best regards
Thomas
Comment
-
I am sorry I do not know why you're getting that error, other than I don't tend to include error catching in my scripts I'm really more of a monkey with a keyboard than an actual programmer... I suspect you're not providing all the parameters the script expects. You can find a device's ref ID under the Advanced tab. it's the top item 'Reference ID'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
Comment