onWriteRequest: function(data, offset, withoutResponse, callback) { console.log('We got: ' + data); // THIS BIT HERE is where we get data if (data == 'red') { // Turn on the red light } else if (data == 'green') { // Turn on the green... } callback(Characteristic.RESULT_SUCCESS); }