I used the same code as above. Here’s what’s in the mqtt.yaml
light:
- name: "Lounge LEDs"
unique_id: lounge-leds
retain: false
qos: 1
# Online
availability_topic: "shellies/shellyrgbw2-E747F2/online"
payload_available: "true"
payload_not_available: "false"
# ON/OFF
command_topic: "shellies/shellyrgbw2-E747F2/color/0/command"
state_topic: "shellies/shellyrgbw2-E747F2/color/0"
payload_on: >-
on
payload_off: >-
off
# RGBW
rgbw_command_topic: "shellies/shellyrgbw2-E747F2/color/0/set"
rgbw_command_template: >
{
"red": {{ red }},
"green": {{ green }},
"blue": {{ blue }},
"white": {{ white }}
}
rgbw_state_topic: "shellies/shellyrgbw2-E747F2/color/0/status"
rgbw_value_template: "{{value_json.red}},{{value_json.green}},{{value_json.blue}},{{value_json.white}}"
# BRIGHTNESS
brightness_command_topic: "shellies/shellyrgbw2-E747F2/color/0/set"
brightness_command_template: >
{
"gain": {{ value | float | multiply(0.3922) | round(0) }}
}
brightness_state_topic: "shellies/shellyrgbw2-E747F2/color/0/status"
brightness_value_template: "{{ value_json.gain | float | multiply(2.55) | round(0) }}"
# EFFECTS
effect_command_topic: "shellies/shellyrgbw2-E747F2/color/0/set"
effect_command_template: >
{
{% if value == "Off" %}
"effect": "0"
{% elif value == "Meteor Shower" %}
"effect": "1"
{% elif value == "Gradual Change" %}
"effect": "2"
{% elif value == "Flash" %}
"effect": "3"
{% endif %}
}
effect_state_topic: "shellies/shellyrgbw2-E747F2/color/0/status"
effect_value_template: >-
{% if value_json.effect == 0 %}
Off
{% elif value_json.effect == 1 %}
Meteor Shower
{% elif value_json.effect == 2 %}
Gradual Change
{% elif value_json.effect == 3 %}
Flash
{% endif %}
effect_list:
- "Off"
- "Meteor Shower"
- "Gradual Change"
- "Flash"
And this is the output from the MQTT Explorer