Please help me set this up...

Tips and Techniques for using MLServer's Automation Rules
TheCodeMan
Senior Member
Senior Member
Posts: 204
Joined: Fri Sep 22, 2006 12:16 pm
Contact:

Please help me set this up...

Postby TheCodeMan » Thu Jun 12, 2008 8:57 pm

I am taking the Insteon PLM one step further. I have a broadband modem that periodically loses its connection to the Internet. I have connected it to an Appliancelinc and I want to configure an automation rule to do the following:

Whenever server_admin_internetstatus equals Offline
Lighting.0002|SwitchPower_Off Then MLPause|5 Then Lighting.0002|SwitchPower_On

That is the command I want to issue but I can't figure out the correct syntax to make it happen.

The other problem I am having is I can't determine what triggers the variable for server_admin_internetstatus. I have tested this by disconnecting my modem and watching the logs. MLServer will attempt to connect to the net to download data but the variable never gets updated. Any suggestions?

User avatar
DavidL
Simply Incredible
Simply Incredible
Posts: 11071
Joined: Sat Feb 08, 2003 9:39 am
Location: Metamora, Michigan
Contact:

Postby DavidL » Thu Jun 12, 2008 9:08 pm

MLServeCmd.Macro|Lighting.0002|SwitchPower_Off!MLPause|5!MLighting.0002|SwitchPower_On

Are you waiting long enough for the Internet to show down? DaveP posted on how often that happens a while ago.

TheCodeMan
Senior Member
Senior Member
Posts: 204
Joined: Fri Sep 22, 2006 12:16 pm
Contact:

Postby TheCodeMan » Thu Jun 12, 2008 9:19 pm

Any idea how long? Can the check be modified to update the variable more frequently?

User avatar
DavidL
Simply Incredible
Simply Incredible
Posts: 11071
Joined: Sat Feb 08, 2003 9:39 am
Location: Metamora, Michigan
Contact:

Postby DavidL » Thu Jun 12, 2008 9:35 pm

5) Adds MLPing|{{some IP address}} as a new MLServer command. The ping is done as a MLWorker process and the results are returned in a server variable called server_{{some IP address}}_internetstate. The value will be 0 (not pingable) or 1 (pingable).

You could ping www.google.com whenever you want

TheCodeMan
Senior Member
Senior Member
Posts: 204
Joined: Fri Sep 22, 2006 12:16 pm
Contact:

Postby TheCodeMan » Thu Jun 12, 2008 9:47 pm

I wish I knew how to do that but I have not idea. There is very little info in the forum related to MLPing. I have not been able to find anything in the wiki.

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

Postby CinemarDave » Thu Jun 12, 2008 11:08 pm

Internet tests are made once every three minutes. This is a hardcoded value and cannot be changed.

If you need a more frequent test then set up a timer to issue a MLPing every N seconds.

If you wanted to ping Google at IP 209.85.173.103 then issue a

MLPing|209.85.173.103 then watch the value of the server variable called server_209.85.173.103_internetstate. A 1 means it is pingable and 0 means it is not.

TheCodeMan
Senior Member
Senior Member
Posts: 204
Joined: Fri Sep 22, 2006 12:16 pm
Contact:

Postby TheCodeMan » Fri Jun 13, 2008 8:07 am

So I should set up an automation rule to run MLPing every minute or so and that will populate the variable for me?

User avatar
DavidL
Simply Incredible
Simply Incredible
Posts: 11071
Joined: Sat Feb 08, 2003 9:39 am
Location: Metamora, Michigan
Contact:

Postby DavidL » Fri Jun 13, 2008 8:21 am

Look into MLTimer.

TheCodeMan
Senior Member
Senior Member
Posts: 204
Joined: Fri Sep 22, 2006 12:16 pm
Contact:

Postby TheCodeMan » Fri Jun 13, 2008 10:20 am

I'm struggling to find documentation on this and relate it to what I am trying to do. Here is what I have done. Created a Timer at 1 with an alias of Internet_Status and an interval of 60 seconds.

The MLServeCmd dialog has the following:

MLServeCmd.MLTimer|SetTimer~1~Repeat~60~seconds~MLPing|209.85.173.103~Enable

I also checked the Repeating radio button.

I am getting no results from this.

User avatar
DavidL
Simply Incredible
Simply Incredible
Posts: 11071
Joined: Sat Feb 08, 2003 9:39 am
Location: Metamora, Michigan
Contact:

Postby DavidL » Fri Jun 13, 2008 11:22 am

Try

MLServeCmd.MLTimer|SetTimer~1~Repeat~60~seconds~MLServeCmd.MLPing|209.85.173.103~Enable

TheCodeMan
Senior Member
Senior Member
Posts: 204
Joined: Fri Sep 22, 2006 12:16 pm
Contact:

Postby TheCodeMan » Fri Jun 13, 2008 7:17 pm

Still no luck. MLTimer events should appear in the log if set to verbose, right?

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

Postby CinemarDave » Fri Jun 13, 2008 7:19 pm

Go into the MLTimer plugin and manually configure the timer there. See if you have any better luck.

TheCodeMan
Senior Member
Senior Member
Posts: 204
Joined: Fri Sep 22, 2006 12:16 pm
Contact:

Postby TheCodeMan » Fri Jun 13, 2008 7:50 pm

Here is my attempt at automatic setup. Still no luck. I would be perfectly fine with the four minute check by the built in Internet test that creates the variables InternetState and InternetStatus but they are not working either. I see them generated every four minutes but it never changes. I can unplug my modem and it always says 1 and Online.

I really wanted to get this working before I go on vacation but it's not looking good. What concerns me is the lack of documentation. I have combed through the forums reading every post on MLTimer and MLPing. There is relevant information but few if any complete walkthroughs of how to make things work. Some of the documentation has great screenshots of how to configure the gui, others like MLTimer are nonexistant.
You do not have the required permissions to view the files attached to this post.

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

Postby CinemarDave » Fri Jun 13, 2008 10:17 pm

Your Time setup is correct. Did you issue a MLTimer|Enable~Internet command to start the timer?

Look at MLServer event logs. You should then see lines like the following

Code: Select all

6/13/2008 8:16:09 PM   Processing (1)      MLPing|209.85.173.103
6/13/2008 8:16:09 PM   Server   Ping   Launching MLWorker to Ping 209.85.173.103
6/13/2008 8:16:10 PM   Processing (1)      SetVariable|server_209.85.173.103_InternetState~1
6/13/2008 8:16:39 PM   Processing (1)      MLPing|209.85.173.103
6/13/2008 8:16:39 PM   Server   Ping   Launching MLWorker to Ping 209.85.173.103
6/13/2008 8:16:41 PM   Processing (1)      SetVariable|server_209.85.173.103_InternetState~1

TheCodeMan
Senior Member
Senior Member
Posts: 204
Joined: Fri Sep 22, 2006 12:16 pm
Contact:

Postby TheCodeMan » Fri Jun 13, 2008 11:03 pm

Explain this one. I have a continuous ping going as shown by my image. Internet status shows as ~0. Same IP address. This makes no sense to me.
You do not have the required permissions to view the files attached to this post.


Return to “Automation Rules”

Who is online

Users browsing this forum: No registered users and 1 guest