The old TagLabel API

Continuing the discussion from Lightsd: a daemon with a JSON-RPC API to control your bulbs:

Yes, it has been deprecated, but it will likely remain so that old versions of our applications are compatible with newer firmwares still. I have no timelines and can offer no assurance for how long this will remain, keep in mind it has never been officially documented and public documentation is based only on reverse engineering. It is not compatible with the newer Group and Location messages, but the newer versions of the official LIFX apps will migrate the settings from the older one to the newer one when they see them.

The new API has had its messages documented, but I haven’t yet completed full documentation on how it works. You can read my post below for a quick summary:

1 Like

Nice!! I missed that post, I’ll look into it.

Cool, I guess packet type 52 is for Device::SetGroup and the question is how to negotiate the group identifier?

It would be awesome if the documentation could be annotated with the versions in which packet types are added (or deprecated).

Thanks

It would be nice to have SetGroup and SetLocation documented, so that I don’t have to rely on the app for that. Although even with the app, I haven’t figured out how to change the location. Are Location and Group just two levels of hierarchy, or is there some deeper meaning attached to Location?

SetGroup and SetLocation are not documented because the groups and locations have deeper meanings to both the applications and the LIFX Cloud. We would prefer more testing before we go down that path. If you can figure out the message, feel free to play with it, but you may have to factory reset your bulbs to get things going again.

When you claim a bulb to your account it asks your location. Then each app has a button to change to another location. Think of it as different ‘contexts’ that you can be in.

Can you elaborate on what those deeper meanings are?

Fair enough, but eventually I would still like to be able to do everything that the app can do. My vision is that the official app should just be one of several apps, rather than being “privileged” in some way. I’m patient, though. :grinning:

Maybe this is turning into more of a “support” question than a “developer” question, but does that mean the only way to change a bulb’s location (via the official app) is to factory reset it and claim it again?

Is a “location” supposed to correspond to a LAN?

Only that they track groups, and expects certain things about the way they work.

We are certainly working towards that, but in a small company like LIFX time is always in short supply.

Yes

That’s really up to the user, but I’ve always thought of it as an operating context. For example I have a ‘Work’ and ‘Home’ location. LAN’s can extend beyond buildings, or you can have multiple LANs in a building. It’s not at all tied to the network layout.

Tagged collections are very much documented and included in the LIFX KIT. I use it in my LIFX Ambience iOS app based on the examples in that project. Deprecating this feature now breaks existing functionality.

Here is the example from the github LIFX-KIT page:

Turn on all lights that are tagged "Kitchen":

LFXNetworkContext *localNetworkContext = [[LFXClient sharedClient] localNetworkContext];
LFXTaggedLightCollection *kitchen = [localNetworkContext taggedLightCollectionForTag:@"Kitchen"];
[kitchen setPowerState:LFXPowerStateOn];