NAME
Power::Outlet::Kauf - Control and query a Kauf Plug with HTTP REST API
SYNOPSIS
my
$outlet
= Power::Outlet::Kauf->new(
host
=>
"my_kauf_plug"
);
$outlet
->query,
"\n"
;
$outlet
->on,
"\n"
;
$outlet
->off,
"\n"
;
$outlet
->switch,
"\n"
;
$outlet
->cycle,
"\n"
;
DESCRIPTION
Power::Outlet::Kauf is a package for controlling and querying a Kauf Plug.
From: https://github.com/KaufHA/common/ and https://github.com/hightowe/control_outdoor_lighting-pl
Commands can be executed via web (HTTP) requests, for example:
USAGE
use
Power::Outlet::Kauf;
my
$outlet
= Power::Outlet::Kauf->new(
host
=>
"sw-kitchen"
);
$outlet
->on,
"\n"
;
Command Line
$ power-outlet Kauf ON host sw-kitchen
Command Line (from settings)
$ cat /etc/power-outlet.ini
[Kitchen]
type=Kauf
name=Kitchen
host=sw-kitchen
groups=Inside Lights
groups=Main Floor
$ power-outlet Config ON section Kitchen
CONSTRUCTOR
new
my
$outlet
= Power::Outlet->new(
type
=>
"Kauf"
,
host
=>
"my_kauf_plug"
);
my
$outlet
= Power::Outlet::Kauf->new(
host
=>
"my_kauf_plug"
);
PROPERTIES
host
Sets and returns the hostname or IP address.
port
Sets and returns the port number.
Default: 80
METHODS
name
query
Sends an HTTP message to the device to query the current state
on
Sends a message to the device to Turn Power ON
off
Sends a message to the device to Turn Power OFF
switch
Sends a message to the device to toggle the power
cycle
Sends messages to the device to Cycle Power (ON-OFF-ON or OFF-ON-OFF).
cycle_duration
Default; 10 seconds (floating point number)
COPYRIGHT & LICENSE
Copyright (c) 2025 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.