++ed by:
TIMB MRDVT

2 PAUSE users

Michael R. Davis
and 1 contributors

NAME

Power::Outlet::Hue - Control and query a Philips Hue light

SYNOPSIS

  my $outlet=Power::Outlet::Hue->new(host => "mybridge", id=>1, username=>"myuser");
  print $outlet->query, "\n";
  print $outlet->on, "\n";
  print $outlet->off, "\n";

DESCRIPTION

Power::Outlet::Hue is a package for controlling and querying a light on a Philips Hue network attached bridge.

USAGE

  use Power::Outlet::Hue;
  my $lamp=Power::Outlet::Hue->new(host=>"mybridge", id=>1, username=>"myuser");
  print $lamp->on, "\n";

CONSTRUCTOR

new

  my $outlet=Power::Outlet->new(type=>"Hue", host=>"mybridge", id=>1);
  my $outlet=Power::Outlet::Hue->new(host=>"mybridge", id=>1);

PROPERTIES

id

ID for the particular light as configured in the Philips Hue Bridge

Default: 1

resource

Resource for the particular object as presented on the Philips Hue Bridge

Default: lights

Currently supported Resources from https://developers.meethue.com/documentation/core-concepts

  lights    - resource which contains all the light resources
  groups    - resource which contains all the groups
  config    - resource which contains all the configuration items
  schedules - which contains all the schedules
  scenes    - which contains all the scenes
  sensors   - which contains all the sensors
  rules     - which contains all the rules

host

Sets and returns the hostname or IP address.

Default: mybridge

port

Sets and returns the port number.

Default: 80

username

Sets and returns the username used for authentication with the Hue Bridge

Default: newdeveloper (Hue Emulator default)

name

Returns the configured friendly name for the device

METHODS

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

Queries the device for the current status and then requests the opposite.

cycle

Sends messages to the device to Cycle Power (ON-OFF-ON or OFF-ON-OFF).

BUGS

Please log on RT and send an email to the author.

SUPPORT

DavisNetworks.com supports all Perl applications including this package.

AUTHOR

  Michael R. Davis
  CPAN ID: MRDVT
  DavisNetworks.com

Thanks to Mathias Neerup manee12 at student.sdu.dk - https://rt.cpan.org/Ticket/Display.html?id=123965

COPYRIGHT

Copyright (c) 2018 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.

SEE ALSO

http://www.developers.meethue.com/philips-hue-api, http://steveyo.github.io/Hue-Emulator/, https://home-assistant.io/components/emulated_hue/