I’m using a Shelly RGBW2 to control some RGBW LED strips. My goal is to use the scene.create service to take a snapshot and store the current settings of the controller to be called back later on after an automation occurs (in node-red if that matters).
The problem is that attributes for RGB + White Value + others disappear when the light is off.
Attributes when light is ‘on’
Attributes when light is ‘off’
When I create a scene and the light is off, it cannot capture all of the settings since the attributes are not there. It works perfectly fine as long as the lights are on when the automation starts.
Is there any way to keep these attributes visible when the state is off? The controller reports these values when the light is off, but Home Assistant seems to discard them.
Here is my configuration.yaml entry for the controller:
light:
- platform: mqtt
schema: template
name: "LED Strip"
command_topic: "home/kitchen/cabinet_lights/top/cmd"
state_topic: "shellies/shellyrgbw2-6F36E7/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: 0