Lighting.pm


Insteon::BaseLight

DESCRIPTION

A generic base class for all Insteon lighting objects.

INHERITS

Insteon::BaseDevice

METHODS

new()

Instantiates a new object.

level(p_level)

Takes the p_level, and stores it as a numeric level in memory.

get_voice_cmds

Returns a hash of voice commands where the key is the voice command name and the value is the perl code to run when the voice command name is called.

Higher classes which inherit this object may add to this list of voice commands by redefining this routine while inheriting this routine using the SUPER function.

This routine is called by the Insteon::generate_voice_commands manpage to generate the necessary voice commands.

AUTHOR

Gregg Limming

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.


Insteon::DimmableLight

DESCRIPTION

A generic base class for all dimmable Insteon lighting objects.

INHERITS

Insteon::BaseLight

METHODS

derive_link_state([state])

Overrides routine in BaseObject. Takes the various states available to insteon devices and returns a derived state of on, off, or 0%-100%.

convert_ramp(ramp_seconds)

Takes ramp_seconds in numeric seconds and returns the hexadecimal value of that ramp rate or the next lowest value if the passed value doesn't exist. Possible ramp rates are:

540, 480, 420, 360, 300, 270, 240, 210, 180, 150, 120, 90, 60, 47, 43, 39, 34, 32, 30, 28, 26, 23.5, 21.5, 19, 8.5, 6.5, 4.5, 2, .5, .3, .2, and .1

get_ramp_from_code(ramp_code)

Takes ramp_code as a hexadecimal representation of the device's ramp rate and returns the equivalent ramp rate in decimal seconds.

convert_level(on_level)

Takes on_level as an integer percentage and converts it to a hexadecimal representation of that on_level that is used by a device.

new()

Instantiates a new object.

local_onlevel(level)

Sets and returns the local onlevel for the device in MH only. Level is a percentage from 0%-100%.

This setting can be pushed to the device using update_local_properties.

Parameters: level [0-100]

Returns: [0-100]

local_ramprate(rate)

Sets and returns the local ramp rate for the device in MH only. Rate is a time between .1 and 540 seconds. Only 32 rate steps exist, to MH will pick a time equal to of the closest below this time.

This setting can be pushed to the device using update_local_properties.

Parameters: rate = ramp rate [.1s - 540s] see convert_ramp for valid values

Returns: hexadecimal representation of the ramprate.

update_local_properties()

Pushes the values set in local_onlevel() and local_ramprate() to the device.

I1 Devices:

The device will only reread these values when it is power-cycled. This can be done by pulling the air-gap for 4 seconds or unplugging the device.

I2 & I2CS Devices

The device will immediately read and update the values.

level(p_level)

Stores and returns the objects current on_level as a percentage. If p_level is ON and the device has a defined local_onlevel, the local_onlevel is stored as the numeric level in memory.

Returns [0-100]

get_voice_cmds

Returns a hash of voice commands where the key is the voice command name and the value is the perl code to run when the voice command name is called.

Higher classes which inherit this object may add to this list of voice commands by redefining this routine while inheriting this routine using the SUPER function.

This routine is called by the Insteon::generate_voice_commands manpage to generate the necessary voice commands.

AUTHOR

Gregg Limming

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.


Insteon::ApplianceLinc

SYNOPSIS

User code:

    use Insteon::ApplianceLinc;
    $appliance_device = new Insteon::ApplianceLinc('12.34.56',$myPLM);

In mht file:

    INSTEON_APPLIANCELINC, 12.34.56, appliance_device, appliance_group

DESCRIPTION

Provides support for the Insteon ApplianceLinc.

INHERITS

Insteon::BaseLight Insteon::DeviceController

METHODS

new()

Instantiates a new object.

AUTHOR

Gregg Limming

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.


Insteon::LampLinc

SYNOPSIS

User code:

    use Insteon::LampLinc;
    $lamp_device = new Insteon::LampLinc('12.34.56',$myPLM);

In mht file:

    INSTEON_LAMPLINC, 12.34.56, lamp_device, All_Lights

DESCRIPTION

Provides support for the Insteon LampLinc.

INHERITS

Insteon::DimmableLight, Insteon::DeviceController

METHODS

new()

Instantiates a new object.

AUTHOR

Gregg Limming

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.


Insteon::SwitchLincRelay

SYNOPSIS

