Energy.pm


Insteon::SynchroLinc

SYNOPSIS

In user code:

   use Insteon::SynchroLinc;

In items.mht:

    INSTEON_SYNCHROLINC, AA.BB.CC, Washing_Machine, Appliances

DESCRIPTION

Provides support for the SynchroLinc Controller. The SynchroLinc allows MH to know the state of a non-insteon device. The state of this device is determined by monitoring the wattage used by the device. In order to trigger an ON state the wattage usage must be above a defined trigger wattage. The device will continue to be reported as ON as long as the wattage remains above this trigger. Once the wattage drops below the trigger, the device is reported as OFF.

The trigger wattage can be set programatically using set_trigger. Alternatively, if you are unsure about how much wattage the device in question uses, you can use the manual calibration routine outlined in the user manual for the SynchroLinc. After completing this calibration, you can retreive the calibrated trigger setting by calling request_parameters. Do pay attention to the notes in the manual concerning how the calibration is performed and the resulting 25% correction performed.

In order to prevent rapid oscillations between ON and OFF, the Synchrolinc includes two parameters, the threshold and delay, which can be programmed using set_threshold and <set_delay>. See the notes concerning these two routines below for a description of how the threshold and delay parameters work.

It is recommended that you link the Synchrolinc to MH first and perform all of the necessary calibration and testing before attempting to link the device directly to other Insteon devices.

Group 2 Objects

The Synchrolinc contains a feature which allows you to link devices seperately to the ON and OFF commands. Normally, when only the group 1 device is defined, the Synchrolinc will send ON and OFF commands for this device. However, if a group 2 :02 device is defined and linked, the device will only send ON commands. An ON command on group 1 signifies that the high state is active and an ON command on group 2 signifies that the low state is active.

I would recommend using this feature with caution. Without a device to test with, I can't be sure how the device will handle link requests. Nor am I sure how to reset the device back to the default arrangement. Deleting the group 2 definition and running delete_orphans may achieve the desired result, or it may require a factory reset.

INHERITS

Insteon::BaseDevice, Insteon::DeviceController

METHODS

new()

Instantiates a new object.

_set_parameters($trigger_bytes,$threshold_byte,$delay_byte)

An internal routine which writes the trigger, threshold, and delay values to the device. If a value is not specified, the cached value in MH will be used.

request_parameters()

Queries the device for the current trigger, threshold, and delay parameters. These reported parameters are printed to the log and cached in MH.

print_parameters()

Prints the current cached parameters from the device to the print log.

_get_parameters()

An internal routine which queries the device to obtain the current parameters. The reported parameters are cached within MH.

set_trigger(trigger_watts)

Sets the wattage required in order to trigger the Synchrolinc.

trigger_watts = is an decimal number between 0 and 1800 in .5 increments.

If an incorrect value is selected, this routine will chose the closest valid value.

set_delay(delay_seconds)

Sets the number of seconds for the delay on the Synchrolinc. It isn't clear to me exactly how this works. It is meant to provide some protection against rapid changes between on and off states. I that the synchrolinc continuously monitors the wattage, and that no off or on signal will be sent unless the wattage has been in that state continuously for the delay period of time. This means that the higher this value, the longer the lag will be between the change in state and when MH is actually informed of it.

Also see threshold for preventing rapid oscillations of the device.

delay_seconds = is an decimal number between 0.15 to 38.25 seconds in .15 second increments.

If an incorrect value is selected, this routine will chose the closest valid value.

set_threshold(threshold_watts)

The threshold, in combination with delay, is a means to prevent the device from oscillating back and forth between the on and off states. Once trigger has been exceeded, the wattage must drop threshold_watts below the trigger before the off signal is sent.

threshold_watts = is an decimal number between 0 to 127.5 watts in 0.5 watt increments.

If an incorrect value is selected, this routine will chose the closest valid value.

_process_message()

Handles incoming messages from the device which are unique to the SynchroLinc, specifically this handles the setting and getting of the various paramters, all other responses are handed off to the Insteon::BaseObject::_process_message().

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

SEE ALSO

Indigo Forum Post - Indigo developers likely have access to Dev Notes, so code samples are likely accurate.

Smart Home Forum Post - A post on the Smart Home user forum. Some of the conclusions here seem incorrect, however they do provide logs of a few communications.

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::iMeter

SYNOPSIS

In user code:

   use Insteon::iMeter;
   $iMeter = new Insteon::iMeter('AA.BB.CC');

In items.mht:

    INSTEON_IMETER, AA.BB.CC, iMeter, Sensors

DESCRIPTION

Provides support for the iMeter Solo power consumption monitor. The iMeter is the Insteon version of the Kill-o-Watt power monitor. It can provide readings of both instantaneous power usage and accumulated usage over time.

The iMeter is a very simple device that can really only act as a responder that does nothing. The iMeter will NOT broadcast changes in electricity usage. Instead, you must query the iMeter each time you want to know the state of the electrcity usage. These updates can be requested by setting the state of the device to 'refresh' or calling the 'request status' voice command. As a result, you really can't use the iMeter as a controller for anything, unless you are willing to accept long delays.

The state of this device is the last reading of the instantaneous energy usage in watts. You can use the tie_event routine to trigger an action when the usage is above a certain threshold.

The iMeter luckily has internal memory for storing the accumulated usage. This memory will log the usage continually, even if you do not query the device for long periods of time. This accumulated usage can be printed to the log using the log_accumulated_usage routine. Similarly this value can be obtained in user_code using the get_accumulated_usage routine.

If you want to display the accumulated usage in the web interface, you can create a Generic_Item object to track the accumulated usage using the following sample code, assuming you have defined your iMeter object as $iMeter:

    $iMeter_Accum = new Generic_Item();
    $iMeter->tie_event('$iMeter_Accum->set($iMeter->get_accumulated_usage)');

You can also create items that display the cost of your electricity usage using the following examples:

    $iMeter_Accum_Cost = new Generic_Item();
    $iMeter->tie_event('$iMeter_Accum_Cost->set("$" . $iMeter->get_accumulated_usage)*.15');

INHERITS

Insteon::BaseDevice, Insteon::DeviceController

METHODS

new()

Instantiates a new object.

set(state[,setby,response])

The iMeter really can't be set to anything, but refreshing the power and usage seems like the most common thing that would be done. As such, setting the state to refresh will cause MH to query these values.

request_status([requestor])

Requests the current status of the device and calls set() on the response. This will trigger tied_events.

This is called by setting state to 'refresh' or running request status voice command

_process_message()

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

log_accumulated_usage()

Prints the accumulated usage to the print log. You likely want to force MH to query the accumulated usage before printing by setting the state to 'refresh' or calling the 'request status' voice command.

get_accumulated_usage()

Returns the accumulated usage. You likely want to force MH to query the accumulated usage before printing by setting the state to 'refresh' or calling the 'request status' voice command.

reset_accumulated_usage()

Resets the accumulated usage on the device to 0.

get_power()

Returns the last read power value usage. There is no logging function for power because it is viewable in the state of the device. Indeed this function is fuplicative of simply calling $self->state.

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, Brian Rudy

SEE ALSO

iMeter Dev Notes

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.

 Energy.pm