Problem configuring esphome mqtt for fastled_clockless

Hi guys,

I’m trying to configure the yaml for my D1-Mini with a WS2812B strip connected.
First I configured the yaml to use homeassistant API and MQTT.

Using the API works out of the box… but I’m having trouble configuring MQTT - or at least to control the device via MQTT.

But my goal is to get MQTT working to make the device HA independent!

my yaml seems to be working so far but I can’t get the command channel working.

this is my code:

esphome:
  name: mellowbucket
  
esp8266:
  board: d1_mini
  framework:
    version: 2.7.4

status_led:
  pin:
    number: D0
    inverted: True

text_sensor:
  - platform: wifi_info
    ip_address:
      name: "Mellowbucket IP"
    ssid:
      name: "Mellowbucket SSID"
    bssid:
      name: "Mellowbucket BSSID"

light:
  - platform: fastled_clockless
    chipset: WS2812B
    pin: D4
    num_leds: 36
    rgb_order: GRB
    name: "MellowBucket"
    
  # Optional variables:
    retain: false
    discovery: true
    availability:
      topic: mellowbucket/online
      payload_available: online
      payload_not_available: offline
    state_topic: mellowbucket/state
    command_topic: mellowbucket/command
    restore_mode: RESTORE_DEFAULT_ON

    effects:
      - addressable_rainbow:
          name: Rainbow
          speed: 10
          width: 36

      - addressable_color_wipe:
          
      - addressable_scan:
          name: Scan
          move_interval: 150ms
          scan_width: 4
          
      - addressable_twinkle:
          name: Twinkle
          twinkle_probability: 12%
          progress_interval: 15ms
          
      - addressable_random_twinkle:
          name: Random Twinkle
          twinkle_probability: 5%
          progress_interval: 80ms
          
      - addressable_fireworks:
          name: Fireworks
          update_interval: 32ms
          spark_probability: 20%
          use_random_color: true
          fade_out_rate: 120
          
      - addressable_flicker:
          name: Flicker
          update_interval: 16ms
          intensity: 55%
                  
wifi:
  ssid: "MYSSID"
  password: "xxxxxxxxxxxxxxxxxxx"
  manual_ip:
    static_ip: 192.168.xxx.xxx
    gateway: 192.168.xxx.xxx
    subnet: 255.xxx.xxx.xxx
  ap:
    ssid: "MellowBucketHotspot"
    password: "xxxxxxxxxx"

mqtt:
  broker: 192.168.xxx.xxx
  username: xxxxx
  password: xxxxx

captive_portal:

# Enable logging
logger:

ota:
  password: "xxxxx"

I can see the state_topic via MQTT…

mellowbucket/state

{"effect":"Rainbow","color_mode":"rgb","state":ON,"brightness":40,"color":{"r":126,"g":239,"b":69}}

I tried some syntax to figure out by myself, what command to send to the command_topic but without luck so far.

Does anyone know how to send commands which are accepted by the command_topic??

No matter what syntax I use it seems there’s no reaction at all on the command channel…
Maybe my yaml configuration has some errors even if it gets compiled without errors and API control is working…

(but for now I removed homeassistant API from the yaml…)

I also tried if I get some response on MQTT while controlling the device via API but there are no MQTT messages at all using API control.

I’m stuck here - would be nice if anyone could help me finding the right way to use MQTT for controlling my addressable fastled stripe.

cheers

The first thing I would do is run MQTT Explorer to see exactly what is being published.

I use WLED to control my LEDs, though not from Home Assistant, though there is a WLED integration available.

Thanks stevemann,

I use MQTTfx which is similar I think…

Like I wrote, I can see the device reporting on the state topic.

What I miss is the right syntax for sending commands to the command topic.

how would this look like? something like this?

mellowbucket/command {"effect":"Rainbow"}

I found no explanation or documentation for this…

I tried so many different syntax to send a command but nothing seems to work, even if I can see my command reaching the command topic. but the stripe isn’t reacting no matter which syntax I use!

Maybe MQTT Explorer is a better choice, I will see…

If you intend to make the device not dependent on Home Assistant I would strongly advise switching to Tasmota. Otherwise you’d still need EspHome to make any changes or updates.