| Both sides previous revision Previous revision Next revision | Previous revision |
| indigo_2025.1_documentation:device_class [2026/03/10 22:13] – [Get Group List] davel17 | indigo_2025.1_documentation:device_class [2026/03/10 22:43] (current) – [Ungroup With Device] davel17 |
|---|
| |direct parameter| Yes | integer |id or instance of the device to enable/disable| | |direct parameter| Yes | integer |id or instance of the device to enable/disable| |
| |//''value''//| No | boolean |//''True''// to enable, //''False''// to disable| | |//''value''//| No | boolean |//''True''// to enable, //''False''// to disable| |
| |
| |
| === Get Dependencies === | === Get Dependencies === |
| |
| So, the dictionary will have 5 top-level keys: "actionGroups", "controlPages", "devices", "schedules", "triggers", and "variables". Each one of those keys will return a list object. Inside that list object will be multiple dicts, one for each dependency (or an empty list if there are none). Each dependency dictionary has two keys: "ID" which is the unique id and "Name" which is the name of the object. | So, the dictionary will have 5 top-level keys: "actionGroups", "controlPages", "devices", "schedules", "triggers", and "variables". Each one of those keys will return a list object. Inside that list object will be multiple dicts, one for each dependency (or an empty list if there are none). Each dependency dictionary has two keys: "ID" which is the unique id and "Name" which is the name of the object. |
| | === Get Group List === |
| | |
| | <color blue>API v1.14+ only:</color> Return an indigo.List with all device IDs in a device group. |
| | |
| | ^ Command Syntax Examples ^ |
| | <code>indigo.device.getGroupList(123) # returns an indigo.List of all devices grouped with dev</code> |
| | |
| | ^ Parameters ^^^^ |
| | ^ Parameter ^ Required ^ Type ^ Description ^ |
| | |direct parameter| Yes | integer |id or instance of any device that belongs to a device group.| |
| | |
| | getGroupList() is useful to get the main/root device of a device group. Some properties, such as batteryLevel, only exist on the main/root device. In this example we log the batteryLevel for a module given any devices that belong to its group: |
| | |
| | <code>groupList = indigo.device.getGroupList(devIdOrInstance) |
| | rootDevice = indigo.devices[groupList[0]] |
| | indigo.server.log('battery level is: ' + str(rootDevice.batteryLevel))</code> |
| | |
| | See also ''//indigo.device.groupWithDevice()//'' and ''//indigo.device.ungroupDevice()//''. |
| |
| |
| === Group With Device === | === Group With Device === |
| | To group two or more devices together, use the ''//indigo.device.groupWithDevice()//'' command. The parameters are the Indigo Device object IDs of the devices to be grouped. **Note if you have the device dialog UI open, it will not dynamically update, and you shouldn’t call either method if the device factory UI is open.** |
| |
| <code> | ^ Command Syntax Examples ^ |
| indigo.device.groupWithDevice(dev, someOtherDev) # group dev with another device | <code>indigo.device.groupWithDevice(dev_1, dev_2) # group dev with another device</code> |
| </code> | |
| | ^ Parameters ^^^^ |
| | ^ Parameter ^ Required ^ Type ^ Description ^ |
| | |direct parameter (dev_1)| Yes | integer |id, name or instance of a device that will belong to the group.| |
| | |direct parameter (dev_2)| Yes | integer |id, name or instance of another device that will belong to the group.| |
| |
| See also ''//indigo.device.ungroupDevice()//'' and ''//indigo.device.getGroupList()//''. | For example, if you want to group devices 123 and 456, you would use ''//indigo.device.groupWithDevice(123, 456)//''. There is no message printed to the events log if the devices grouped together successfully. If you want to add device 789 to the group, you would use ''//indigo.device.groupWithDevice(456, 789)//''. This is a great way to bring together different devices that have a common thread, but bear in mind that it's best not to try to group too many devices together. See also ''//indigo.device.ungroupDevice()//'' and ''//indigo.device.getGroupList()//''. |
| === Move To Folder === | === Move To Folder === |
| |
| |
| === Ungroup With Device === | === Ungroup With Device === |
| | If you want to remove a device from a group, use the ''//indigo.device.ungroupDevice()//'' command. Use this command with the ID of the device you want removed from the group.**Note if you have the device dialog UI open, it will not dynamically update, and you shouldn’t call either method if the device factory UI is open.** |
| |
| | ^ Command Syntax Examples ^ |
| <code> | <code> |
| indigo.device.ungroupDevice(dev)# group dev with another device | indigo.device.ungroupDevice(dev) # ungroup dev |
| </code> | </code> |
| |
| See also ''//indigo.device.groupWithDevice()//'' and ''//indigo.device.getGroupList()//''. | ^ Parameters ^^^^ |
| | ^ Parameter ^ Required ^ Type ^ Description ^ |
| | |direct parameter| Yes | integer |id, name or instance of the device to be removed from the group.| |
| | If successful, nothing will be printed to the events log. See also ''//indigo.device.groupWithDevice()//'' and ''//indigo.device.getGroupList()//''. |
| === Unlock === | === Unlock === |
| |