LOGIN  |  REGISTER
Smart Living Made Brilliant!
CASTLEOS FORUM

HomeCastleOS API

Information, FAQs, Q&As, and everything else related to the CastleOS API can be found here

Web: Need Device ID Messages in this topic - RSS

Phil Hawthorne
Phil Hawthorne
Posts: 400


3/13/2016
Phil Hawthorne
Phil Hawthorne
Posts: 400
I've inspected the response object from the API for devices, and can't seem to find the ID of each device for CastleOS.

For example, I can turn on a Group or Scene by ID, by using the "value" field from GetAllScenes for example.

But for devices, there are two fields. "address" and "uniqueId". Parsing either of these to ToggleDevicePower does not turn the device on/off. So I need to know which ID I should be using for this endpoint.
0 link
Chris Cicchitelli
Chris Cicchitelli
Administrator
Posts: 3390


3/13/2016
Chris Cicchitelli
Chris Cicchitelli
Administrator
Posts: 3390
You're looking for "uniqueId", "address" is the protocol-specific address of the device and isn't used by the API when looking for a device Id. ToggleDevicePower should work, just be sure you include the second variable which is true/false for on/off.
0 link
Phil Hawthorne
Phil Hawthorne
Posts: 400


3/13/2016
Phil Hawthorne
Phil Hawthorne
Posts: 400
Perfect. Got it! Checked the docs and notice that endpoint uses id and not deviceId smile
0 link
Chris Cicchitelli
Chris Cicchitelli
Administrator
Posts: 3390


3/13/2016
Chris Cicchitelli
Chris Cicchitelli
Administrator
Posts: 3390
FYI: Groups and Scenes use numeric ids in sequence, while everything else uses a GUID...
0 link