Thermostat.pm


NAME

Thermostat.pm - Insteon Thermostat


DESCRIPTION

Enables support for an Insteon Thermostat.


SYNOPSIS

In user code:

        $thermostat = new Insteon_Thermostat($myPLM, '12.34.56');
        
Additional i2CS specific objects:
        
        $thermostat_heating = new Insteon_Thermostat($myPLM, '12.34.56:02');
        $thermostat_high_humid = new Insteon_Thermostat($myPLM, '12.34.56:03');
        $thermostat_low_humid = new Insteon_Thermostat($myPLM, '12.34.56:04');
        $thermostat_broadcast = new Insteon_Thermostat($myPLM, '12.34.56:EF');

These devices will not have any states, but are only used for linking purposes.

In items.mht:

        INSTEON_THERMOSTAT, 12.34.56, thermostat, HVAC
        
Additional i2CS specific objects:
        
        INSTEON_THERMOSTAT, 12.34.56:02, thermostat_heating, HVAC
        INSTEON_THERMOSTAT, 12.34.56:03, thermostat_high_humid, HVAC
        INSTEON_THERMOSTAT, 12.34.56:04, thermostat_low_humid, HVAC
        INSTEON_THERMOSTAT, 12.34.56:EF, thermostat_broadcast, HVAC

These devices will not have any states, but are only used for linking purposes.

Poll for temperature changes.

   if ( new_minute 5 && $Hour != 2 ) { # Skip the ALDB scanning hour
         $thermostat->poll_temp();
   }

Watch for temperature changes.

   if (state_now $thermostat eq 'temp_change') {
      my $temp = $thermostat->get_temp();
      print "Got new thermostat temperature: $temp\n";
   }

And, you can set the temperature and mode at will...

   if (state_changed $mode_vacation eq 'all') {
      $thermostat->mode('auto');
      $thermostat->heat_setpoint(60);
      $thermostat->cool_setpoint(89);
   }

All of the states of the parent object that may be set by MH, you can use tie_event to link specific actions to these states: temp_change: Inside temperature changed (call get_temp() to get value) heat_sp_change: Heat setpoint was changed (call get_heat_sp() to get value). cool_sp_change: Cool setpoint was changed (call get_cool_sp() to get value). mode_change: System mode changed (call get_mode() to get value). fan_mode_change: Fan mode changed (call get_fan_mode() to get value). status_change: Heating, Cooling, Dehumidifying, or Humidifying change (i2CS only) (call get_status() to get status).

I2CS Broadcast messages:

If a group EF device is defined, MH will receive broadcast changes from the thermostat. When enabled, broadcast messages for changes in setpoint, mode, temp, and humidity will be sent to MH. When enabled, there is no reason to poll the thermostat, except for possibly at reboot. To enable simply define the EF group as described above and run sync links.

Broadcast messages are NOT sent when the heater turns on/off. Broadcast message are also NOT sent when the humidity setpoints are exceeded. Instead, you must define the heating, high_humid, and low_humid groups and link them to MH. (The base group 01 is the cooling group and should always be linked to MH). When linked, these groups will send on/off commands to MH when these events occur. Alternatively, you can periodically call request_status() to check the status of these attributes.

Linking:

I am not sure how or if the i1 device can be linked to other devices.

I2CS devices have 5 controllers, groups 01-04 plus the broadcast group EF. At the moment, MH only supports using the thermostat as a controller of another device. To control another device, simply define it as a scene member of the desired thermostat group. The groups are:

        01 - Cooling - Will send an ON/OFF command when the A/C is turned on/off.
        02 - Heating - Will send an ON/OFF command when the heater is turned on/off.
        03 - Humid High - Will send an ON/OFF command when the humidity exceeds the 
        humid high setpoint.
        04 - Humid Low - Will send an ON/OFF command when the humidity falls below the 
        humid low setpoint.
        EF - Broadcast - Other than MH, I do not know if any other device can 
        respond to these commands.

Tracking Child Objects:

For both, i1 and i2CS devices, optional child objects which track the states of the thermostat can be created in user code:


   $thermo_temp = new Insteon::Thermo_temp($thermostat);
   $thermo_fan = new Insteon::Thermo_fan($thermostat);
   $thermo_mode = new Insteon::Thermo_mode($thermostat);
   $thermo_setpoint_h = new Insteon::Thermo_setpoint_h($thermostat);
   $thermo_setpoint_c = new Insteon::Thermo_setpoint_c($thermostat);
   $thermo_humidity = new Insteon::Thermo_humidity($thermostat);  #Only available on i2CS devices
   $thermo_status = new Insteon::Thermo_status($thermostat);  #Only available on i2CS devices
   $thermo_humidity_setpoint_h = new Insteon::Thermo_setpoint_humid_h($thermostat);  #Only available on i2CS devices
   $thermo_humidity_setpoint_l = new Insteon::Thermo_setpoint_humid_l($thermostat);  #Only available on i2CS devices

where $thermostat is the parent object to track. The state of these child objects will be the state of the various attributes of the thermostat. This makes the display of the various states easier within MH. The child objects also make it easier to change the various states on the thermostat.

see code/examples/Insteon_thermostat.pl for more.


BUGS

This code has not been tested on older Venstar thermostats, however it is believed that the basic functionality should work as it did in the old code.


AUTHOR

Initial Code by: Gregg Liming <gregg@limings.net> Brian Warren <brian@7811.net>

Enhanced to i2CS by: Kevin Robert Keegan <kevin@krkeegan.com>


