Posted this on HS forum as well, but thought it may be of value to the other plugin users, so will post here as well.
Aaron,
I was having a problem with your code, and think it was due to the hs.setdevicevalue not working (would change light, but then on next press the status showed 0, weird...) Also, the bright logic didnt work for setting the new val. I just tweaked what you did and made it work properly. Here's the code for the hs script:
- Code: Select all
Sub Main(param)
dim cmds
dim CurrVal, DevCode, TheAction, DeltaVal, NewVal
cmds = split(param,",")
DevCode = trim(cmds(0))
TheAction = trim(cmds(1))
DeltaVal = trim(cmds(2))
CurrVal = hs.DeviceValue(DevCode)
If TheAction="Dim" Then
NewVal = CurrVal - DeltaVal
if NewVal =< 1 Then
NewVal = 0
end if
hs.execx10 Devcode,"Ddim",Newval
End If
If TheAction="Bright" Then
NewVal = CurrVal + DeltaVal
if NewVal >= 99 then
NewVal = 100
end if
hs.execx10 Devcode,"Ddim",Newval
END if
End Sub
(Dont laugh, I only know enough vb6 to be dangerous...)
For those that may need a reference to set up the xlobby event, its new event, then select plugin:xseer, command:Run_Script, Variables:Scriptname.txt,main,devicecode,DimORBright,DimLevel.
My example is:
- Code: Select all
XlobbyPluginDim.txt,main,]28,Dim,5
Aaron, I cant thank you enough for the help with dimming, and for creating the xseer plugin! It's that piece of my automation puzzle that I just couldnt seem to find a piece for! Much appreciated!!!
Toby