I have a script which is called via several different events to open/close a set of vertical blinds. This method and script has worked for me for years with no issues but lately has been acting up.
Essentially, the script has three entry points, "Open", "Close" and "Toggle". The latter opens or closes the drapes based on their current open/closed condition as determined by a virtual device which tracks the status.
Lately, when the script runs (without error) the Z-Wave module controlled does indicate according to the HS GUI that it has in fact been activated, and the virtual device does track as expected, but the real world Z-Wave module is never turned on nor off.
If however, I activate the device from the GUI manually or by using Event Actions directly (no Script), the Z-Wave module does work properly.
The script (I've only included the Toggle function here):
Note the Virtual Device Values are defined as: "100 = Open, 0=Closed, 10=Closing, 90=Opening". This is not a problem.
In order to ensure things do work, this morning I've resorted to calling a second event with direct Device Actions as follows. This shouldn't be necessary.
What's changed? The only thing which has changed on my installation related to this would be the conversion from an older Z-Troller Z-Wave controller to a new HS SmartStick.
Currently using HS3 Pro Edition 3.0.0.523 (Windows) and Z-Wave Plugin v3.0.1.261.
Any suggestions?
Essentially, the script has three entry points, "Open", "Close" and "Toggle". The latter opens or closes the drapes based on their current open/closed condition as determined by a virtual device which tracks the status.
Lately, when the script runs (without error) the Z-Wave module controlled does indicate according to the HS GUI that it has in fact been activated, and the virtual device does track as expected, but the real world Z-Wave module is never turned on nor off.
If however, I activate the device from the GUI manually or by using Event Actions directly (no Script), the Z-Wave module does work properly.
The script (I've only included the Toggle function here):
Note the Virtual Device Values are defined as: "100 = Open, 0=Closed, 10=Closing, 90=Opening". This is not a problem.
Code:
Sub Toggle(Parm As Object) If hs.DeviceValueByName("Living Room Front Blind Status") = 100 Then DeviceAction("Living Room Front Blind", "On") hs.SetDeviceValueByName("Living Room Front Blind Status",10) hs.waitsecs(15) DeviceAction("Living Room Front Blind", "Off") hs.SetDeviceValueByName("Living Room Front Blind Status",0) hs.SetDeviceLastChange(hs.GetDeviceRefByName("Living Room Front Blind Status"),now) Else DeviceAction("Living Room Front Blind", "On") hs.SetDeviceValueByName("Living Room Front Blind Status",90) hs.waitsecs(15) DeviceAction("Living Room Front Blind", "Off") hs.SetDeviceValueByName("Living Room Front Blind Status",100) hs.SetDeviceLastChange(hs.GetDeviceRefByName("Living Room Front Blind Status"),now) End If End Sub Sub DeviceAction(Device As String, Action As String) Dim objCAPIControl As CAPIControl Dim DvRef As Integer = hs.GetDeviceRefByName(Device) hs.CAPIControlHandler(hs.CAPIGetSingleControl(DVRef, True,Action.ToUpper,False,False)) End Sub
Code:
Sub Toggle(Parm As Object) If hs.DeviceValueByName("Living Room Front Blind Status") = 100 Then hs.TriggerEvent("Activate Front Blind") hs.waitsecs(15) hs.SetDeviceValueByName("Living Room Front Blind Status",0) hs.SetDeviceLastChange(hs.GetDeviceRefByName("Living Room Front Blind Status"),now) Else hs.TriggerEvent("Activate Front Blind") hs.waitsecs(15) hs.SetDeviceValueByName("Living Room Front Blind Status",100) hs.SetDeviceLastChange(hs.GetDeviceRefByName("Living Room Front Blind Status"),now) End If End Sub
Currently using HS3 Pro Edition 3.0.0.523 (Windows) and Z-Wave Plugin v3.0.1.261.
Any suggestions?
Comment