User code:

    use Insteon::SwitchLincRelay;
    $light_device = new Insteon::SwitchLincRelay('12.34.56',$myPLM);

In mht file:

    INSTEON_SWITCHLINCRELAY, 12.34.56, light_device, All_Lights

DESCRIPTION

Provides support for the Insteon SwitchLinc Relay.

INHERITS

Insteon::BaseLight, Insteon::DeviceController

METHODS

new()

Instantiates a new object.

link_data3

Returns the data3 value that should be used when creating a link for this device. This sub overides the parent class to map group 01 to data3 01. This is required by the I2CS In-LineLinc Relay.

AUTHOR

Gregg Limming

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.


Insteon::SwitchLinc

SYNOPSIS

User code:

    use Insteon::SwitchLinc;
    $light_device = new Insteon::SwitchLinc('12.34.56',$myPLM);

In mht file:

    INSTEON_SWITCHLINC, 12.34.56, light_device, All_Lights

DESCRIPTION

Provides support for the Insteon SwitchLinc.

INHERITS

Insteon::DimmableLight, Insteon::DeviceController

METHODS

new()

Instantiates a new object.

AUTHOR

Gregg Limming

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.


Insteon::KeyPadLincRelay

SYNOPSIS

User code:

    use Insteon::KeyPadLincRelay;
    $light_device = new Insteon::KeyPadLincRelay('12.34.56:01',$myPLM);
    $button1_device = new Insteon::KeyPadLincRelay('12.34.56:02',$myPLM);
    $button2_device = new Insteon::KeyPadLincRelay('12.34.56:03',$myPLM);

In mht file:

    INSTEON_KEYPADLINCRELAY, 12.34.56:01, light_device, All_Lights
    INSTEON_KEYPADLINCRELAY, 12.34.56:02, button1_device, All_Buttons
    INSTEON_KEYPADLINCRELAY, 12.34.56:03, button2_device, All_Buttons

DESCRIPTION

Provides support for the Insteon KeypadLinc Relay.

INHERITS

Insteon::BaseLight, Insteon::DeviceController, Insteon::Insteon::MultigroupDevice

METHODS

new()

Instantiates a new object.

set(state[,setby,response])

Handles setting and receiving states from the device and specifically its subordinate buttons.

update_flags(flags)

Can be used to set the button layout and light level on a keypadlinc. Flag options include:

    '0a' - 8 button; backlighting dim
    '06' - 8 button; backlighting off
    '02' - 8 button; backlighting normal
    '08' - 6 button; backlighting dim
    '04' - 6 button; backlighting off
    '00' - 6 button; backlighting normal
get_voice_cmds

Returns a hash of voice commands where the key is the voice command name and the value is the perl code to run when the voice command name is called.

Higher classes which inherit this object may add to this list of voice commands by redefining this routine while inheriting this routine using the SUPER function.

This routine is called by the Insteon::generate_voice_commands manpage to generate the necessary voice commands.

link_data3

Returns the data3 value that should be used when creating a link for this device. This sub overides the parent class to map group 01 to data3 01. This is required by all of the KeypadLinc family.

sync_intradevice_links()

IntraDevice Links are links between buttons on the same KPL. These links are not stored in the same manner as InterDevice links. Therefore this routine can be used to sync the IntraDevice links. There are two types of IntraDevice Links FOLLOW and OFF.

FOLLOW

Follow links are links which cause one button to be a slave to a master button. The slave button will always follow the state of the master button whenever the master button is pressed. For example, if Button A is defined as the master to the slave Button B, then any time button A is pressed button B will follow. If button A is turned on, button B will turn on. Same thing with Off. However, button B can still be independently controlled. That is button B can be turned on or off manually, without affecting button A. That is unless a reverse master -slave relationship is defined.

To define Follow links, simply define a normal Insteon scene definition where the scene controller is the master button and the scene responder is the slave button. To enable the follow functionality the on_level must be defined as NOT zero. The ramp rate is ignored and on_level will be converted to 100%.

    SCENE_MEMBER, kpl_button_B, kpl_button_A, 100% #Button B will follow A
    #In the following pressing Button A will cause B, C & D to turn on.
    #SCENE_Build is not much help here.
    SCENE_BUILD, kpl_scene, kpl_button_A,   1,    0,    80%
    SCENE_BUILD, kpl_scene, kpl_button_B,   0,    1,    100%
    SCENE_BUILD, kpl_scene, kpl_button_C,   0,    1,    100%
    SCENE_BUILD, kpl_scene, kpl_button_D,   0,    1,    100%

