the essence of the issue that i want to discuss here is what i would generalize as that of the "stateful controller". that means a controller of a device that has an internal state (a single LED being on or off or a bank of led's that represent the dim level) which ideally should track the state of a device that it is linked with.
so the recent additions to indigo have opened up some new capabilities in this area - specifically, it is possible now to have indigo control the state of a keypadlinc button LED, whereas that was impossible before (x10 kluges aside). i am now running into some questions and issues regarding how to best make use of these new features.
common scenario: i want to be able to control a device from within indigo and have the device and other linked stateful controllers stay in sync. for here's perhaps the simplest and most common example: i have a hallway light connected to a switchlinc and a second switchlinc configured as a "slave" switch at the other end of the hall. when i turn the light on, i want both the load to come on and the slave switch to indicate that it is on.
how do i do this currently in indigo? controlling the load is easy enough, obviously. however if i want the slave to stay in sync, then everywhere i would normally have a simple "control device" action for the load, i now need to send two commands - one to the load and another to the slave.
control pages in particular become more complicated in this scenario. controlling a single device is easy - you can simply create a "control light/ appliance" type control. what if you want to send commands to multiple devices? indigo allows you to essentially add additional devices to be controlled with a single control page item. (i actually had not known that this was possible until i started writing this, but this is extremely useful.) so this means that in the example scenario above, i can make the click action for the control page item corresponding to my hallway light have an action consisting of toggling the load and toggling the slave. so this is good.
however, if we now consider a variant of the above example where one module controls the load and the "slave" switch is a keypadlinc button instead of another switchlinc, then this doesn't work so smoothly. a keypadlinc led is not controlled by a normal insteon command, but instead by a group command. so although indigo now has the ability to control the state of the led, these don't interface smoothly with "control light/appliance" type of controls on control pages, since there are no toggle commands for groups like there are for regular insteon commands. thus, you can turn an LED on. you can turn it off. but you can't include one command that will toggle the current state.
so this seems to imply that keypad led's don't really behave the same way as regular insteon modules. indigo would have to track the state of keypad buttons in order to support a meaningful "toggle" command. this seems like it should not be too hard.
implementing this might have some other useful benefits. suppose i want to use a keypad button to represent a bit of state information, i.e. (my current "home" vs. "away" status). in indigo currently, i need to use a variable to represent this state, and i need to use triggers or other types of "glue" to make the remote LED track the state of the indigo variable and vice versa. if indigo could report on the state of the LED directly, then i wouldn't need the variable at all. i could write scripts something like:
- Code: Select all
if on state of button1 of device "foyer keypad"
... do stuff...
end
obviously, the above would entail a more complex representation of devices like keypadlincs - to both track their internal state and expose it via applescript properties.
generally speaking, it is my opinion that indigo's new link management capabilities have exposed the need for perhaps another level of abstraction in indigo - namely that of a set of stateful controllers that can be linked to a module. at first, i was thinking that this might require another top-level object type in indigo for groups of devices that need to stay in sync (in addition to devices, trigger actions, time/date actions, and action groups) so that they could be controlled together with a single command. ...but then it occurred to me that indigo already has the relevant information in its link database.
so i would like to see a new option for indigo's existing "control light/appliance" action type. i envision a new checkbox called "also control linked devices" or "simulate local control" (or something...). if this were checked, then instead of merely sending a single insteon command to directly control a device, indigo would instead modify other devices to keep their status indicators in sync with the device being changed. in other words, i could tell indigo to do the same thing that would have happened if i had pushed the switch/button manually.
this could be implemented in two ways (and thus might merit another sub-option): a) indigo could interpret the link database and send a series of direct commands b) indigo could send a single insteon group command. i think the two options are useful since there are only a total 256 (?) group commands that can be issued by the controller, so for situations where simultaneity of actions is not critical, you could just let indigo "simulate" a group command instead of actually defining one.
having this capability would keep actions, triggers, and even control pages and the applescript interface almost the same, but would add hugely to the ease of scripting and programming in indigo for insteon deployments with lots of linked devices (like my house).
although i've spent a lot of words trying to describe this, i think from a new user perspective, this is actually a great simplification for indigo overall. as a new insteon user, it takes a long time to understand what is possible and why (currently) what happens if you push the ON button on an insteon switch is in general very different from what happens when you send the switch an ON command from indigo.
thoughts, anyone?