Api not finding any lights

I’m having trouble with the LIFX Api. When running the example code (python, cURL or the try it out section) no lights are discovered.

While using the windows or android app I am capable of turning the light on or off. But when I try to list all lights on the network using both these devices, none are found.

Does anyone know what might be causing this problem? I already tried it on 2 different networks.

Can you use your bulbs when you are not on your wifi network? Have you claimed your bulbs?

Can you clarify your question.

Are you trying to discover using the LAN API ? I susoect you mean the HTTP API and then yes Dan’s question is correct, if you have not claimed your bulbs and are not able to control them outside of your network then the cloud won’t know about them and your discovery will fail.

I know for me using Dan’s Python API (LAN) if I change the IP address of a bulb and then use the Python API to discover bulbs on my original bulbs none show up where they all did before I changed the IP address.
If I leave it till the next day they are all detected again.
Maybe it is my ASUS router but there are issues, Logitech POP only ever discovers 5 of my 7 lights, nothing I do from a reset to new IP allows POP to discover my 2 last bulbs.

Thank you for the quick response!
I wasn’t aware of the possibility to claim bulbs, I noticed this all of sudden last night. For some reason I totally misundestood how to communicate with the Lifx’s.
After claiming the bulb I was able to turn it on and off using the HTTP Api, I did not yet test this from another network.
I would however like to controll them on a local network without internet acces. I tried using the discover example in your python library which unfortunately didn’t give any results. The windows 10 app does toggle the light so it is connected properly (the network does not have internet acces).

Thanks for the reply.

I was not aware of two different Api’s. I thought that there was 1 Api and the LAN Protocol section was just an explanation of how the protocol this Api uses. I managed to get the bulb working last night with the Http api but knowing this, for my situation, I am going to look into the LAN Api (and Dan’s library).

edit

I just tried using Dan’s discovery example but this did not return any results. Controlling it with the windows 10 app did work (on a seperate network without internet acces)
Using mclarkk’s lifxlan library I tried creating a light object with the mac address and IP address but this resultes in an error.

Well the LAN side is the protocol definition but Dan has created his own Python API that uses it.
There are a number of them now created by different people, just remember google and github is your friend :slight_smile:

Thank you,I thought I did my research but apparently I missed that part… For me Dan’s example did not discover any light bulbs on my network, while the app on mobile and windows did show the lights.
At the moment we switched to Philips Hue lights but we would like to get the Lifx working. Do you know what might cause the problem of the lights not being discovered by Dan’s Lan library?

I had the issue a few times, none of the API’s I tried by various people worked, lights just were not discovered. Gave it some time and they then were immediately found… very weird.
As a test turn off any firewall maybe that is your problem.