LIFX Developer Zone

Flash Bulbs LAN

Hello,
Using the LAN protocol I have an Android app that will flash Lifx bulbs around my house if I receive a phone call or Skype call. Currently I flash the bulb by sending power on and power off commands with my software controlling the timing. It works, but I’m thinking it may perform better and I may be able to implement different period times for the different types of calls if I use a Pulse Waveform command.

I have a mix of Mini White and Day and Dusk bulbs. I’m not exactly sure what commands I would need to send. Is the following what I would want to send?

  1. Set Color to HSBK: 0, 0, 0, 4000. This will set the color to dark, a sort of cool temperature.
  2. Set Power On. This turns on power, but the bulb will be dark.
  3. Set Waveform for Pulse, HSBK: 0, 0, 65535, 4000; 50% duty cycle; zero SKU; 300 ms period; 10 cycles. This makes the bulb flash 10 times and leaves it turned on.
  4. Set Power Off.

Is there a way to know when the programmed waveform is complete?

Thanks for any suggestions.

Barry.

That sounds correct :slight_smile:

As for status of the waveform, the protocol doesn’t have any way of us asking the device where it’s at with it’s waveform. In this case, if you know when you started it, it will always take the same amount of time.

@canalrun , would you mind sharing what app you use to achieve this? Tasker perhaps?
I’d like to do the same thing since my Vera hub crapped out on me. Thanks

Certainly.

I have written an Android app and a Windows application.

The Android app listens for notifications from communications apps (like the phone dialer, messaging, Skype, Google Duo, and a couple more) then flashes the bulbs throughout the house when it recognizes one of those notifications. I am deaf so I don’t hear the cell phone ringing. If I’m not staring at the phone, I will miss the call.

The Android app is written with a development tool called B4A. It’s currently free from a company named Anywhere Software (it’s easy to find on the web). I use an older version of B4A , 7.80, but the newer version will work with some minor modifications to my source code.

I also use a Windows application written in B4J (also free from the same company) that generates the LAN API byte strings which I then copy and paste into the Android app.

I am happy to share my source code for both the app and Windows application. It’s definitely not “professionalized” code, but a somewhat experienced software developer should be able to make use of it.

Let me know if you are interested in the source. I will upload it to dropbox or something.

Barry.

I uploaded the source to DropBox: Dropbox - LifX LAN API Ex.zip - Simplify your life

Hi Barry,
Unfortunately I’m not a programmer, but hopefully someone here will be willing to collaborate with you and put it on the Play store. It sounds like something that could be useful for many people (deaf or not)!
I used to have it set up so that my phone would use Tasker + a plugin to send a trigger to a home automation hub that I was using, until everything fell apart for some reason. I had light signals for calls, texts, my doorbell (using my security system), and when certain motion sensors were triggered. I miss that a lot.
Good luck with your project!
-Derek

1 Like