Get IP + macaddr of LIFX devices via the LIFX binding?

I’m using the LIFX binding to access a light strip. Because the binding only fits very basic needs, I wrote some python scripts using mclarkk’s lifxlan library and call them in several OH rules. Unfortunately, the library either requires IP + mac address of the devices to control, or it performs a time-extensive search. At the moment, I store these data as variables in my rules files, but this feels kind of code smell. How can I receive this information from the LIFX items via the binding?

The binding doc does not give any information about it, and I could find something useful with Google so far.

If this is not yet possible at all and some developer of the binding may read this, he or she may treat this as a polite feature request :slight_smile:

Best,
Christoph

Hi Christoph
Thanks for posting the link to this very interesting software. I use a library I found call lightsd to blink my lifx bulbs from a script which can be triggered from OpenHAB

I know this doesn’t really help answer your question, sorry

Hi Andrew,

it’s always helpful to hear others’ experiences :slight_smile:
But unless I am wrong, each library must face the same issue: Either the specific address of the device is passed, or the library has to do an expensive discovery.

So I am wondering how we can make openHAB to tell us the specific device address …

Yes, the lightsd library does the same thing, works the same but I only have one Lifx bulb so I can send a command to all and since there is only one bulb…
The library you posted, the read me states that one of the examples shows retrieving this info and it is not finding the ip or mac, you say you have it stored in your rules as variables, it is getting OpenHAB to dynamically discover them on its own right?
I use an IP reservation on my router to make sure the bulb always keeps the same IP address, I know nothing is foolproof but I don’t see storing the IPs in variables as being that bad a solution but I understand if things change, router dies whatever then you have to edit a rule file to fix.

you say you have it stored in your rules as variables, it is getting OpenHAB to dynamically discover them on its own right?

No, I actually hard-coded the values. I don’t like this because every change to my physical installation will require me not only to update the items file, but also the rules.

no I get it for sure