Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insteon: Add Support for Thermostat i2 Devices #267

Merged
merged 92 commits into from
Oct 12, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
0e979b3
Add milliseconds to Message Decoder Output
krkeegan Jan 28, 2013
f92fc5f
Fix decimal places in milliseconds
krkeegan Feb 7, 2013
d1a3c3c
Move Old Insteon Thermostat Code to Insteon lib
krkeegan Mar 2, 2013
abf3152
Recode Initialization of Inteon Thermostat Object
krkeegan Mar 2, 2013
364c932
Convert all calls to _send_cmd to use Message Class
krkeegan Mar 2, 2013
95780d9
Convert Print Log Messages to the Proper Format
krkeegan Mar 2, 2013
ac0e056
Add Thermostat Message Types
krkeegan Mar 3, 2013
96baeab
Revise Read_Table_A to Point to Thermostat.pm
krkeegan Mar 3, 2013
06f3fa8
Fix Missing Semicolon
krkeegan Mar 3, 2013
cc9cc32
Fix Message Creation, Add Awaiting Ack for Thermostat
krkeegan Mar 5, 2013
ad0d3b7
Condense Duplicate Thermostat Message Types
krkeegan Mar 5, 2013
7a59f69
Fix Library Name in Print_Log Messages
krkeegan Mar 6, 2013
0914b7a
Remove Duplicate Entries in _is_info_request and _process_message
krkeegan Mar 6, 2013
181fc28
Fix Typo in _zone_action tracking, allow for subsequent setpoint mess…
krkeegan Mar 6, 2013
53cf854
Add Documentation to Existing Code
krkeegan Mar 7, 2013
d3544c0
Test out Extended Message for Mode
krkeegan Mar 8, 2013
1aee18d
Create simple_message(), Use for all subs that set data
krkeegan Mar 8, 2013
1079eed
Final cleanup of Insteon Thermostat
krkeegan Mar 8, 2013
7045d79
Merge branch 'insteon_thermostat' into insteon_thermo_i2
krkeegan Mar 9, 2013
012b54f
Add Initial Thermo i1 & i2 Subclasses
krkeegan Mar 9, 2013
5f58690
Merge branch 'fix_update_link' into insteon_thermo_i2
krkeegan Mar 12, 2013
54f08ff
Create Thermostat Broadcast Dummy Object
krkeegan Mar 12, 2013
e4d977a
Continue to work on adding Broadcast Device
krkeegan Mar 13, 2013
cb07a83
Change Insteon Thermostat i2 Broadcast Item Name
krkeegan Mar 14, 2013
55d578a
Create Insteon Thermostat i2 Child Device Objects
krkeegan Mar 14, 2013
f052ccc
Create Insteon Thermostat i2 Child Items on Init
krkeegan Mar 14, 2013
5873c95
Insteon::Thermo_i2 Inject Broadcast Setting Message into Sync_links
krkeegan Mar 14, 2013
60af877
Insteon::Thermo_i2 Add Message Types
krkeegan Mar 14, 2013
aea4e57
Insteon::Thermo_i2 Set Broadcast Flag with Sync Links
krkeegan Mar 14, 2013
65ed4bf
Insteon::Thermo_i2 Fix Debug Logging
krkeegan Mar 14, 2013
4f54382
Insteon::Thermo_i2 Fix inheritance problem in message_types
krkeegan Mar 14, 2013
feb2c89
Insteon::Thermo_i2 Child default states and tie parent state to child
krkeegan Mar 14, 2013
9a1a05b
Insteon::Thermo_i2 Only put child objects into non-recursive groups
krkeegan Mar 14, 2013
59d0113
Insteon:Thermo_i2 Add Poll All Request, and Processing
krkeegan Mar 15, 2013
16def88
Merge branch 'insteon_crc16' into insteon_thermo_i2
krkeegan Mar 15, 2013
1c7c0e8
Modify list_groups_by_object to allow for non-recursive listing
krkeegan Mar 14, 2013
ac56b79
Insteon::Thermo_i2 Save and Restore Humidity State
krkeegan Mar 15, 2013
88d7791
Insteon::Thermo_i2 Add Status Message Types
krkeegan Mar 15, 2013
85135d8
Insteon::Thermo_i2 Add subs to interpret status mode and temp
krkeegan Mar 15, 2013
fb2e38d
Insteon::Thermo_i2 add steps in _process_message to catch and process…
krkeegan Mar 15, 2013
5f47ec1
Insteon:Thermostat Distinguish Between Extended Set/Get Messages that…
krkeegan Mar 19, 2013
2908e6c
Insteon:Thermo_i2 Add Set Routine to Children
krkeegan Mar 19, 2013
3f94bc0
Insteon::Thermostat Split Mode Routine into i1 and i2 Specific Routines
krkeegan Mar 20, 2013
7b7e388
Insteon::Thermostat Split _is_info_request for Mode Change into i1 an…
krkeegan Mar 20, 2013
1ea9faa
Insteon::Thermo_i2 Create set_receive Routines in Child Objects
krkeegan Mar 20, 2013
f861c33
Insteon::Thermo_i2 Allow Changes to Child Objects to be Propogated to…
krkeegan Mar 20, 2013
c44c80e
Insteon::Thermo_i2 Catch ACK of Setpoint Changes and Update State
krkeegan Mar 20, 2013
f8c55ec
Insteon::Thermostat Split simple_message into i1 and i2
krkeegan Mar 20, 2013
779bbb3
Insteon::Thermo_i2 Added sync_time Function
krkeegan Mar 20, 2013
304b702
Insteon::Thermostat Add Hop Tracking
krkeegan Mar 21, 2013
563e0a9
Merge branch 'insteon_debugger' into insteon_thermo_i2
krkeegan Mar 22, 2013
cd23108
Insteon::Thermo_i2 Change to sync_time flag and convert time to hex
krkeegan Mar 22, 2013
1b55b88
Insteon::Thermo_i2 Reorganize i2 init routine and clean up spacing in…
krkeegan Mar 27, 2013
6c555d0
Insteon::Thermo_i2 Move Child Objects to First-Level MH Objects
krkeegan Mar 27, 2013
43ddcdf
Insteon::Thermo_i2 Define Parent and set Initial Value in Child Objec…
krkeegan Mar 27, 2013
dd9501e
Insteon_Thermo_i2: Remove Complex Code Creating Child Objects
krkeegan Apr 19, 2013
ae54038
Insteon_thermo_i2: Remove Parent_Event Routine
krkeegan Apr 19, 2013
6558d86
Insteon_thermo_i2: Change Name of Child Objects
krkeegan Apr 19, 2013
ed339a7
Insteon_thermo_it: Cleanup Example Thermostat Code File
krkeegan Apr 19, 2013
1842025
Insteon_thermo_i2: Add Example to Thermostat Code File for Child Objects
krkeegan Apr 19, 2013
80f67eb
Insteon_thermo_i2: Fix Comments in Example Code
krkeegan Apr 19, 2013
220f503
Insteon_thermo_i2: Remove Complex Tie Example from Example User Code
krkeegan Apr 19, 2013
a5d8ef3
Insteon_thermo_i2: Add Parent Event Routine to Base Thermostat Code
krkeegan Apr 19, 2013
1e934f1
Insteon_thermo_i2: Add Child Object to Parent Hash and Call Tie_Event
krkeegan Apr 19, 2013
6d30f8b
Insteon_Thermo_i2: Final touches on Thermostat Code
krkeegan Apr 23, 2013
6672d7b
Merge remote-tracking branch 'mstovenour/i2_aldb_support' into insteo…
krkeegan Apr 23, 2013
1005109
Insteon_Thermo_i2: Fix Typo
krkeegan Apr 23, 2013
30547d6
Insteon_Thermostat: Cleanup Instructions, Make Print Log More Clear, …
krkeegan May 28, 2013
1f42c65
Insteon_Thermo: Add support for Groups 2-4, Add Status Child
krkeegan May 28, 2013
e42ae6c
Insteon_Thermostat: Add support for setting the high_humidity setpoint
krkeegan May 28, 2013
849fd9d
Insteon_Thermoi2: Add Support for Humidity Setpoints
krkeegan Jun 1, 2013
54b0beb
Insteon_Thermoi2: Elevate Broadcast Item to a Full Fledged Object
krkeegan Jun 1, 2013
9aced81
Insteon_Thermoi2: Only send Broadcast Request Once
krkeegan Jun 2, 2013
e654e93
Insteon_Thermo: Catch Status Request Responses
krkeegan Jun 8, 2013
ce0b2a8
Insteon_Thermo: Convert i2 Entries to i2CS
krkeegan Aug 28, 2013
cd001a4
Insteon_Thermo: Check Engine Version of Root Device not ALDB Version
krkeegan Aug 28, 2013
c3e3350
Insteon_Thermo_i2: Decode Status Flag
krkeegan Oct 9, 2013
101143b
Insteon_Thermo_i2: Update status on Humidifying or Dehumdifying
krkeegan Oct 9, 2013
608d81c
Inston_Thermo_i2: Convert Poll_Status to an Internal Sub, Replace wit…
krkeegan Oct 9, 2013
3de1e9d
Insteon_Thermo_i2: Add Request_status Routine
krkeegan Oct 9, 2013
7576d50
Merge branch 'master' into insteon_thermo_i2
krkeegan Oct 9, 2013
a970d64
Insteon_Thermo_i2: Fix Typos in Comments
krkeegan Oct 10, 2013
3fa31ea
Insteon_thermo_i2: Add Humidity Setpoint Child Objects
krkeegan Oct 10, 2013
ba1831f
Insteon_Thermo_i2: Change Name of (De)Humidifying Functions to Match …
krkeegan Oct 10, 2013
a7d18a2
Insteon_Thermo_i2: Use Simple_Message Whenever Possible
krkeegan Oct 10, 2013
3aa224a
Insteon_Thermo_i2: Fix Typo in Debug Log Entry
krkeegan Oct 10, 2013
0680d39
Insteon_Thermo_i2: Create Get_Humid_Setpoint Functions
krkeegan Oct 10, 2013
0e48368
Insteon_Thermo_i2: Manually Set (De)Humidifying States on Request Status
krkeegan Oct 10, 2013
95597cb
Insteon_Thermo_i2: Set Humidity Setpoint Pending States on Extended M…
krkeegan Oct 10, 2013
47aeab1
Insteon_Thermo_i2: Humidity Setpoints must be in range of [1-99], Set…
krkeegan Oct 10, 2013
0098ae6
Insteon_Thermo_i2: Remove Extra Space
krkeegan Oct 10, 2013
ae81eaa
Insteon_Thermostat: Add Voice Command for Sync Time
krkeegan Oct 11, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 26 additions & 7 deletions code/examples/Insteon_thermostat.pl
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Category=HVAC