TODO

 - Enable Linking of the Thermostat as a Responder - The current design of MH 
   will not create valid links when the thermostat is the responder.  To enable
   this function, a reorganization of the add_link and update_link code at the
   BaseObject level needs to be performed.


INHERITS

Insteon::DeviceController

Insteon::BaseDevice


Methods

poll_mode()

Causes thermostat to return mode; detected as state change if mode changes

fan()

Sets fan to 'on' or 'auto'

cool_setpoint()

Sets a new cool setpoint.

heat_setpoint()

Sets a new heat setpoint.

poll_temp()

Causes thermostat to return temp; detected as state change.

get_temp()

Returns the current temperature at the thermostat.

poll_setpoint()

Causes thermostat to return setpoint(s); detected as state change if setpoint changes. Returns setpoint based on mode, auto modes return both heat and cool.

get_heat_sp()

Returns the current heat setpoint.

get_cool_sp()

Returns the current cool setpoint.

get_mode()

Returns the last mode returned by poll_mode() I2CS devices will report auto for both auto and program_auto.

get_fan_mode()

Returns the current fan mode (fan_on or fan_auto)


NAME

Thermo_i1 - Insteon Thermo_I1


DESCRIPTION

Enables support for Insteon Thermostat version i1.


SYNOPSIS


AUTHOR

Kevin Robert Keegan <kevin@krkeegan.com>


INHERITS

Insteon::Thermostat


Methods

mode()

Sets system mode to argument: 'off', 'heat', 'cool', 'auto', 'program_heat', 'program_cool', 'program_auto'. The 2441TH thermostat does not have program_heat or program_cool.


NAME

Thermo_i2 - Insteon Thermo_i2


DESCRIPTION

Enables support for Insteon Thermostat version i2.


SYNOPSIS


AUTHOR

Kevin Robert Keegan <kevin@krkeegan.com>


INHERITS

Insteon::Thermostat


Methods

derive_link_state([state])

Overrides routine in BaseObject. Takes state and checks to see if it is a valid state for the object. Returns state if valid, otherwise returns __.

_poll_simple()

Requests the status of all Thermostat data points (temp, fan, mode ...) in a single request. Called by request_status, you likely don't need to call this directly Only available for I2CS devices.

get_status()

Returns a text string describing the current status of the thermostat. May include a combination of "Heating; Cooling; Dehumidifying; Humidifying; or Off." Only available for I2CS devices.

print_status()

Prints the currently known status to the log as a text string.

get_humid()

Returns the current humidity at the thermostat.

get_high_humid_sp()

Returns the current high humidity setpoint.

get_low_humid_sp()

Returns the current low humidity setpoint.

mode()

Sets system mode to argument: 'off', 'heat', 'cool', 'auto', 'program_heat', 'program_cool', 'program_auto'. The 2441TH thermostat does not have program_heat or program_cool.

high_humid_setpoint()

Sets the high humidity setpoint.

low_humid_setpoint()

Sets the low humidity setpoint.

_poll_humid_setpoints()

Retreives and prints the current humidity high and low setpoints. Only available for I2CS devices.

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.


NAME

Thermo_mode - Insteon Thermo_mode


DESCRIPTION

A child object that contains the mode state of the thermostat.


SYNOPSIS


AUTHOR

Kevin Robert Keegan <kevin@krkeegan.com>


INHERITS

Generic_Item


Methods


NAME

Thermo_fan - Insteon Thermo_fan


DESCRIPTION

A child object that contains the fan state of the thermostat.


SYNOPSIS


AUTHOR

Kevin Robert Keegan <kevin@krkeegan.com>


INHERITS

Generic_Item


Methods


NAME

Thermo_temp - Insteon Thermo_temp


DESCRIPTION

A child object that contains the ambient temperature of the thermostat.


SYNOPSIS


AUTHOR

Kevin Robert Keegan <kevin@krkeegan.com>


INHERITS

Generic_Item


Methods


NAME

Thermo_humidity - Insteon Thermo_humidity


DESCRIPTION

A child object that contains the ambient humidity of the thermostat.


SYNOPSIS


AUTHOR

Kevin Robert Keegan <kevin@krkeegan.com>


INHERITS

Generic_Item


Methods


NAME

Thermo_setpoint_h - Insteon Thermo_setpoint_h


DESCRIPTION

A child object that contains the heat setpoint of the thermostat.


SYNOPSIS


AUTHOR

Kevin Robert Keegan <kevin@krkeegan.com>


INHERITS

Generic_Item


Methods


NAME

Thermo_setpoint_c - Insteon Thermo_setpoint_c


DESCRIPTION

A child object that contains the cool setpoint of the thermostat.


SYNOPSIS


AUTHOR

Kevin Robert Keegan <kevin@krkeegan.com>


INHERITS

Generic_Item


Methods


NAME

Thermo_status - Insteon Thermo_status


DESCRIPTION

A child object that contains the status (heating, cooling, ...) state of the thermostat.


SYNOPSIS


AUTHOR

Kevin Robert Keegan <kevin@krkeegan.com>


INHERITS

Generic_Item


Methods


NAME

Thermo_setpoint_humid_h - Insteon Thermo_humid_h


DESCRIPTION

A child object that contains the high numidity setpoint of the thermostat.


SYNOPSIS


AUTHOR

Kevin Robert Keegan <kevin@krkeegan.com>


INHERITS

Generic_Item


Methods


NAME

Thermo_humid_l - Insteon Thermo_humid_l


DESCRIPTION

A child object that contains the low humidity setpoint of the thermostat.


SYNOPSIS


AUTHOR

Kevin Robert Keegan <kevin@krkeegan.com>


INHERITS

Generic_Item


Methods


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. =cut

 Thermostat.pm