Hi everyone - I’ve recently purchased and flashed tasmota onto an LED light strip.
Everything is up and running as expected, however there is one slight UI detail I haven’t been able to figure out.
How do I convert the ‘Scheme’ from numbers to something more human-readable. I’ve been playing around with the effect_value_template
in the config but haven’t had any luck. (Simply changing the yaml config from numbers to strings changes it in the UI but makes it so the light doesn’t respond to any selections).
This is how it currently looks in the UI:
This is my yaml config
- platform: mqtt
name: TV LED
availability_topic: "tele/TVLED/LWT"
command_topic: "cmnd/TVLED/POWER1"
state_topic: "stat/TVLED/RESULT"
state_value_template: "{{value_json.POWER}}"
brightness_command_topic: "cmnd/TVLED/Dimmer"
brightness_state_topic: "stat/TVLED/RESULT"
brightness_value_template: "{{value_json.Dimmer}}"
brightness_scale: 100
rgb_command_topic: "cmnd/TVLED/Color2"
rgb_state_topic: "stat/TVLED/RESULT"
# RGB<->RGBWW conversion
rgb_value_template: >-
{% set red = (value_json.Color.split(',')[0] | round(0)) %}
{% set green = (value_json.Color.split(',')[1] | round(0)) %}
{% set blue = (value_json.Color.split(',')[2] | round(0)) %}
{% set white = (value_json.Color.split(',')[3] | round(0)) %}
{{ red + white }},{{ green + white }},{{ blue + white }}
rgb_command_template: >-
{% if red==green and red==blue %}
0,0,0,{{ red }}
{% else %}
{{ red }},{{ green }},{{ blue }},0
{% endif %}
effect_command_topic: "cmnd/TVLED/Scheme"
effect_state_topic: "tele/TVLED/STATE"
effect_value_template: "{{value_json.Scheme}}"
effect_list:
- 0
- 1
- 2
- 3
- 4
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
qos: 1
retain: true
Thank you in advance!!