Charmed Quark Systems, Ltd. - Support Forums and Community

Full Version: How do I have one set of control (on/off) buttons for multiple devices?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
No, there currently isn't a way to do that. It's now very high on the list, as are usability issues in general.
OK, I got 2.0 setup and tried to get this workin. Here is an example of what I do on a button to select the light:
[OnClick]
GlobalVars::SetVariable(GVar:CurrentLight, Insteon.Den)


And when I click the On button I have this:
[OnClick]
Devices::FieldWrite(GVAR:CurrentLight, On)

But, I just get an error of
"'GVAR:CurrentLight' is not a valid field name. It must be in the form 'moniker.fldname'"

Did I miss something? How do I do what I wanted to do without using a ton of IF statements? My reading of this thread was that this code would work.
Sendero Wrote:OK, I got 2.0 setup and tried to get this workin. Here is an example of what I do on a button to select the light:
[OnClick]
GlobalVars::SetVariable(GVar:CurrentLight, Insteon.Den)


And when I click the On button I have this:
[OnClick]
Devices::FieldWrite(GVAR:CurrentLight, On)

But, I just get an error of
"'GVAR:CurrentLight' is not a valid field name. It must be in the form 'moniker.fldname'"

Did I miss something? How do I do what I wanted to do without using a ton of IF statements? My reading of this thread was that this code would work.

Try making it GVar

(lowercase ar
actually, one of them is a fieldwrite, one of them is a setvariable.

make the fieldwrite a setvariable, does that work?
well, using the SetVariable doesn't error, but since I have another problem with the Insteon driver not loading I can't tell if its working right or not Smile hopefully that was it, I'll report back if it wasn't. Thanks for the advice.
OK, got the new Insteon driver and now back to having issues with my UI.

The UI has only two 'room' buttons on it right now : Den and Kitchen.
The UI also has two 'action' buttons : On and Off

The Den button has this code:
[OnClick]
GlobalVars::SetVariable(GVar:CurrentLight, INSTEON.Den)


The On button has this code:
[OnClick]
GlobalVars::SetVariable(GVar:CurrentLight, 100)

When I click Den and then On, nothing happens. I know I have to be missing something here.

On a test button I have this code and it works fine:
[OnClick]
Devices::FieldWrite(INSTEON.Den, 100)

How do I have one button set the name of the driver:field and another button actually use that for a FieldWrite action?
OK, I got it working. In the click method for the On button, the code has to be a FieldWrite after all:
Devices::FieldWrite(%(GVar:CurrentLight), 100)

works like charm now
Pages: 1 2