hue

Simply put, the Philips Hue is the most exciting lightbulb you have ever owned. That may not sound like that big a deal, but it is. These lightbulbs give you the ability to change their color at any time,

wirelessly, through the internet. So you can turn off your lights from half way around the globe, or have the lights mimic the colors on your TV to create a richer viewing experience, or have the lights change

in sync with an online music radio station. Possibilities are many. And it’s just the beginning. With exciting projects like the Spark Core, the internet of things is in it’s infancy.

Introduction

Before getting in to any details, it is important to address the viability of the value proposition for this mashup. I am assuming that everyone can distinguish red, from green, from blue, etc. This, of course, is not true. As many as 8 percent of men and 0.5 percent of women are color blind. While it is possible to make some tweaks to the approach and accommodate the color blind, I will forgo that discussion for now, and focus on the core topic.

Color Psychology is the study of color as a determinant of human behavior. A myriad of scientific papers have been written on this subject. Colored lighting has the power to alter an individuals perception of the people and objects around them. In 2000, Glasgow installed blue street lights in certain areas, observing a drop in crime. Marketers also use this tool when developing brand messaging, utilizing red to imply love, blue to create a perception of quality, and white for purity.

While many have observed that different colors of light have an undeniable effect on people, it has also been proven that the way in which people react to different colors varies significantly based on country, religion, financial status, gender, and other factors. Thus, conditioning plays a major role in color psychology. This means that when building an enterprise BPM solution that takes advantage of colored light as a stimuli, generalities of color perception should be good enough. If there are differences that make people interpret colors inconsistently, either the people will adapt over time or small tweaks can be made to the colors used in the solution.

Process

The proposed solution in this experiment utilizes task execution history along with key business data, in order to provide performance feedback to call center sales reps, using Hue lightbulbs. The hypothesis is that sales will improve due to the passive, yet persistent performance feedback.

Lightbulb reporting

The setup is a call center where 114 sales reps sit in tables (teams) of 6. The reps have a low hourly wage but receive two commissions. One commission is based on how much they sell in a give day and the second is based on how much their team sells. The team based setup is valuable from both a psychologic standpoint as well as a tactical one. Psychologically the sales reps are motivated dully; externally they have a desire to outdo their peers at other tables and internally they don’t want to fail their team mates. More tactically, the reps are responsible for selling from a large catalog of goods; some sales scenarios require involving others to help.
process_nonretina

BPM is used to manage the end-to-end process, from making the call all the way through soliciting feedback from customers, once they receive the order. A simplified process definition can be found above.

… a sales rep needs to actively engage in finding out their performance in relation to their peers. It’s analogous to continuously checking a clock to see if it’s 6am, instead of just setting an alarm and waking up when it goes off.

Traditionally, aggregate performance in similar scenarios is communicated back to the sales reps either through dashboards on their computer screens or in weekly/monthly reports. Due to the popularization of gameification, another common way of communicating performance is becoming a leader dashboard, displayed on a large TV around the break area, restrooms, or entrance to the work place. Although these approaches are effective, their main fault is that a sales rep needs to actively engage in finding out their performance in relation to their peers. It’s analogous to continuously checking a clock to see if it’s 6am, instead of just setting an alarm and waking up when it goes off.

Still, optimal performance in this scenario can’t simply be archived through a series of alarms based on individuals sales. There is an opportunity to create a much more dynamic environment where passive feedback to the sales reps can reverse declining sales trends, before anyone actually realizes they are declining.

call_center

The proposed setup is to install Hue lightbulbs directly above each sales rep. These would not replace the standard office lighting, but would be installed along side it. If lit up with a white color, the Hue bulbs should be completely unnoticeable. When lit up with any other color, it should not overpower the surroundings, but simply create a visible difference in coloration.

At any point in time, the color of light above each individual would be a reflection of their performance, calculated by comparing their sales numbers to others on their team, and then to other teams. Since the Hue can generate 16 million colors, no two individuals should have the same color. The exact range of colors and their meaning would need to be determined locally, wherever this solution is to be implemented through a sample study.

Looking across the office space, each sales rep will be able to see which teams are selling more and which of their team mates may not be pulling their weight. At first, this is bound to cause some confusion, but over time reps will get conditioned to the meaning of the lights and subconsciously begin to make deductions based on their environment.

 

