I have the following action on an automation:
action:
- data:
brightness_pct: 20
color_name: red
entity_id: light.nursery_light
service: light.turn_on
Which when the automation runs causes the light in question to turn on at 100% brightness for a split second before dimming to 20%.
I can see the two MQTT messages in the Tasmota console:
23:27:49 MQT: stat/nurseryStripRGB/RESULT = {“POWER”:“ON”,“Dimmer”:100,“Color”:“FF0000”,“HSBColor”:“0,100,100”,“Channel”:[100,0,0]}
23:27:49 MQT: stat/nurseryStripRGB/RESULT = {“POWER”:“ON”,“Dimmer”:20,“Color”:“330000”,“HSBColor”:“0,100,20”,“Channel”:[20,0,0]}
23:27:49 MQT: stat/nurseryStripRGB/RESULT = {“POWER”:“ON”}
23:27:49 MQT: stat/nurseryStripRGB/POWER = ON (retained)
This is only for a split second, but it results in a very annoying flash in a dark room. It also seems odd that the colour changes, but that is probably irrelevant.
My configuration for the device is the following:
- platform: mqtt name: "Nursery Light" state_topic: "stat/nurseryStripRGB/RESULT" command_topic: "cmnd/nurseryStripRGB/POWER" state_value_template: "{{ value_json.POWER }}" brightness_state_topic: "stat/nurseryStripRGB/RESULT" brightness_command_topic: "cmnd/nurseryStripRGB/Dimmer" brightness_scale: 100 brightness_value_template: "{{ value_json.Dimmer }}" rgb_command_topic: "cmnd/nurseryStripRGB/Color" rgb_command_template: "{{ '%02x%02x%02x' | format(red, green, blue)}}" rgb_state_topic: "stat/nurseryStripRGB/RESULT" rgb_value_template: "{{(value_json.Channel[0]*2.55)|int}},{{(value_json.Channel[1]*2.55)|int}},{{(value_json.Channel[2]*2.55)|int}}" effect_state_topic: "stat/nurseryStripRGB/RESULT" effect_command_topic: "cmnd/nurseryStripRGB/Scheme" effect_list: - 0 - 1 - 2 - 3 - 4 retain: false qos: 1 payload_on: "ON" payload_off: "OFF"
Anyone any ideas what I am doing wrong?