Having trouble using curl commands to control bulbs

Hey. I recently Jailbroke my old iPhone so I could use the assistant+ and activate command apps to allow Siri to control my lights with voice commands.

I should state that I am not a programmer and have no coding experience, so please treat me like a complete newbie when explaining things because I have no idea what I’m doing here :stuck_out_tongue: . I’m trying to turn the lights on with the following curl command:

curl -H “Authorization: Bearer [MY TOKEN]” -X PUT -d “state=on” “https://api.lifx.com/v1/lights/all/state

The activate command app then returns the following error: curl: (60) SSL certificate problem: unable to get local issuer certificate.

It then suggests I run the command in insecure mode with the -k argument, so I add that into the curl command as follows:

curl -k -H “Authorization: Bearer [MY TOKEN]” -X PUT -d “state=on” “https://api.lifx.com/v1/lights/all/state

Then it returns:

“results”: [
“id”: “[MY TOKEN]”,
“label”: “Bedroom”,
“status”: “ok”

And does nothing. I get the exact same message when I’m testing from the set state test page here: http://api.developer.lifx.com/docs/set-state but the difference is that it works when issuing commands from that page.

So I’m completely stumped. Can anyone help? Cause I have no clue what it isn’t working and no chance of figuring it out on my own.

Ideally, I’m hoping for someone who has the same setup (iPhone, Assistant+, Activate Command) and can give me the exact commands to use to switch all lights on and off. I know it’s been done because plenty of people have posted about doing it around the Internet, but none of them have compiled a guide or list of commands to use.

Thanks a bunch in advance for any help!

I’m a dummy. After much mucking around I figured out that I’ve been overlooking a really simple factor the whole time, as it’s so often the case with these things. I was using the “state” argument when it’s deprecated. It’s now “power”. I’m kind of surprised it didn’t return an error as such.

All is now working perfectly. Hopefully this post will help someone someday.

Glad you sorted it out. I’ll mention to the developers that the endpoints should issue error messages for unsupported parameters.

Hello, I am trying to accomplish the same thing the poster was here. I basically put in exactly what he said replacing the word “state” with “power” using the exact same command and apps from Cydia and everything. What am I missing here?

I would try removing the wildcard and turning off passthrough. Also, try the second example I gave (the one with the -k) don’t forget to change the “state” to "power, obviously.

Just to be extra sure, you ARE replacing the [MY TOKEN] part with your own token code, aren’t you?

What output do you get? We’ve modified the API so it now returns warnings when unrecognised parameters are passed to it.