Syntax Help Needed MLConditional

Discuss topics related to the plugins and uses for MLServer beta
Randy
Newbie
Newbie
Posts: 17
Joined: Tue Jan 23, 2007 10:27 pm
Contact:

Syntax Help Needed MLConditional

Postby Randy » Mon Oct 25, 2010 12:16 am

Here is my logging output.

10/25/2010 12:55:44 AM Push MLServeCmd.MLConditional|IsNE##{{currentdaysecs}}##{{local_sunset_seconds}}##MLServeCmd.MLLighting|On~Hallway
10/25/2010 12:55:44 AM Processing MLServeCmd.MLConditional|IsNE##{{currentdaysecs}}##{{local_sunset_seconds}}##MLServeCmd.MLLighting|On~Hallway
10/25/2010 12:55:44 AM Subst In IsNE##{{currentdaysecs}}##{{local_sunset_seconds}}##MLServeCmd.MLLighting|On~Hallway
10/25/2010 12:55:44 AM Subst Out IsNE##3336##70206##MLServeCmd.MLLighting|On~Hallway
10/25/2010 12:56:28 AM Push MLServeCmd.MLLighting|On~Hallway
10/25/2010 12:56:28 AM Processing MLServeCmd.MLLighting|On~Hallway

When I manually send this test conditional command (12:55) the hall light does not go on. When I manually send only the hall light on command (12:56) it comes on. Any idea as to why the conditional command does not work? Trying it from the MLScheduler gets same results.

Thanks for any help.

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

Re: Syntax Help Needed MLConditional

Postby mcascio » Mon Oct 25, 2010 9:09 am

Randy,

What actually triggers this command? Something would have to force this command to fire at the exact right time I think for it to actually work. Which seems like a one second window of opportunity.

Are you trying to turn your Hallway light on at Sunset?

If so you could build a Server Rule that reads:
Whenever currenthmmilalt equals sunset
Then MLServeCmd.MLLighting|On~Hallway
Mario Cascio
Cinemar, Inc.
http://www.cinemaronline.com

Randy
Newbie
Newbie
Posts: 17
Joined: Tue Jan 23, 2007 10:27 pm
Contact:

Re: Syntax Help Needed MLConditional

Postby Randy » Mon Oct 25, 2010 10:17 am

I mentioned in my previous note that this command was triggered as a one time test from the MLScheduler window as well and it did not work. You get the exact same log results. I thought you could tell if something worked from the log but it sounds like you can't. If my syntax is correct then I seem to have a problem. Any ideas to help me debug this?

Yes, I am using the server sunset_seconds to turn on my house lights. The IsNE will become IsGTE and the MLScheduler will run it every hour, but I am just trying to get a result from testing.

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

Re: Syntax Help Needed MLConditional

Postby mcascio » Mon Oct 25, 2010 10:23 am

Randy,

Try putting a ## at the end of your MLConditional...perhaps MLServer isn't handling it properly because it is looking for what to do if it were false.

Although, I'm still not sure why you wouldn't use Automation Rules instead of MLScheduler. It would be much less overhead.
Mario Cascio

Cinemar, Inc.

http://www.cinemaronline.com

Randy
Newbie
Newbie
Posts: 17
Joined: Tue Jan 23, 2007 10:27 pm
Contact:

Re: Syntax Help Needed MLConditional

Postby Randy » Mon Oct 25, 2010 10:51 am

I tried your suggestion but no light. I tried that yesterday and even put the same lights on command as the FALSE and TRUE rule but nothing happened.

10/25/2010 11:39:00 AM Processing MLServeCmd.MLConditional|IsNE##{{currentdaysecs}}##{{local_sunset_seconds}}##MLServeCmd.MLLighting|On~Hallway##
10/25/2010 11:39:00 AM Subst In IsNE##{{currentdaysecs}}##{{local_sunset_seconds}}##MLServeCmd.MLLighting|On~Hallway##
10/25/2010 11:39:00 AM Subst Out IsNE##41940##70206##MLServeCmd.MLLighting|On~Hallway##

I am using MLScheduler because the rule needs to be tested every hour. Ideally it should be tested every 15 minutes. Is there another way to run a conditional every 15 minutes?

Also, I have tested setting a variable of halllights = on when this runs but I was not successful in setting that variable either.

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

Re: Syntax Help Needed MLConditional

Postby mcascio » Mon Oct 25, 2010 11:04 am

Just for kicks, I tried the same command except for changing the light to a number which you might also try...and it worked on my end when sent from a button in MainLobby.

I'm running MLConditional 1.1.9 and MLServer 3.75.203

As I mentioned, you could use Automation Rules which doesn't need to run a test every 15 minutes since it will always base it on the actual sunset time. But I guess I don't undertstand the full picture.
Mario Cascio

Cinemar, Inc.

http://www.cinemaronline.com

Randy
Newbie
Newbie
Posts: 17
Joined: Tue Jan 23, 2007 10:27 pm
Contact:

Re: Syntax Help Needed MLConditional

Postby Randy » Mon Oct 25, 2010 11:15 am

MLConditional 1.1.4 and MLSServer 3.0.142 (because I am using PPC).

I see an option called "Server Rules" under the menu TOOLS. Is that what you mean by automation rules? Are automation rules even an option in this older version and what would it look?

Basically .. turn on hall lights if currentdaysecs >= local_sunset_seconds or another way of saying it is... turn on hall lights at sunset time. (Your sunset time was about 15 minutes to late for me. Can that be changed?)

thanks for your help.

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

Re: Syntax Help Needed MLConditional

Postby mcascio » Mon Oct 25, 2010 11:25 am

I would start by updating your MLConditional plugin. That's probably the problem.
Mario Cascio

Cinemar, Inc.

http://www.cinemaronline.com

Randy
Newbie
Newbie
Posts: 17
Joined: Tue Jan 23, 2007 10:27 pm
Contact:

Re: Syntax Help Needed MLConditional

Postby Randy » Mon Oct 25, 2010 1:02 pm

what's the highest version of MLConditional I can get that will work with MLServer 3.0.142 and where do i get it?

Thank you

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

Re: Syntax Help Needed MLConditional

Postby CinemarDave » Mon Oct 25, 2010 1:18 pm

There is nothing in MLServer that is tied to any version of a PPC app. I would strongly suggest updating to the latest MLServer version.

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: Syntax Help Needed MLConditional

Postby jjjukebox » Mon Oct 25, 2010 1:21 pm

I use Automation rules for a lot of lighting rules.

Try:
Whenever currentdate equals sunset
Then MLServeCmd.MLLighting|On~Hallway

Later
J.J. Jukebox
Member

Randy
Newbie
Newbie
Posts: 17
Joined: Tue Jan 23, 2007 10:27 pm
Contact:

Re: Syntax Help Needed MLConditional

Postby Randy » Tue Oct 26, 2010 12:26 am

SOLVED.

The updated plugin and the automation tips helped me get a working solution for this problem.

Thank you.


Return to “MLServer Questions & Answers”

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest