Variables questions

Post in this thread issues and solution you find with the MainLobby 3 Client
SparkyD
Senior Member
Senior Member
Posts: 182
Joined: Thu Jul 28, 2005 3:12 pm
Contact:

Variables questions

Postby SparkyD » Thu May 05, 2011 7:50 pm

I am designing lighting scenes, organized by room. (Master Bed, Guest bed, Kitchen, etc.) In each room I have between 6 and 16 lights Iam controlling. I need to find a way to have the room name (on the room selection menu) turn yellow or white, depending if ANY of the lights in that paticular room are on.
I tried using an automation rule, but it would only allow me to do 3 "and" scenarios, where I would need like 16. (If light A, and B, and C, and D, etc are off, setvariable|kitchen lights~0)

I'm sure there is a way through MLConditionals, but I want to keep this streamlined, as I have a ton of buttons to edit, Any advice?

User avatar
mcascio
Founder
Founder
Posts: 8270
Joined: Tue Jan 28, 2003 4:03 pm
Location: Kenosha, Wi
Contact:

Re: Variables questions

Postby mcascio » Fri May 06, 2011 10:25 am

Stack three Text.Sizable's on top of each other. Then use the Off State to listen to a particular variable.
Mario Cascio
Cinemar, Inc.
http://www.cinemaronline.com

User avatar
CinemarDave
Site Admin
Site Admin
Posts: 10535
Joined: Fri Feb 07, 2003 8:56 am
Location: Planet Earth
Contact:

Re: Variables questions

Postby CinemarDave » Fri May 06, 2011 11:12 am

If you want to test that everything is off then string all your variables into one value in the MLConditional

MLConditional|ISEqual##{{Light1}}{{Light2}}{{Light3}}{{Light4}}{{Light5}}{{Light6}}{{Light7}}...{{Light16}}##0000000...0##Make Button Green##Make Button Red

User avatar
ronsatter
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1304
Joined: Mon Dec 04, 2006 1:40 am
Location: San Leandro, CA
Contact:

Re: Variables questions

Postby ronsatter » Fri May 06, 2011 1:36 pm

CinemarDave wrote:If you want to test that everything is off then string all your variables into one value in the MLConditional

MLConditional|ISEqual##{{Light1}}{{Light2}}{{Light3}}{{Light4}}{{Light5}}{{Light6}}{{Light7}}...{{Light16}}##0000000...0##Make Button Green##Make Button Red##


I love this feature of this command.

Don't think the last two ## symbols at the end of the example above are necessary, though. Only need four sets of ##'s in a conditional command.

Ron
If it ain't broke ... don't fix it!

User avatar
CinemarDave
Site Admin
Site Admin
Posts: 10535
Joined: Fri Feb 07, 2003 8:56 am
Location: Planet Earth
Contact:

Re: Variables questions

Postby CinemarDave » Fri May 06, 2011 1:38 pm

Right you are. I removed the trailing ## that should not have been there.

User avatar
jjjukebox
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1024
Joined: Sat May 22, 2004 9:54 pm
Location: Toronto
Contact:

Re: Variables questions

Postby jjjukebox » Fri May 06, 2011 4:24 pm

You could use that MLConditional in a timer that goes off every 30 seconds or so and it would keep your "kitchen lights" variable fairly current
J.J. Jukebox
Member

ricks
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1127
Joined: Wed Oct 27, 2004 7:01 pm
Location: Latham, Massachusetts
Contact:

Re: Variables questions

Postby ricks » Fri May 06, 2011 10:02 pm

That's sharp. Didn't realize MLConditional could do such a thing. SparkyD, I think I understand your name. You must be an electrician to have that many lights! One room with 16 independantly controlled lights!!! At $50 - $75 per switch you must work for one of the switch manufacturers. :D

I think I would still do the Automation rule for each switch. More initial programming but far less processing. Create a macro as above with the MLConditional for each room - maybe 10 to 12 rooms. Then do an Automation rule for each switch so that each room's macro only runs when there is a lighting change to a light in that room.

Running one macro with all 12 rooms every 30 seconds would mean this macro would run 2880 times a day when in reality you probably see less than 100 total changes a day at the most with that many lights. Think of the Master Bedroom. You may only make 5-6 lighting changes each day so why poll the room 2880 times.

When masterbed_light_1 changes value then Macro|Lighting.Masterbed.Status

I don't have nearly as many lights as you but I only poll when there is a change and it reflects the status of the room immediately.

Just a thought.
Rick


Return to “MainLobby 3 Client”

Who is online

Users browsing this forum: No registered users and 1 guest