MQTT RGB light error

I’ve built my own wifi/MQTT lights using an esp8266-12e and some neopixels. I used this library: Melvanimate

Can someone help me, I’m getting this error in the logs. I think I just need to set a template to massage the data how HASS wants it.

16-05-06 08:48:34 homeassistant.core: Bus:Handling <Event mqtt_message_received[L]: payload=SimpleColor, qos=0, topic=MQTT-LIGHT-1/effect>
16-05-06 08:48:35 homeassistant.core: Bus:Handling <Event mqtt_message_received[L]: payload=169, qos=0, topic=MQTT-LIGHT-1/brightness>
16-05-06 08:48:36 homeassistant.core: Bus:Handling <Event mqtt_message_received[L]: payload=[93,255,247], qos=0, topic=MQTT-LIGHT-1/color1>
16-05-06 08:48:36 homeassistant.core: BusHandler:Exception doing job
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/core.py", line 801, in job_handler
    func(arg)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/mqtt/__init__.py", line 160, in mqtt_topic_subscriber
    event.data[ATTR_QOS])
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/light/mqtt.py", line 149, in rgb_received
    templates['rgb'](payload).split(',')]
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/light/mqtt.py", line 148, in <listcomp>
    self._rgb = [int(val) for val in
ValueError: invalid literal for int() with base 10: '[93'
16-05-06 08:48:37 homeassistant.core: Bus:Handling <Event mqtt_message_received[L]: payload=SimpleColor, qos=0, topic=MQTT-LIGHT-1/effect>
16-05-06 08:48:38 homeassistant.core: Bus:Handling <Event mqtt_message_received[L]: payload=SimpleColor, qos=0, topic=MQTT-LIGHT-1/effect>
16-05-06 08:48:39 homeassistant.core: Bus:Handling <Event mqtt_message_received[L]: payload=[16,50,255], qos=0, topic=MQTT-LIGHT-1/color1>
16-05-06 08:48:39 homeassistant.core: BusHandler:Exception doing job
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/core.py", line 801, in job_handler
    func(arg)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/mqtt/__init__.py", line 160, in mqtt_topic_subscriber
    event.data[ATTR_QOS])
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/light/mqtt.py", line 149, in rgb_received
    templates['rgb'](payload).split(',')]
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/light/mqtt.py", line 148, in <listcomp>
    self._rgb = [int(val) for val in
ValueError: invalid literal for int() with base 10: '[16'
16-05-06 08:48:40 homeassistant.core: Bus:Handling <Event mqtt_message_received[L]: payload=[16,50,255], qos=0, topic=MQTT-LIGHT-1/color1>
16-05-06 08:48:40 homeassistant.core: BusHandler:Exception doing job
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/core.py", line 801, in job_handler
    func(arg)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/mqtt/__init__.py", line 160, in mqtt_topic_subscriber
    event.data[ATTR_QOS])
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/light/mqtt.py", line 149, in rgb_received
    templates['rgb'](payload).split(',')]
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/light/mqtt.py", line 148, in <listcomp>
    self._rgb = [int(val) for val in
ValueError: invalid literal for int() with base 10: '[16'

There’s a list comprehension here: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/light/mqtt.py#L148 which attempts to make a list of integer values, notice the int(val). The problem is that the val is ‘[16’ which cannot be converted to integer. You probably have to do some debugging and see why val is taking that value. I’d probably add some print statements and see what is in templates[‘rgb’] in the first place, then check payload and so on.

I know this is an old topic, I was wondering if you had any more luck with MQTT, esp8266 and some ws2812B (neopixels). I am curious about making something like this with some NodeMCU’s but I am a programing fool!
Thanks!

Are you still looking for this? Because I have done it.

Definitely still interested!