Configure Shelly RGBW2 in Newest Home Assistant

I’m installing several Shelly RGBW2 devices to control LED light strips. I found this MQTT configuration at GitHub - thehookup/Shelly-RGBW2: A repository for Shelly RGBW2 control in Home Assistant via MQTT :

light:
  - platform: mqtt
    schema: template
    name: "LEDstrip MQTT"
    command_topic: "shellies/shellyrgbw2-2B9022/color/0/set"
    state_topic: "shellies/shellyrgbw2-2B9022/color/0/status"
    effect_list:
      - 0
      - 1
      - 2
      - 3
      - 4
      - 5
      - 6
    command_on_template: >
      {"turn": "on"
      {%- if brightness is defined -%}
      , "gain": {{brightness | float | multiply(0.3922) | round(0)}}
      {%- endif -%}
      {%- if red is defined and green is defined and blue is defined -%}
      , "red": {{ red }}, "green": {{ green }}, "blue": {{ blue }}
      {%- endif -%}
      {%- if white_value is defined -%}
      , "white": {{ white_value }}
      {%- endif -%}
      {%- if effect is defined -%}
      , "effect": {{ effect }}
      {%- endif -%}
      }
    command_off_template: '{"turn":"off"}'
    state_template: "{% if value_json.ison %}on{% else %}off{% endif %}"
    brightness_template: "{{ value_json.gain | float | multiply(2.55) | round(0) }}"
    red_template: '{{ value_json.red }}'
    green_template: '{{ value_json.green }}'
    blue_template: '{{ value_json.blue }}'
    white_value_template: '{{ value_json.white }}'
    effect_template: '{{ value_json.effect }}'
    qos: 2

But since that was posted more than a year and a half ago, is is still relevant to the newest version of Home Assistant? If so, where do I go to paste it in? If not, where do I go and what do I put in?

There is now a native Shelly integration available, so no need for MQTT. I have integrated a Shelly RGBW2 this way without any problems.

Do you have control over the RGB or White levels? Using the Shelly integration all I can control is on-off.

I have connected a white LED strip to one of the 4 channels. Each channel is exposed as a light entity and I can turn each channel on/off and can dim the LED strip.

I am running Home Assistant 2020.12.1. My Shelly RGBW2 is on firmware version 1.9.0, and I have connected a simple 12V SMD5050 based LED strip.

Shelly Integration easy to start with but it’s stil pretty new/unfinished and is no as flexible as mqtt.

Mqtt is most reliable sollution and actually the best choice architecture wise.
However using mqtt requires a bit of knowledge. Not deep though.
At first you have to have running mqtt broker. There is mosquito broker available in HA extentions

Then the configuration you postet must be added to configuration.yaml or to files this configuration refers to be included.

After adding the first mqtt device you need to restart HA. in case of next once it’s enough to chose Reload mqtt entities from configuration.
Note, after either one, you need to send request to all shelly devices to reannounce their selfs

It’s all sounds tricky but at the end brings a lot if benefits. Mainly because if something doesn’t work, it’s your fault which you can fix on your own. Which is not true in case of integrations which often are limited feature-wise or contain bugs

2 Likes

Thank you. I ended up removing the Shelly integration and going with MQTT. I now have complete control over my color RGBW2s. :+1:t3:

Hello.
I just connected a Shelly RGBW2 to home assitant with the shelly integration and it has been discovered properly.
Did you put something in the configuration or you simply added to lovelace? Which card did you used?

As you, I found a lot of old guides.

Thanks a lot

The automatic Shelly integration didn’t see them as RGB devices, so none of the cards would give me control over the RGB channels. That’s why I removed the Shelly integration and went with MQTT instead.

But the shelly integration is not based on MQTT?
I was supposing this…
Can give me a couple of hints on how you did it?
Thanks a lot

Using a web browser, log into each RGBW2 device using it’s assigned IP address (you can usually find that in your router’s “devices” page.)

Tap “Internet Security” > Advanced - Developer Settings > Enable action execution via MQTT

Thanks…
I was more interested to the configuration of the entity.
I will try the one you pointed at the start of this post

Yep. That’s it. :+1:t3:

Sorry, do you control this light with google assistant?
If yes, how do you control the W channel?

I don’t use Google for anything. I use Siri for on/off and dim percentage, but I don’t change color often so I just go that through the HA panel.

I just installed homeassistant and I am not able to include my shelly rgbw2 even with mqtt.
Mqtt is working proberly because I already use a sonoff plug with it.

edit: mqtt uses case sensitive. I needed to write my topic in capital letters. Now it works

Hi
Same question here :wink:
Did you used the config example in the starting post to set up the mqtt-entities for the rgbw2 shellies?

Same issue here no native support of rgb so will probably switch to mqtt which is anyway the better privacy choice

I’m connected with MQTT, everything works, but what’s the story with effects? Where are they defined and can they be edited?

btw, dead link in the OP because it includes the colon: Should be https://github.com/thehookup/Shelly-RGBW2

1 Like

Hi
I integrated until now every Shelly with the Shelly Integration. But with the RGBW2 I don’t get all entities. See here: Shelly integration - only 4 (useless) entities
Now I’m trying with MQTT and it looks like everything is working fine.

But I come to the same question as Richard:
Is it possible to give names to the effect_list? It is not very nice to choose from the number 0 - 6

And I don’t see a difference between 2, 4, 5 and 6.
Official the RGBW2 have these effects (in Web Browser only 0-3, tested with V1.9 and V1.10.3):
0 - Off
1 - Meteor shower
2 - Gradual change
3 - Flash
4 - Red/green change
Source: Supported values for effect

Thanks, Richard! I put a space before that colon. The link works now.