Technology

Philips Hue API

Fortunately, the Hue API is one of the simplest APIs you’ll ever worked with. Philips has made it very easy for developers to get started. Once the lightbulbs and the Hue Hub are installed, all you need to do is go here: http://www.meethue.com/api/nupnp, to get the ip address of the hue hub. Knowing that ip, you can then access the API testing utility here: http:///debug/clip.html. The API exposes all the functionality of the device. You can find the full documentation here: http://developers.meethue.com/index.html

Architecture

For this experiment, I will use IBM BPM. There are two options we can explore when integrating IBM BPM with Philips Hue.
architecture

Option 1 is to have BPM call the Hue Hub API directly. This is suitable for scenarios where a Hue bulb needs to change based on task progression within a given process. At any give time a single bulb should be associated with a single BPM Instance. I will use this approach for the sample implementation in this article.

Option 2 is to have a Reporting Server pull data from BPM, aggregate it, and then call the Hue Hub API. This approach is better for scenarios where the Hue bulb changes based on a combination of historical task execution and business data. This is the approach to take when implementing the call center scenario from earlier in the article.

Sample Implementation

As mentioned in the previous section, a direct integration will be outlined in this section. IBM BPM will call the Philips Hue REST API directly from the process implementation. The process definition for this sample looks like this:

simple_implement

A human task starts the instance by turning on the Hue lightbulb. Once the first task is complete, a random color is assigned to the lightbulb, and the process waits for 0.1 minutes. This is repeated 20 times.

Both the REST call to turn on the lightbulb as well as the call to assign it a specific color are HTTP PUTs. We’ll use the following function to make those calls. The implementation for this Java Script method will reside in a managed server file, allowing all Server Script artifacts to call it.

function postRestCall(url, body) {
	var client = new Packages.org.apache.commons.httpclient.HttpClient();
	var op = new Packages.org.apache.commons.httpclient.methods.PutMethod(url);
	op.setRequestHeader("Content-Type", "application/json");
	op.setRequestEntity(new Packages.org.apache.commons.httpclient.methods.StringRequestEntity(body, "application/json", null));
	try {
		var statusCode = client.executeMethod(op);
	} finally {
		op.releaseConnection();
	}
}

The implementation for the “Turn On Hue” activity will consist of a single Server Script, which will be executed when the task is run. The hueIP and hueUser environmental variables will be the ip address of the Hue Hub and the username for controlling the color, respectively.

var url = 'http://'+tw.env.hueIP+'/api/'+tw.env.hueUser+'/lights/4/state';
var body = '{"on":true}';
postRestCall(url, body);

The implementation for the Change Color activity will also consist of a single Server Script. For the purpose of this example all values are being assigned at random.

var ct = Math.floor((Math.random()*1000));
var cieX = (Math.random()*1).toFixed(2);
var cieY = (Math.random()*1).toFixed(2);

var url = 'http://'+tw.env.hueIP+'/api/'+tw.env.hueUser+'/lights/4/state';
var body = '{"on":true,"xy":['+cieX+','+cieY+'], "ct":'+ct+'}';

Although quick, my approach of assigning a random color through this mechanism is a bastardization of the rich API that Philips provides for assigning the light bulb any of the 16 million possible colors. The variables for controlling color are:

  • bri – Brightness of the light. A value between 0 and 255
  • hue – Hue of the light. A wrapping value between 0 to 65535
  • sat – Saturation of the light. A value between 0 to 255
  • xy – x and y coordinates of a color in CIE color space. This is always an array of length 2, where each value is between 0 and 1.
  • ctMixed color temperature of the light.

Check out the complete Color API for all the possible parameters and how to use them. Here is a clip of what this looks like at run time.

Conclusion

BPM enables businesses to transform processes through optimizations, automation, and integration. System integration has always been a heavy focus for BPM vendors, thus BPM is able to integrate with any legacy system an organization may have in-house. Now the focus is shifting towards improving the “Human Integration”. People can get to their tasks through progressively better mobile UIs, as opposed to having to use the desktop for everything. BPM can also get to people in new ways, such as push notifications in native mobile-bpm apps. Incorporating environmental lighting as part of a BPM solution is simply another step in the same direction.

    Leave a Reply