My solution for local monitoring

Information and support for EnvisaLink modules.

Moderators: EyezOnRich, GrandWizard

Post Reply
etobian
Posts: 3
Joined: Mon Oct 07, 2013 2:20 pm

My solution for local monitoring

Post by etobian »

Wanted to share my work, so far.
Automating access to the TPI for monitoring data seems to be too cumbersome, for little gain.
(I got timing issues with all the telnet and socket libraries i found)

The easiest way I found to get all the info I need is to scrape the internal webpage on the EVL-3.
Then I parse that to display a color coded list of zones, and an ascii blueprint with color-changing doors and windows based on reported state.

Here is the basics:

Code: Select all

$url = 'http://192.168.0.35/2'; //disabled DHCP to get a fixed internal IP

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, "user:user");
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
$output = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);

$dom = new DOMDocument;
@$dom->loadHTML( $output );

foreach( $dom->getElementsByTagName( 'span' ) as $sp  )
{ 
$v = $sp ->nodeValue ; //Zone number	
$t = $sp->getAttribute('title')	; //Zone state: OPEN, CLOSED
// ... format for display as table, graph, send emails, etc...
}
You can add refreshing, internal server, login/authentication, redirecting port 80 in the router, dynamic dns, etc... and you have a custom monitoring site.
Post Reply