OFF

Off links are links in which turning ON a master button will cause all slave buttons to turn OFF. This is commonly used for "radio" style buttons to control a fan. The buttons may be defined as Off, Low, Med, & High. We only want one state to be active at any given time. To accomplish this, we define a series of master slave relationships between all of the buttons. Notably, you these type of definitions do not have to affect all buttons, you can define Off links that only join 2 buttons. Similar to Follow links, these also do not have to be two way links.

To define Off links, simply define a normal Insteon scene definition where the scene controller is the master button and the scene responder is the slave button. To enable the off functionality the on_level must be defined as ZERO. The ramp rate is ignored.

    SCENE_MEMBER, kpl_button_B, kpl_button_A, 0% #Turning ON A will turn OFF B
    
The following is an example for how to enable radio buttons, where only one
button can be activated at a time.
    SCENE_BUILD, kpl_scene, kpl_button_A,   1,    1,    0%
    SCENE_BUILD, kpl_scene, kpl_button_B,   1,    1,    0%
    SCENE_BUILD, kpl_scene, kpl_button_C,   1,    1,    0%
    SCENE_BUILD, kpl_scene, kpl_button_D,   1,    1,    0%

SYNCING

To sync these links, simply run this command after creating the necessary link definitions. This routine will perform both the "sync and delete" steps to bring the links on the device into compliance with the definitions in MisterHouse. There is no "scan" feature for IntraDevice links.

_write_intradevice_links()

The i2 routine for writing the IntraDevice links to i2 devices. Should not be called directly.

AUTHOR

Gregg Limming, Kevin Robert Keegan

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.


Insteon::KeyPadLinc

SYNOPSIS

User code:

    use Insteon::KeyPadLinc;
    $light_device = new Insteon::KeyPadLinc('12.34.56:01',$myPLM);
    $button1_device = new Insteon::KeyPadLinc('12.34.56:02',$myPLM);
    $button2_device = new Insteon::KeyPadLinc('12.34.56:03',$myPLM);

In mht file:

    INSTEON_KEYPADLINC, 12.34.56:01, light_device, All_Lights
    INSTEON_KEYPADLINC, 12.34.56:02, button1_device, All_Buttons
    INSTEON_KEYPADLINC, 12.34.56:03, button2_device, All_Buttons

DESCRIPTION

Provides support for the Insteon KeypadLinc.

INHERITS

Insteon::DimmableLight, Insteon::DeviceController

METHODS

new()

Instantiates a new object.

AUTHOR

Gregg Limming

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.


Insteon::FanLinc

SYNOPSIS

User code:

    use Insteon::FanLinc;
    $light_device = new Insteon::FanLinc('12.34.56:01',$myPLM);
    $fan_device = new Insteon::FanLinc('12.34.56:02',$myPLM);

In mht file:

    INSTEON_FANLINC, 12.34.56:01, light_device, All_Lights
    INSTEON_FANLINC, 12.34.56:02, fan_device, All_Fans

DESCRIPTION

Provides support for the Insteon FanLinc.

INHERITS

Insteon::DimmableLight, Insteon::DeviceController, Insteon::Insteon::MultigroupDevice

METHODS

new()

Instantiates a new object.

derive_message([command,extra])

Generates set commands for the fan, light requests are passed to BaseObject

request_status()

Will request the status of the device. For the light device, the process is handed off to the Insteon::BaseObject::request_status() routine. This routine specifically handles the fan request.

_is_info_request()

Handles incoming messages from the device which are unique to the FanLinc, specifically this handles the request_status() response for the Fan device, all other responses are handed off to the Insteon::BaseObject::request_status().

is_acknowledged()

Handles command acknowledgement messages received from the device that are unique to the FanLinc, specifically the acknowledgement of commands sent to the fan device. All other instances are handed off to the Insteon::BaseObject.

get_voice_cmds

Returns a hash of voice commands where the key is the voice command name and the value is the perl code to run when the voice command name is called.

Higher classes which inherit this object may add to this list of voice commands by redefining this routine while inheriting this routine using the SUPER function.

This routine is called by the Insteon::generate_voice_commands manpage to generate the necessary voice commands.

AUTHOR

Kevin Robert Keegan

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

 Lighting.pm