Problems with node contrib-shelly

Hi,

i try to access a Shelly Plus RGBW PM via node-red-contrib-shelly.

The connection between the node and the shelly is working. And if i sent a message to the node, i got feedback from the shelly - like wifi state, colour settings, and a lot more.

But i´m not able to control the shelly via the node No matter what i try or if i use the examples flows.

The goal is to control the colour and brightness of the LED - but i got no idea how to the setup the message in the correct way.

Could anybody show me the correct way please?

Hi @gerribaldi,
is it a gen2+ RGBW like this one: Shelly Plus RGBW PM | Shelly Knowledge Base

Does the example rgbwpmplus.json not work for you?

You can modify the sample and use RGB.Set with its properties described here

Hi @gerribaldi ,

As @windkh also already said, you have to provide a little bit more information as you have done so far.
Important information is the following:

  1. Is it a Gen 1 or a Gen 2+ (Gen 2, Gen 3 or Gen 4) device?
  2. Which Node do you (want to) use? The local node or the cloud node.
  3. Or do you want to communicate with MQTT?

Regards

Sorry guys, i thought to provide the type of shelly is fine.

So here some more infos:

I use the node shelly gen 2+ without cloud. The shelly have only a connection to my wifi und my local mqtt broker.

I can access the shelly directly via mqtt and via

msg.payload = set,true,100,999,77,88,99,5,250

i´m able to control the shelly. But this is not realy comfortable :slight_smile:

@windkh
I use for all my test the nodes rgbw2* and not the which you are mentioned. :roll_eyes:
So after using the right node i can control the shelly via the example node. :+1:

Which will be the easiest way to access or change for example the rgb values?

In the example flow there should be a switch function. You can modify the payload: instead of Switch.Set you can use RGB.Set with the properties described here

I find that using NR core modules to be easier than the node-red-contrib-shelly. BUT, you do have to craft the messages yourself. I use this on a RGBW Gen 1 to control my lights for different 'levels' of lighting. This in a Function node...

switch (msg.payload) {
  case 1:
  msg.payload = {"turn": "off"};
    break;
  case 2:
    msg.payload = {"mode": "color", "red": 255, "green": 255, "blue": 255, "white": 100, "gain": 100, "effect": 0, "transition": 0, "turn": "on" };
    break;
  case 4:
    msg.payload = {"mode": "color", "red": 255, "green": 255, "blue": 255, "white": 100, "gain": 80, "effect": 0, "transition": 0, "turn": "on" };
    break;
  case 8:
    msg.payload = { "mode": "color", "red": 255, "green": 255, "blue": 255, "white": 100, "gain": 50, "effect": 0, "transition": 0, "turn": "on" };
    break;
  case 16:
    msg.payload = {"mode": "color", "red": 252, "green": 173, "blue": 25, "white": 100, "gain": 100, "effect": 0, "transition": 0, "turn": "on" };
    break;
  case 32:
    msg.payload = {"mode": "color", "red": 252, "green": 173, "blue": 25, "white": 20, "gain": 40, "effect": 0, "transition": 0, "turn": "on" };
    break;
  case 64:
    msg.payload = {"mode": "color", "red": 252, "green": 173, "blue": 25, "white": 20, "gain": 100, "effect": 0, "transition": 0, "turn": "on" };
    break;
  default:
    msg.payload = 1024
}

msg.topic = "shellies/Living_Room/color/0/set";
return msg;

Should have added, the output is to MQTT Output Node! Apologies.