MQTT topic issue sk6812-ws2812FX

Hi all,

I am trying to add some nice sk6812 leds to my configuration with:

but i am having issues…

It only works in HA when i set the both the state_topic and command_topic the same:
configuration.yaml

  - platform: mqtt_json
    name: bookshelves_leds
    state_topic: "bookshelves/leds/set"
    command_topic: "bookshelves/leds/set"

When i set the state_topic to “bookshelves/leds” en reboot i cant turn the leds on. I also get an error in ha log:

Log Details (ERROR)
Thu Jul 12 2018 14:24:12 GMT+0200 (Central European Summer Time)

Error doing job: Exception in callback MQTT._mqtt_handle_message(<paho.mqtt.cl...at 0x663a5230>)
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/events.py", line 126, in _run
    self._callback(*self._args)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/mqtt/__init__.py", line 679, in _mqtt_handle_message
    msg.topic, payload, msg.qos)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py", line 267, in async_run_job
    target(*args)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/light/mqtt_json.py", line 188, in state_received
    if values['state'] == 'ON':
KeyError: 'state'

Dont know what’s going wrong here… anyone an idea?

This would seem to imply that the state message being sent from your device does not contain a state element.

The best way to check what is in the message is to subscribe to the topic using another client that prints out the payload, such as mosquitto_sub - see

I don’t get status updates indeed. So i guess there’s something in the code.

Alright, i nailed it.

in PubSubClient.h i changed MQTT_MAX_PACKET_SIZE to 512 and it works!

Now i wonder how to get some transitions in the payload…

Can anyone help me with this?