Jump to content

One button, two scenes?


andrew77

Recommended Posts

Hi Guys;

 

I'm hoping to be able to have one button on my remotelinc trigger two scenes.

 

I want it to go something like this.

(for the sake of argument, i'll use the B button, and the B button triggers the SCENES A and B)

 

If SCENE A is true, and button B is SWITCHED ON

then SCENE B

 

I would like to be able to toggle between them. so

if SCENE B is true, and button B on SWITCHED ON

then SCENE A

 

and so forth.

 

Is this possible?

 

Drew

Link to comment
Could it then start with;

 

If SCENE A OR B are OFF then Button B turns SCENE A ON

 

 

There is no such thing as a scene status.

 

If you could identify a representative device from each scene, you may be able to try something like:

 

If

Status of representative device from scene A is off

And status of representative device from scene B is off

And control button B is switched on

Then

Turn on scene A

Else...nothing

 

You will not be able to use any wait statements, nore anything in the else path.

 

I am a little like garyfunk in being unclear what you are trying to do.

Link to comment

The way I understood the request is:

 

If Neither Scene is on, Turn Scene A on.

 

If Scene A is On, Turn Scene A Off, Turn Scene B On

If Scene B is On, Turn Scene B Off, Turn Scene A On

Continued presses of RL-B toggle between the two scenes.

 

I would do this with a variable for tracking assumed scene status. I am assuming from the OP that the RL buttons are in NonToggle ON mode. RL-B SHOULD NOT BE a controler of either scene.

 

If
  Control RL-B is switched On
  and
  i.scenestat < 2
then
  Set Scene B Off
  Set Scene A On
  i.scenestat=2
else
  Set Scene A Off
  Set Scene B On
  i.scenestat=1

 

Assuming that there would be another button used to turn off the scenes.

If 
  Control RL-A is Switched On
then
  Set Scene A Off
  Set Scene B Off

 

If RL-B is in normal Toggle mode, then the second program should be replaced with the following:

 

If
  Control RL-B is switched Off

Then
  Set Scene A Off
  Set Scene B Off

 

The combination of the first and third programs would loop through: Scene A On - A & B Off - Scene B On - A & B Off

 

-Xathros

Link to comment

Thank you Xathros.

 

RL-B is in Toggle mode so

 

"If

Control RL-B is switched Off

 

Then

Set Scene A Off

Set Scene B Off"

 

is what I have. Works fine

 

Also,

"If Neither Scene is on, Turn Scene A on.

 

If Scene A is On, Turn Scene A Off, Turn Scene B On

If Scene B is On, Turn Scene B Off, Turn Scene A On

Continued presses of RL-B toggle between the two scenes."

 

is correct as well.

 

 

I'm unclear on what "

i.scenestat < 2
" and
i.scenestat=1
means.

 

But I think this is exactly what I'm looking for.

 

Drew

Link to comment

andrew77-

 

i.scenestat is an Integer variable and will need to be defined on the integer variables tab. Since there is no such thing as a scene status, we need a variable to track what we believe the status of the scenes to be. In this case if i.scenestat < 2 then we think either Scene B is on (i.scenestat=1) or no scene is on (i.scenestat=0 - uninitialized after startup) so we then Turn Off B, Turn On A and set i.scenestat=2. B may have already been Off - doesn't matter. If i.scenestat=2 it means Scene A is on so we turn A off and B on and set i.scenestat=1.

 

Also note that the programs turn one scene off then the other on. This allows there to be some overlap in the scene definitions (Same light(s) in both scenes) Otherwise the overlapping lights would always be off.

 

So, the variable is simply tracking your toggle status.

 

-Xathros

Link to comment

Okay, so my head is spinning with the integer thing.

(I just saw the tab now for the first time if that lets you in on my apparent ignorance with this)

 

I'm wondering what to do as far as this goes.

 

You are 100% correct in that

 

1. When I press RL-B off Scene A and Scene B shut off

2. When I press RL-B on, it triggers Scene A

3. When I press RL-B again, it knows Scene A is on and triggers Scene B

4. This would toggle back and forth

 

Do impart knowledge. If this integer thing-a-ma-bob is what I think it is, it's going to be the new cat's *** around these parts.

 

Drew

 

(note: No cat's will be harmed in these proceedings)

Link to comment

Just beware that there is likely a reason why "scene" status has no meaning with insteon. Possibly, it is because no two people can agree on what it means for a scene to be on.

 

If you have a scene that includes two devices, who's "on" level is 30% and 70% (more complicated still, a scene with different "on" levels for each controller), is the scene ON or OFF if the levels are 31% and 71%? What about 29% and 69%?

 

I bring this up only to point out that scene status can be a more complicated concept than first imagined. One needs to think through their own definition of scene status to make sure any variable used accurately reflects that definition.

Link to comment
Okay, so my head is spinning with the integer thing.

(I just saw the tab now for the first time if that lets you in on my apparent ignorance with this)

 

I'm wondering what to do as far as this goes.

 

You are 100% correct in that

 

1. When I press RL-B off Scene A and Scene B shut off

2. When I press RL-B on, it triggers Scene A

3. When I press RL-B again, it knows Scene A is on and triggers Scene B

4. This would toggle back and forth

 

Do impart knowledge. If this integer thing-a-ma-bob is what I think it is, it's going to be the new cat's *** around these parts.

 

Drew

 

(note: No cat's will be harmed in these proceedings)

 

Drew-

 

Sorry, I can't determine what your questions is here. Also, I've been working this problem with my RL2 in mind which is an 8 button unit. I'm now remembering the old Remotelincs were 4 scene with on/off rockers so there is a RL-B Off button that I was not considering Doesn't change the toggle routine any but I think the second program should be:

 

If 
  Control RL-B is Switched Off

Then
  Set Scene A Off
  Set Scene B off
  i.scenestat=0

 

A bit about variables in the ISY: There are two kinds, Integer and State. Both can only contain positive integer values or 0. The only difference is that a State variable can trigger a program when it's value changes much like triggering a program with the change in status of a Switchlinc. An integer variable will not act as a trigger. Variable naming is unimportant beyond your level of OCD'ness. I use i.mvarname for Integer and s.mvarname for State variables in my code to to make reading/debugging a bit easier. Variable names cannot contain Spaces or certain punctuation symbols. .-_ are fine. I also tend to catagorize my mvars for the same reason. s.SEC.HomeAway, s.UTIL.WasherRunning etc. This way I can sort the mvars by name grouping like items.

 

-Xathros

Link to comment

Im sorry if I was unclear.

 

I know nothing of the integer and variable of which you speak.

 

The numbered list in my last post is what I'm trying to accomplish.

 

Where can I learn about integers?

 

Your paragraph that starts off "A bit about variables in the ISY" leaves my head spinning.

Link to comment
Where can I learn about integers?

 

The universal devices wiki is a good place to start for most things. Try:

 

http://wiki.universal-devices.com/index.php?title=ISY-99i/ISY-26_INSTEON:Variable_Details

 

In addition, there is a complete section on variable in this forum under "common ISY topics".

 

Make sure you have a relatively new version of the ISY software. Variable have only been around a couple of years. If your ISY is older than that, and you have not updated your software, you may not have variable capability.

Link to comment

 

1. When I press RL-B off Scene A and Scene B shut off

2. When I press RL-B on, it triggers Scene A

3. When I press RL-B again, it knows Scene A is on and triggers Scene B

4. This would toggle back and forth

 

Drew-

 

This is what should be accomplished by the first program I posted and the last I posted.

 

Go to the integer variables tab, Add a variable. Change the name to i.scenestat. Set the Init to 0 and the value to 0. Save it.

go to the programs tab and build the two programs which I will repeat here:

 

Program RL-B_Scenes_AB_Toggle

If
  Control RL-B is switched On
  and
  i.scenestat < 2
then
  Set Scene B Off
  Set Scene A On
  i.scenestat=2
else
  Set Scene A Off
  Set Scene B On
  i.scenestat=1

 

Program RL-B_ScenesOff

If
  Control RL-B is Switched Off

Then
  Set Scene A Off
  Set Scene B off
  i.scenestat=0

 

You will probably want to read the Wiki and Variabls sections posted by LeeG and oberkc. That will give you a much better understanding of the usage of the variable here. Variables add much greater functionality to the ISY and are well worth learning how to use. We are expecting even greater functionality with variables in the (near-ish) future as UDI extends the capabilities of variables.

 

-Xathros

Link to comment

This stuff is beyond awesome.

 

I cannot wait to get the hang of this.

 

I'm going to drive the wife crazy.

 

(That is why we buy this stuff, is it not?)

 

Thank you again. If I have any problems understanding the nomenclature I'll post back.

 

Drew

Link to comment
There are two kinds, Integer and State. Both can only contain positive integer values or 0.

Actually, variables can also contain negative integer values. I use -1 all the time because my formal computer training always represented TRUE with a -1.

Link to comment
Actually, variables can also contain negative integer values. I use -1 all the time because my formal computer training always represented TRUE with a -1.

Unfortunately the ISY does not accept negative variables. As Xathros stated earlier:

A bit about variables in the ISY: There are two kinds, Integer and State. Both can only contain positive integer values or 0.

~Mike

Link to comment
There are two kinds, Integer and State. Both can only contain positive integer values or 0.

Actually, variables can also contain negative integer values. I use -1 all the time because my formal computer training always represented TRUE with a -1.

There may be some confusion due to the syntax of the following operation:

 

Mvar = Mvar - 1 in ISY syntax is: Mvar =-1 which to the unsuspecting looks like the variable is being assigned a value of -1 when in reality we are decrementing an existing positive value by 1

Link to comment

Sorry to have been misleading on this. ISY Mvars DO in fact support negative values. I have been operating under the belief that we were limited to positive values for quite some time now.

 

-Xathros

Link to comment

Lee,

 

Was this changed since release 3.2.6? (When I purchased my ISY in Dec 2012)

I was also under the impression that variables could only be positive. Just ran a test program and to my surprise they do run negative. My apologies to kclenden for the misinformation.

~Mike

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...