[Message Prev][Message
Next][Thread Prev][Thread Next][Message
Index][Thread Index]
Re: xpl-C Gate
Hi Frank,
Below is a script that I use to capture the state of all C-Bus loads and
store them in globals.
Look at the lines beginning with "case 0", "case 1"
etc.
These are where I map the group addresses into friendly names, like
"CBus_Hall" for my hall light.
(I prefix all my C-Bus related globals with CBus so they all appear
together in the list)
Also, remember to change the johnb_cgate_ws01 bit to whatever your C-Gate
instance is called.
Good luck,
John
'------------------------------
' Routine to capture C-Bus events
' and place them into global variables
'
' NB: Please change the name of this sub routine to
' reflect the instance of xPL C-Gate that you are using.
'------------------------------
sub johnb_cgate_ws01_trigger(XplMsg)
dim devName, devLevel
' Which group address?
' NB: Modify the cases below to suit your own group addresses.
Select Case xpl.GetParam(XplMsg,"device",True)
Case 0
devName = "CBus_Hall"
Case 1
devName = "CBus_FB-LH-Table"
Case 2
devName = "CBus_Office"
Case 3
devName = "CBus_FB-Ceiling"
Case 5
devName = "CBus_FB-RH-Table"
Case Else
devName = "CBus_" &
xpl.GetParam(XplMsg,"device",True)
End Select
' Determine the type of operation
Select Case ucase(xpl.GetParam(XplMsg,"current",True))
Case "ON"
devLevel = 255
Case "OFF"
devLevel = 0
Case "RAMP"
devLevel = xpl.GetParam(XplMsg,"ramplevel",True)
End Select
' Set the global variable
sys.value(devName) = devLevel
End Sub
xPL Main Index |
xPL Thread Index |
xPL Home |
Archives Home
|