New and improved UI for the client, and more Macro musings

As time has gone by and I have added more devices to each room, the UI became cluttered. To this end about a month ago I added the concept of device groups to collect devices together. I have used groups to aggregate devices by room.

This worked well enough, but with the addition of subdevices for each of the buttons and fan links, each room can easily get cluttered as well. So in the client, when a the device list is retrieved, if there are more than one device with the same first 6 characters of ID, then a new subtree is built to aggregate all of the subdevices. This seems to work well, I have not decided exactly how to present this, at the moment it generates a group labeled with the 6 common characters of ID, but that might change in the future.

While I was doing this, I mulled over the idea that Macros need to be defined a little differently in the configuration file, currently a macro is defined like this

<macro address="1c466c03" command="faston" name="Master fan full on">
  <effect address="14a7dc01" command="on" delay="0"/>

where a macro can have only one trigger. The change will convert the macro to

<macro name="Master fan full on">
  <trigger address="1c466c03" command="faston"/>
  <effect address="14a7dc01" command="on" delay="0"/>

By separating the trigger into its own element within the macro, I can support multiple triggers to the macro. When the macro is expanded, all triggers will be checked and if anyone of them is matched the macro will be executed. This will allow one macro to respond to multiple stimuli, instead of needing to write the same macro repeatedly. This will be most useful in the case of the master bedroom fan where there are multiple controllers.