Talking with WPLight API

API documentation to use WPLight with your software

The WPLight makes HTTP GET calls to the URL specified during the configuration.

To configure the WPLight simple connect the device to the power and it will pulse, open your smartphone and find it in the available wifi networks. Connect to it to configure.

As you can see in this schema the WPLight calls a web server (WordPress or not) to receive back a command (“light on“). If you’re using WordPress you can install our WordPress IoT plugin to handle WPLight calls and answer properly.

By reading this article you will understand how the answers to the calls are built, and so you will be able to make the WPLight talk with every CMS or external service, like IFTTT.

The WPLight GET calls bring also this three parameters:

  1. action = dolight (to hook the plugin)
  2. chip = xxxxxxx the number of your WPLight ID
  3. pons = xxxx a random number to make every call a new call

So the calls are like this:

GET /?action=dolight&pons=2215&chip=1662353 HTTP/1.1

The answers must be in plain text with just a 3 parameters command string like this: {1,D,30} which contains, in this exact order, these data:

  1. number = an integer value
  2. mode = “C” for alert, “D” for on/off, “E” for event monitor
  3. timer = the number of seconds after which it will make another call (minimun value 5)

So if you want to communicate with the light you should configure the light to reach your url and you have to answer with a properly formatted command string.

If the GET call fails the light is turned off and the WPLight will wait 120 seconds before calling again.

You can’t make the WPLight call faster then once every 5 seconds.

Here there are the three lighting modes described in detail:

Alert mode

In the alert mode the light blinks and the number represents the speed of the blinking. From 1 slow (the light turns on for 2 seconds) to 10 very fast (the light is ononly for 100 msec).



The WPLight blinks slowely for 30 seconds then it calls back the WordPress plugin to check for a new command.


The WPLight blinks quite fastly for 120 seconds then it calls back the WordPress plugin to check for a new command.

On/Off mode

In the on/off mode the light turns on or off based on the number: 0 turns it off, 1 or grater turns it on.



The WPLight is turned off and after 30 seconds a new call is made to the WordPress plugin to check for a new command (if it is still the same it will remain off).


The WPLight is turned on and after 10 seconds a new call is made to check for a new command.

Event monitor mode

In the event monitor mode the WPLight makes the number of blinks specified distributing them randomly in the timer period. This is good for activity monitors which have to show some value to let you understand that something is happening.

The narrow is the period the best is precision.

If the number of event to show is small, blinks will be slow (2 seconds long).

If the number of events to show is too big, blinks will be very fast (100 msec).



The WPLight performs 23 blinks randomly distributed in 120 seconds.

For this example suppose you want to show the traffic on your site. You can count the pageviews, that is to say that every time you have a pageview you add 1 to your counter. When the WPLight call comes you answer with the counter and then reset it.