I have been playing with a way to use existing Zwave Dimmers as to control more than just their light and wanted to share. This is based off someones posting of using scene controllers for this with counters.
Functionally this is how it works. I have one Zwave switch that I normally don't use so much (hall light). When I turn on and then off the light within 3 seconds I can trigger events/scripts/device actions etc.
For this you need atleast 3 events and one counter.
Switch Monitor Event
IF Device just had its value set or changed "Hall Light"
THEN Start Timer "Hall Switch"
THEN Increment Counter "Hall Switch Counter"
Switch Counter / Timer Control
IF Hall Switch's Value is more than 3s
THEN Stop Hall Switch
THEN Set Timer "Hall Switch" to 0 Seconds
THEN Reset Counter "Hall Switch Counter" to 0
Switch Counter Event
IF "Hall Switch Counter" value becomes this: 2
THEN... You can really put anything here
In this case I run an event that turns off all of the lights in the house. In another case I run a script to toggle a separate light
Here is that script btw
There are endless possibilities with this. I was hoping to get this working with pressing the on button twice however it appears that at least with my dimmers, that it doesn't send or register any change and thus increment the counter with the second On press.
If anyone can improve on this method please post
Thanks
Functionally this is how it works. I have one Zwave switch that I normally don't use so much (hall light). When I turn on and then off the light within 3 seconds I can trigger events/scripts/device actions etc.
For this you need atleast 3 events and one counter.
Switch Monitor Event
IF Device just had its value set or changed "Hall Light"
THEN Start Timer "Hall Switch"
THEN Increment Counter "Hall Switch Counter"
Switch Counter / Timer Control
IF Hall Switch's Value is more than 3s
THEN Stop Hall Switch
THEN Set Timer "Hall Switch" to 0 Seconds
THEN Reset Counter "Hall Switch Counter" to 0
Switch Counter Event
IF "Hall Switch Counter" value becomes this: 2
THEN... You can really put anything here
In this case I run an event that turns off all of the lights in the house. In another case I run a script to toggle a separate light
Here is that script btw
Code:
Sub Main(parm as object) Dim dvref1 = 189 'Upstairs Plant Light Dim Status1 = hs.DeviceValue(dvref1)'Upstairs Plant Light Dim objCAPIControl hs.writelog("Info","Upstairs Plant Light is " & Status1) Select Case Status1 Case 0 objCAPIControl = hs.CAPIGetSingleControl(dvref1,true,"on",false,true) hs.CAPIControlHandler(objCAPIControl) Case 255 objCAPIControl = hs.CAPIGetSingleControl(dvref1,true,"off",false,true) hs.CAPIControlHandler(objCAPIControl) End Select End Sub
If anyone can improve on this method please post
Thanks
Comment