#!/usr/bin/perl # shellshovel.com/ha/ # user defined variables my $floorplan = '/ap/floorplan.jpg'; # array of objects with manual positioning, and logo # it would be nice to add/define these things in items.mht instead my %ap_objects = ( # name = name of the object (must match items.mht) # top = top position in pixels # left = left position in pixels # img = image you want to link too (note '-off' / '-on' is appended to the image) us_lamp1 => { top => '355', left => '280', img => 'ap-light' }, ds_lamp1 => { top => '370', left => '75', img => 'ap-light' } hawkeye1 => { top => '5', left => '60', img => 'ap-motion' }, eye1 => { top => '15', left => '70', img => 'ap-eye' }, eye2 => { top => '20', left => '80', img => 'ap-eye' } ); # # end user configured variables. # use CGI; my $a = new CGI; print "Content-Type: text/html\n\n"; print qq|\n\n\n|; # end header/styles # start body print qq|\n
\n|; ## you can use items.mht below, just replace # my (@objects); # @objects = &list_objects_by_type('Property'); # @objects = &list_objects_by_group('Property') unless @objects; ## or use our array map my @objects = map { my $key = $_; } keys %ap_objects; # run through them and display the href/img src for my $item (sort @objects) { next unless $item; my $object = &get_object_by_name($item); next if $object->{hidden}; # get state my $state = undef; if ($object->can('state_level')) { $state = $object->state_level(); } elsif ($object->can('state')) { $state = $object->state(); } my $state_new = (!defined $state or $state eq 'off') ? 'on' : 'off'; # display the item print "state . ".gif'>\n"; } # floorplan image and /body print qq|\n|; print qq|
\n\n|;