I bear witness and certify I have personally tested these changes made to GNU remotecontrol. I affirm the changes made to the code:
-achieve the functionality of the stated requirements;
-succeed during operation; and
-cause no anxiety.

We need to have the new field of GROUP in version 1.1, but we do not necessary need to have the expand/collapse functionality in version 1.1. If you are pressed for time, we can push the expand/collapse functionality to version 1.2 by making a new task and moving that part of this task over with no problem.

We would most likely do best by adding functionality to the admin.php page to accomplish generating and deleting groups. That keeps the thermostat profile table on index.php from getting any wider. All we have to do is decide on how we want to add the new field, Group, to that thermostat profile table.

We can have a User section on admin.php, like we have now, and a Group section (either above or below the existing User section). We have 2 on-page hyper-links at the top of admin.php, User Group, that jumps to each respective section.

We achieve similar functionality in the Group section as we have now in the User section.

******************************
WEB PAGE FIELDS:
-Edit/Add/Update Cancel
-Group Name
-We would most likely do best to go with a Group Description field
-We would most likely do best to add a count of thermostats in a given Group
-Delete
******************************

Now, there is not a lot of value to having a total count of thermostats in a group. This is due to the same problem that exists in the Total Thermostat count. Say user_1 has 10 thermostats, user_2 has 10 thermostats, and user_3 has 10 thermostats. There is no assurance, except by the wisdom of well-executed user choice, to enter 10 exclusive thermostats in each set of user assigned thermostats. There could be overlap that occurs by having the same physical thermostat entered 3 different times; by DNS name, by public IP address, or by private IP address.

Just the same, we should have that count of thermostats assigned to each Group. This is to solve the problem of if they are moving thermostats to a new group and want to delete that group. Knowing the thermostat count for that group is zero provides, in a web page and not being required to hit the database through SQL to find that answer, if there are any thermostats left in the group before deleting the said group.

The index.php page only provides the functionally to use a pull-down object to select for adding a thermostat into a group. That completely avoids any possibility of typographical errors from a user adding a thermostat and incorrectly entering the group the thermostat is a member of. The pull-down SQL is Select * from GroupName, order by GroupName.

I see a new table, as well. Probably group is a good name, with a GroupId like we have now with UserId.

Adding this new field, group, is simply a text field that is capable of letter, numbers, dashes, colon, whatever the end-user wants to put in there.

If we cannot simply achieve an expand and collapse functionality with PHP/JavaScript, then we need to further explore an additional check-box field (column). This would be to select a group, and that would select all check-boxes of thermostats in that group. This check-box would be only at the group level, but it does seem like a column for group and a column for thermostat would have to happen for this concept to work.

Attached is an idea I came up with. Not a mandate, simply an illustration of my thinking. If we go with an ALL row, we would not need a 2nd column of check boxes. The example to the left of the black line in the attachment is the simplest. The example to the right of the black line is more complicated.