$v_test_thermostat = new Voice_Cmd("Send Thermostat cmd [ping,poll_mode,mode_off,mode_heat,mode_cool,mode_auto,mode_pgm_heat,mode_pgm_cool,mode_pgm_auto,fan_on,fan_auto,poll_temp,poll_setpoint]");
$v_test_thermostat = new Voice_Cmd("Send Thermostat cmd [poll_mode,mode_off,mode_heat,mode_cool,mode_auto,mode_pgm_heat,mode_pgm_cool,mode_pgm_auto,fan_on,fan_auto,poll_temp,poll_setpoint]");

# Create the Object in user code:
#use Insteon_Thermostat;
#$thermostat = new Insteon_Thermostat($plm,'12.34.56');
#$thermostat = new Insteon_Thermostat('12.34.56', $plm);

# or in items.mht (read_table_A)
#IPLT, 12.34.56,, thermostat, HVAC, plm
#INSTEON_THERMOSTAT, 12.34.56,, thermostat, HVAC

# poll_setpoint also runs poll_mode
if ($Startup || $Reload) {
Expand All @@ -29,9 +29,7 @@


if (my $state = said $v_test_thermostat) {
if ($state eq 'ping') {
$thermostat->ping();
}elsif ($state eq 'poll_mode') {
if ($state eq 'poll_mode') {
$thermostat->poll_mode();
}elsif ($state eq 'poll_temp') {
$thermostat->poll_temp();
Expand Down Expand Up @@ -89,4 +87,25 @@
$thermostat->heat_setpoint(66);
$thermostat->cool_setpoint(82);
$thermostat->poll_setpoint();
}
}

## The examples show how the defined child objects can be Used to Track and Display
## individual data points in the thermostat. Each of the child objects will
## display and permit the adjusting (if applicable) of one data point such as
## fan mode or cool setpoint.

#Define the Children
$thermo_temp = new Insteon::Thermo_temp($thermostat);
$thermo_fan = new Insteon::Thermo_fan($thermostat);
$thermo_mode = new Insteon::Thermo_mode($thermostat);
$thermo_humidity = new Insteon::Thermo_humidity($thermostat);
$thermo_setpoint_h = new Insteon::Thermo_setpoint_h($thermostat);
$thermo_setpoint_c = new Insteon::Thermo_setpoint_c($thermostat);

#Add the Children to the HVAC Group
$HVAC->add($thermo_temp);
$HVAC->add($thermo_fan);
$HVAC->add($thermo_mode);
$HVAC->add($thermo_humidity);
$HVAC->add($thermo_setpoint_h);
$HVAC->add($thermo_setpoint_c);
27 changes: 27 additions & 0 deletions lib/Insteon.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,32 @@ sub check_all_aldb_versions
main::print_log("[Insteon] DEBUG4 Checking aldb version of all devices completed") if ($main::Debug{insteon} >= 4);
}

sub check_thermo_versions
{
main::print_log("[Insteon] DEBUG4 Initializing thermostat versions") if ($main::Debug{insteon} >= 4);

my @thermo_devices = ();
push @thermo_devices, Insteon::find_members("Insteon::Thermostat");
foreach my $thermo_device (@thermo_devices)
{
if ($thermo_device->isa('Insteon::Thermostat') &&
$thermo_device->get_root()->engine_version eq "I2CS"){
main::print_log("[Insteon] DEBUG4 Setting thermostat "
. $thermo_device->get_object_name() . " to i2CS")
if ($main::Debug{insteon} >= 4);
bless $thermo_device, 'Insteon::Thermo_i2CS';
$thermo_device->init();
}
else {
main::print_log("[Insteon] DEBUG4 Setting thermostat "
. $thermo_device->get_object_name() . " to i1")
if ($main::Debug{insteon} >= 4);
bless $thermo_device, 'Insteon::Thermo_i1';
}
}
#main::print_log("[Insteon] DEBUG4 Checking thermostat version of all devices completed") if ($main::Debug{insteon} >= 4);
}

=back

=head2 INI PARAMETERS
Expand Down Expand Up @@ -1167,6 +1193,7 @@ sub _active_interface
&main::Reload_post_add_hook(\&Insteon::BaseInterface::poll_all, 1);
$init_complete = 0;
&main::MainLoop_pre_add_hook(\&Insteon::init, 1);
&main::Reload_post_add_hook(\&Insteon::check_thermo_versions, 1);
&main::Reload_post_add_hook(\&Insteon::generate_voice_commands, 1);
}
$$self{active_interface} = $interface if $interface;
Expand Down
3 changes: 3 additions & 0 deletions lib/Insteon/BaseInsteon.pm
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,9 @@ sub _process_command_stack
or $message->command eq 'set_operating_flags'
or $message->command eq 'get_operating_flags'
or $message->command eq 'read_write_aldb'
or $message->command eq 'thermostat_control'
or $message->command eq 'thermostat_get_zone_info'
or $message->command eq 'extended_set_get'
or $message->command eq 'ping'
)
{
Expand Down
Loading