Perry The Cynic wrote:matt wrote:links = indigo.rawServerRequest("GetLinksForDevice", {"Name":"office desk lamp"})
Um... how would I use that to read (and possibly edit/create) PowerLinc scenes? (What "name" is the PowerLinc itself?)
For the PowerLinc itself, use
PowerLinc Interface.
To write the links back to Indigo you would use something like (untested):
Code: Select all
indigo.rawServerCommand("SaveChangedDeviceLinks", argsDict)
Where the argsDict has 2 keys: ChangedLinks (whose value is a list) and Name (whose value you probably want "PowerLinc Interface"). Here is an example I captured from the Indigo client after adding 2 links to PowerLinc Group #5. One was to an ApplianceLinc, the other to a LampLinc.
Code: Select all
Name : PowerLinc Interface (string)
ChangedLinks : (list)
LinkChange : (dict)
AddressStrUI : 01.1D.C3 (string)
AddressValUI : 73155 (integer)
Data1UI : 191 (integer)
Data2UI : 30 (integer)
Data3UI : 1 (integer)
DeviceNameUI : Office LampLinc (string)
GroupNumUI : 5 (integer)
Persistent : true (bool)
RuntimeID : 0 (integer)
RuntimeID_bl : 0 (integer)
Status : 3 (integer)
Type2 : 2 (integer)
LinkChange : (dict)
AddressStrUI : 21.72.C0 (string)
AddressValUI : 2192064 (integer)
Data1UI : 255 (integer)
Data2UI : 31 (integer)
Data3UI : 1 (integer)
DeviceNameUI : Office ApplianceLinc (string)
GroupNumUI : 5 (integer)
Persistent : true (bool)
RuntimeID : 0 (integer)
RuntimeID_bl : 0 (integer)
Status : 3 (integer)
Type2 : 2 (integer)
The status enum values are:
Code: Select all
kInstnLinkStatus_InSync = 1, // currently in-sync
kInstnLinkStatus_Edited, // user had edited -- need to sync
kInstnLinkStatus_New, // user just created -- need to sync
kInstnLinkStatus_Deleted, // user just deleted -- need to sync
And Type2 is 1 for a link to a controller and 2 for a link to a responder. All links you would write into the PowerLinc would be 2.
I'm not positive, but you probably don't need to write these key/values (or the value isn't really used by the server when saving): AddressStrUI (AddressValUI is needed though), DeviceNameUI, RuntimeID, RuntimeID_bl.
All of the info above is subject to change without notice, of course. That said, we have no plans for any modifications nor have there been any changes in the above structures or API in a long time.