<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[S_RGB_LIGHT]]></title><description><![CDATA[<p dir="auto">Using the code below I seem to be having trouble getting the control to show in the UI. When I include the device only the arduino node shows up.<br />
Where have I gone wrong?</p>
<pre><code> /*
https://forum.mysensors.org/topic/7456/ws2812b-information-leds-blinking
https://www.domoticz.com/forum/viewtopic.php?t=8039
*/
// Enable debug prints
#define MY_DEBUG

// Enable and select radio type attached
#define MY_RADIO_NRF24
//#define MY_RADIO_RFM69

// Set LOW transmit power level as default, if you have an amplified NRF-module and
// power your radio separately with a good regulator you can turn up PA level.

/**
 * @def MY_RF24_PA_LEVEL
 * @brief Default RF24 PA level. Override in sketch if needed.
 *
 * - RF24_PA_MIN = -18dBm
 * - RF24_PA_LOW = -12dBm
 * - RF24_PA_HIGH = -6dBm
 * - RF24_PA_MAX = 0dBm
 */
#define MY_RF24_PA_LEVEL RF24_PA_LOW

// ENABLE REPEATER MODE
//#define MY_REPEATER_FEATURE

// ENABLE LOOP EVEN IF RADIO FAILS.
#define MY_TRANSPORT_WAIT_READY_MS 15000

#include &lt;MySensors.h&gt;
#include &lt;SPI.h&gt;
#include &lt;FastLED.h&gt;


const int stripPin = 4 ;                  // pin where 2812 LED strip is connected

const int numPixel = 3 ;                  // set to number of pixels


CRGB leds[numPixel];

char actRGBvalue[] = "000000";               // Current RGB value
uint16_t actRGBbrightness = 0xFF ;         // Controller Brightness 
int actRGBonoff=0;                        // OnOff flag

#define CHILD_ID 0




MyMessage lastColorStatusMsg(CHILD_ID,V_VAR1);

void setup() {
  FastLED.addLeds&lt;NEOPIXEL, stripPin &gt;(leds, numPixel); // initialize led strip
  
  // Flash the "hello" color sequence: R, G, B, black. 
  colorBars();


}


void presentation()
{

 //begin(incomingMessage, NODE_ID, false);      // initialize MySensors
 sendSketchInfo("AWI RGB Light", "1.1");
 present(CHILD_ID, S_RGB_LIGHT, "RGB Strip");        // present to controller

  //Request the last stored colors settings
  request(CHILD_ID, V_VAR1);


}




void loop() {

  
  //gw.process();                       // wait for incoming messages


}

void colorBars()
{
  SendColor2AllLEDs( CRGB::Red );   FastLED.show(); delay(500);
  SendColor2AllLEDs( CRGB::Green ); FastLED.show(); delay(500);
  SendColor2AllLEDs( CRGB::Blue );  FastLED.show(); delay(500);
  SendColor2AllLEDs( CRGB::Black ); FastLED.show(); delay(500);
} 

void SendColor2AllLEDs(const CRGB lcolor)
{
  for(int i = 0 ; i &lt; numPixel ; i++) {
    leds[i] = lcolor;
  }
}

void SendLastColorStatus()
{
  String cStatus=actRGBvalue+String("&amp;")+String(actRGBbrightness)+String("&amp;")+String(actRGBonoff);
  send(lastColorStatusMsg.set(cStatus.c_str()));
}

String getValue(String data, char separator, int index)
{
 int found = 0;
  int strIndex[] = {0, -1};
  int maxIndex = data.length()-1;
  for(int i=0; i&lt;=maxIndex &amp;&amp; found&lt;=index; i++){
  if(data.charAt(i)==separator || i==maxIndex){
  found++;
  strIndex[0] = strIndex[1]+1;
  strIndex[1] = (i == maxIndex) ? i+1 : i;
  }
 }
  return found&gt;index ? data.substring(strIndex[0], strIndex[1]) : "";
}


// ############################ INCOMING MESSAGE ###########################
void incomingMessage(const MyMessage &amp;message) {
  if (message.type == V_RGB) {            // check for RGB type
    actRGBonoff=1;
    strcpy(actRGBvalue, message.getString());    // get the payload
    SendColor2AllLEDs(strtol(actRGBvalue, NULL, 16));
    SendLastColorStatus();
  }
  else if (message.type == V_DIMMER) {           // if DIMMER type, adjust brightness
    actRGBonoff=1;
    actRGBbrightness = map(message.getLong(), 0, 100, 0, 255);
    FastLED.setBrightness( actRGBbrightness );
    SendLastColorStatus();
  }
  else if (message.type == V_STATUS) {           // if on/off type, toggle brightness
    actRGBonoff = message.getInt();
    FastLED.setBrightness((actRGBonoff == 1)?actRGBbrightness:0);
    SendLastColorStatus();
  }
  else if (message.type==V_VAR1) {            // color status
    String szMessage=message.getString();
    strcpy(actRGBvalue, getValue(szMessage,'&amp;',0).c_str());
    actRGBbrightness=atoi(getValue(szMessage,'&amp;',1).c_str());
    actRGBonoff=atoi(getValue(szMessage,'&amp;',2).c_str());
    SendColor2AllLEDs(strtol(actRGBvalue, NULL, 16));
    FastLED.setBrightness((actRGBonoff == 1)?actRGBbrightness:0);
  }
  FastLED.show();
}```</code></pre>
]]></description><link>https://forum.mysensors.org/topic/9310/s_rgb_light</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Jul 2026 16:30:46 GMT</lastBuildDate><atom:link href="https://forum.mysensors.org/topic/9310.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 30 Apr 2018 19:26:06 GMT</pubDate><ttl>60</ttl></channel></rss>