Power::Outlet::WeMo - Control and query a Belkin WeMo power outlet
my $outlet=Power::Outlet::WeMo->new(host => "mywemo"); print $outlet->query, "\n"; print $outlet->on, "\n"; print $outlet->off, "\n";
Power::Outlet::WeMo is a package for controlling and querying an outlet on a Belkin WeMo network attached power outlet.
use Power::Outlet::WeMo; use DateTime; my $lamp=Power::Outlet::WeMo->new(host=>"mywemo"); my $hour=DateTime->now->hour; my $night=$hour > 20 ? 1 : $hour < 06 ? 1 : 0; if ($night) { print $lamp->on, "\n"; } else { print $lamp->off, "\n"; }
my $outlet=Power::Outlet->new(type=>"WeMo", "host=>"mywemo"); my $outlet=Power::Outlet::WeMo->new(host=>"mywemo");
Sets and returns the hostname or IP address.
Note: Set IP address via DHCP static mapping
Sets and returns the port number.
Returns the configured FriendlyName from the WeMo device
Sends a UPnP message to the WeMo device to query the current state
Sends a UPnP message to the WeMo device to Turn Power ON
Sends a UPnP message to the WeMo device to Turn Power OFF
Queries the device for the current status and then requests the opposite.
Sends UPnP messages to the WeMo device to Cycle Power (ON-OFF-ON or OFF-ON-OFF).
Please log on RT and send an email to the author.
DavisNetworks.com supports all Perl applications including this package.
Michael R. Davis CPAN ID: MRDVT DavisNetworks.com
Copyright (c) 2013 Michael R. Davis
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
Portions of the WeMo Implementation Copyright (c) 2013 Eric Blue
WebService::Belkin::Wemo::Device, https://gist.github.com/jscrane/7257511
To install Power::Outlet, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Power::Outlet
CPAN shell
perl -MCPAN -e shell install Power::Outlet
For more information on module installation, please visit the detailed CPAN module installation guide.