mundmc wrote:Hi Jay,
Only marginally relevant to howartp’s plugin, so feel free to file/delete.
I often run into situations where I wish I had some representation of a room, and everything Indigo in the room.
Examples.:
Easily selecting values to be displayed in Control Pages, like LivingRoom.temperature, Kitchen.occupied, Den.musicSource
At present, i use a nomenclature for names, like SWITCH_KITCHEN_recessedLights for devices, or MULTISENSOR_KITCHEN_motion
Another goal is to have rooms reference their neighbors.
Ex.:
if Kitchen.motion:
#turn on kitchen lights
#for neighbor in Kitchen.neighbors:
#turn on neighbor.lights
Also, i still have a pipe dream about more accurate room occupancy detection, checking neighboring rooms for motion to get a sense of a vector, aiming for “smarter” prediction.
I see. Folders are the usual organization structure, and #1 could be solved by making the selector controls show them (it's amazingly time consuming and code intensive to build hierarchical menus in Cocoa - at least targeting the 10.7 SDK as we are). It's on the list, but never seems to be of sufficiently high priority for us to address it.
#2 definitely falls outside of just an organization since a room in that instance is actually a rollup of a variety of devices. Your syntax won't work because we don't allow custom devices to specify their own properties (just states) and devices can't implement multiple device types (on/off, dimmer, thermostat, etc) in the same device definition (think of it as single inheritance only). And of course it's unclear what your example is (a script? pseudo language for UI logic of some kind?). So my guess is that you're probably not going to be satisfied with whatever you can construct given the current API (but I could be wrong).
I suspect the best you could do is create a aggregator device of all motion-type detection stuff in a given room (multiple motion sensors or other occupancy things) where your plugin would get updates from those devices and use whatever internal logic to set the state of the aggregate device accordingly. Somewhat like what we do with Device Groups but tailored to a broader range of input devices (if you're only rolling up devices that are on/off devices then a Device Group might work for you).