Using a single WS8212 LED for status (red/orange/green)

HI, trying to configure and use single WS2812 led as a Status Led for my project.
I am using the device as follow; https://www.aliexpress.com/item/32732638750.html?spm=a2g0o.order_list.order_list_main.16.21ef1802KCwKKJ

As soon as I connect the LED to 5V and Gnd, the light is on an stay on.

I connected the LED to a D1mini as follow
D1mini 5v → to LED 5v
D1mini G → to LED gnd
D1mini D2 → to LED Din
Following is my code

# Spare Unit

substitutions:
  devicename: d1mini-12
  friendly_name: Spare D1mini-12
  comment: Spare
  esp_id: D1Mini_12
  board_type: nodemcuv2


esphome:
  name: ${devicename}
  friendly_name: ${friendly_name}
  comment: ${comment}

esp8266:
  board: ${board_type}

packages:
  base:  !include
    file: package/basic.yaml           
    vars: 
      Uptime_update_inverval: 10min

light:
  - platform: neopixelbus
    type: GRB
    variant: WS2812
    pin: D2
    num_leds: 1
    name: "NeoPixel Light"
    id: led

Anyone, as experience in using a single WS2812 could guide me to a solution.
A working example would be greatly appreciate.

Can you control it though?

I’ve found that in the one project I did something similar, it would usually turn on at boot and I had to shut it off. Ended up adding this to the boot sequence (and still some times it does this). Seemed to be a common problem, if I remember correctly.

I tried another LED, end up that the soldering was bad.
I can now turn on / off the light using NeoPixel Light.
Can you copy the code that you are using at boot to set the color ?

You are better off getting an RGB LED, not an addressable LED.

Good idea, I might go with this option

You can use restore_mode. Or on_boot. It is hard though to know exactly what your problem is though.

esphome:
  name: coffee-roaster
  on_boot:
    priority: 500
    then:
      - light.turn_off:
          id: neopixel_light
      - delay: 5s
      - light.turn_off:
          id: neopixel_light
      - delay: 5s
      - light.turn_off:
          id: neopixel_light

I repeated it 3 times with delays because I still had occasional times where it wouldn’t shutoff (and even with this, there are times that it stays on). It’s always still controllable though. If I remember correctly, I came across other instances of folks having similar issues. I suspect there is some noise that’s getting on the data line at boot, but don’t know for sure and since I already made up a PCB for this particular project, troubleshooting was more effort than it was worth.