Charmed Quark Systems, Ltd. - Support Forums and Community

Full Version: Insteon control from remote
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How did people setup Insteon lights so they can be controlled by a remote? Did you just take any remote codes, that you will NOT be using, and program an Insteon light to a button press on the remote in the USBUIRT Receiver tab?
I have a USB-UIRT and want to control the lights from a key press. But how do I do the On/Off and Dim/Bright? Figured for ON/OFF I can just have a IF/Else so if light is already on, above 50% then turn off else turn on. Therefore a single keypress will do the On/Off for one light.
If you have two way access, you can always provide buttons for up/down by 10% or something, so that a few presses can get them to where they want pretty quickly for anything other than full on or off.
So you are saying then that I need 4 buttons for each light? 1 for Bright 10%, 1 for Dim 10%, 1 for On and 1 for Off?
Oh, no. I was saying that, if you have two way access, you can have a button that increases it by 10% and another that decreases it by 10 percent. Just read the current value, subtract 10. If it's below 0, put it back to zero. For increment, read the value, add 10. If it's over 100, put it back to 100. Then write the new value back.
So I Read the value and store in a variable and then Write the value +10? So for the value in the write I tried "GVar:Test+10" but it does not work. How do I add 10%?
You would use the Add method of the variable so in the action it would look something like the code below for the increment.
Code:
LocalVars::SetVariable(LVar:Temp, $(Moniker.FldName))
LocalVars::Add(LVar:Temp, 10)
If System::GrThan(%(LVar:Temp), 100)
   LocalVars::SetVariable(LVar:Temp, 100)  
End
Devices::FieldWrite(Moniker.FldName %(LVar:Temp))
This is what I did so it is like X10 where you select the unit and then Dim, Bright, On or Off.
In the Receiver New mode I create a mapped action for each Insteon device, ex here FRCOMPUTER:
Devices::FieldWrite
P1=Variables.Insteon-Unit
P2=Insteon.FRCOMPUTER

Then I created another mapped action for the On, Off, Dim & Bright. This one is for Dim:
Devices::FieldRead
P1=$(Variables.Insteon-Unit)
P2=LVarBig Grinim

LocalVars::Subtract
P1=LVarBig Grinim
P2=10

System::LsThan
P1=%(LVarBig Grinim)
P2=0

LocalVars::SetVariable
P1=LVarBig Grinim
P2=0

End

Devices::FieldWrite
P1=$(Variables.Insteon-Unit)
P2=%(LVarBig Grinim)

Now when I want to change the lights I press a button on the remote for the Insteon device and then say Dim and that light will Dim.
Lost this setup when my HD crashed and just added it back now. But it is not working. Have beta ver 26 and I believe it is not working at the write command to the light
Devices::FieldWrite
P1=$(Variables.Insteon-Unit)
P2=0

If I put Insteon.FRCOMPUTER in P1 then it works. If I look at Variables.Insteon-Unit the value there is Insteon.FRCOMPUTER. So why is it not working?
$ is for field tokens, not for variables. Use %(Variables.Insteon-Unit)
It looks like the Insteon-Unit is a field in the Variables driver that contains the string value for a particular field for his Insteon driver. If the driver or field wasn't valid he should have gotten a token expansion error when using the $.

Are you getting any type of error when using this action? If not it would suggest it is completing ok. Is the value of Insteon.FRCOMPUTER something other than 0 when you try and write a 0 to it? Try and set up a dummy field in your variables driver like TestValue and then set the Variables.Insteon-Unit to Variables.TestValue and see if the action correctly updates this TestValue field in your Variables driver. If so then you are pretty sure the action is sending what it is supposed to.