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?
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.
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
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?
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.
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
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