<HTML>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>HiPi::Interface::ENER002</title></head>
<BODY TOPMARGIN=4 BGCOLOR=#FFFFFF TEXT=#000000 VLINK=#0000CC LINK=#0000CC ALINK=#0000CC>
<FONT FACE="Arial, Lucida, Helvetica" >
<TABLE WIDTH="100%" ALIGN=CENTER CELLPADDING=1 CELLSPACING=0>
<TR>
<TD WIDTH="100%" ALIGN=CENTER>
<A HREF="contents.htm"><img align=center src="home.png" BORDER=0 ALT="Contents"></A>
<A HREF="mod_interface.htm"><img align=center src="up.png" BORDER=0 ALT="Up"></A>
<A HREF="mod_interface_ds18x20.htm"><img align=center src="back.png" BORDER=0 ALT="Previous"></A>
<A HREF="mod_interface_hd44780.htm"><img align=center src="forward.png" BORDER=0 ALT="Next"></A>
</TD>
</TR>
<TR>
<TD COLSPAN=2 HEIGHT=2 BGCOLOR="#C0C0C0">
</TD>
</TR>
</TABLE>
<H2>HiPi::Interface::ENER002</H2><p>The HiPi::Interface::ENER002 module provides a high level interface for controlling Energenie ENER002 switched sockets and the ENER010 4 Way Radio Controlled Extension Lead.</p>
<p><IMG SRC="ENER002.png" BORDER="0"> <IMG SRC="ENER010.png" BORDER="0"></p>
<p>It uses <A HREF="mod_controller_ener314_rt.htm">HiPi::Controller::ENER314_RT</A> as a backend.</p>
<h2>Object Constructor and Methods</h2>
<h5>my $group = HiPi::Interface::ENER002->new( groupid => 0x6C6C6 );</h5>
<pre> Returns a new instance of the HiPi::Interface::ENER002 class
that can be used to control switches in the group 'groupid'.
The groupid is a 20 bit number so any number between 0x1 ( 1 ) and
0xfffff ( 1,048,575 ).
Each groupid can be used to pair with and control switches using up to
4 different switch identifiers. Typically this means you can control
up to 4 different switch sockets with 1 groupid.
If using with the ENER010 4 way extension lead then 1 groupid will be used to
control the 4 sockets on the extension.
You can use as many different groupid values as you wish allowing you
to control as many different sockets and extension individually as you wish.
When using the HiPi::Controller::ENER314_RT controller as a backend,
each message is broadcast ( repeated ) 15 times. You may find that increasing
this number improves switch operation. You can set 'repeat'to a number
between 15 and 100.
my $group = HiPi::Interface::ENER002->new(
groupid => 0x6C6C6,
repeat => 25,
);</pre>
<h5>$group->pair_socket( $socket, [ $seconds ] );</h5>
<pre> pair a socket with this group.
$socket = a number between 1 and 4
$seconds = optional number of seconds to broadcast the
pairing message. By default the message is
broadcast for 10 seconds.
$group->pair_socket(1); will broadcast a message to pair a socket with
this groupid as socket 1.
Calling $group->pair_socket(1) is the same as pressing button 1 ( either
on or off ) on the remote control for your sockets. You can follow the
instructions provided with the Energenie sockets on how to pair with
your remote and substitute a call to $group->pair_socket in place of
pressing the remote buttons.
If you want to broadcast for a longer period of time, say 20
seconds, call $group->pair_socket(1, 20).
When using to pair with a ENER010 extension lead you can use
any socket number ( 1 to 4 ) in the pairing call.</pre>
<h5>$group->switch_socket( $socket, $value );</h5>
<pre> switch a socket on or off.
$socket = a number between 0 and 4. Use 0 (zero) to switch all sockets
on or off
$value = 1 ( on ) or 0 ( off )
$group->switch_socket( 3, 1 ) <i>switch socket 3 on</i>
$group->switch_socket( 2, 0 ) <i>switch socket 2 off</i>
$group->switch_socket( 0, 1 ) <i>switch all sockets on</i>
</pre>
</FONT>
<br>
<p>
<br>
<hr>
<br>
<center>
<A HREF="contents.htm"><img align=center src="home.png" BORDER=0 ALT="Contents"></A>
<A HREF="mod_interface.htm"><img align=center src="up.png" BORDER=0 ALT="Up"></A>
<A HREF="mod_interface_ds18x20.htm"><img align=center src="back.png" BORDER=0 ALT="Previous"></A>
<A HREF="mod_interface_hd44780.htm"><img align=center src="forward.png" BORDER=0 ALT="Next"></A>
</center>
<HR>
<br>
<center><FONT FACE="Arial, Lucida, Helvetica" size="2" color="#000080">HiPi Modules Copyright © 2013 - 2016 Mark Dootson</font></center>
</BODY></HTML>