Neo Pixel Stick WS2812

Hello!

I have a problem with the configuration of the Neopixel stick.
I have divided the stick into 2 areas (LED 0-3 and LED 4-7).
When I turn on the light, the selected color from the code is displayed for a short moment, but then the LED’s are set to the color “white”.

Steuerelemente

binary_sensor:

  - platform: gpio
    pin:
        number: 14
        #inverted: true
        mode:
          input: true
    name: "Fensterkontakt"
    device_class: window


light:
  - platform: neopixelbus
    type: GRB
    variant: WS2812
    id: light1
    pin: GPIO04
    num_leds: 8
    name: "NeoPixel Light 1"
    internal: true

  - platform: partition
    name: "Fenster_offen"
    segments:
      - id: light1
        from: 0
        to: 3
    on_turn_on:
     - light.addressable_set:
        id: light1
        range_from: 0
        range_to: 3
        red: 0%
        green: 30%
        blue: 0%

  - platform: partition        
    name: "Balkonlicht_an"
    segments:
      - id: light1
        from: 4
        to: 7
    on_turn_on:
     - light.addressable_set:
        id: light1
        range_from: 4
        range_to: 7
        red: 30%
        green: 0%
        blue: 0%

Logs?

Full yaml?

full yaml.

esphome:
  name: esp8266-fensterkontakt-sz
  friendly_name: ESP8266 Fensterkontakt SZ

esp8266:
  board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "xxxx"

ota:
  password: "xxxx"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp8266-Fensterkontakt-Sz"
    password: "xxxx"

captive_portal:

binary_sensor:

  - platform: gpio
    pin:
        number: 14
        #inverted: true
        mode:
          input: true
    name: "Fensterkontakt"
    device_class: window


light:
  - platform: neopixelbus
    type: GRB
    variant: WS2812X
    id: light1
    pin: GPIO04
    num_leds: 8
    name: "NeoPixel Light 1"
    internal: true

  - platform: partition
    name: "Fenster_offen"
    segments:
      - id: light1
        from: 0
        to: 3
    on_turn_on:
     - light.addressable_set:
        id: light1
        range_from: 0
        range_to: 3
        red: 0%
        green: 30%
        blue: 0%

  - platform: partition        
    name: "Balkonlicht_an"
    segments:
      - id: light1
        from: 4
        to: 7
    on_turn_on:
     - light.addressable_set:
        id: light1
        range_from: 4
        range_to: 7
        red: 30%
        green: 0%
        blue: 0%
        

log File

INFO ESPHome 2023.12.5
INFO Reading configuration /config/esphome/esp8266-fensterkontakt-sz.yaml...
INFO Starting log output from  using esphome API
INFO Successfully connected to esp8266-fensterkontakt-sz @  in 0.005s
INFO Successful handshake with esp8266-fensterkontakt-sz @  in 2.699s
[07:41:51][I][app:102]: ESPHome version 2023.12.5 compiled on Mar 17 2024, 19:30:39
[07:41:51][C][wifi:573]: WiFi:
[07:41:51][C][wifi:405]:   Local MAC: xxxxx
[07:41:51][C][wifi:410]:   SSID: 'xxxx]
[07:41:51][C][wifi:411]:   IP Address: xxxxx
[07:41:51][C][wifi:412]:   BSSID: xxxx
[07:41:51][C][wifi:414]:   Hostname: 'esp8266-fensterkontakt-sz'
[07:41:51][C][wifi:416]:   Signal strength: -66 dB ▂▄▆█
[07:41:51][C][wifi:420]:   Channel: 11
[07:41:51][C][wifi:421]:   Subnet: 255.255.255.0
[07:41:51][C][wifi:422]:   Gateway: xxxxx
[07:41:51][C][wifi:423]:   DNS1: xxxx
[07:41:51][C][wifi:424]:   DNS2: 0.0.0.0
[07:41:51][C][logger:443]: Logger:
[07:41:51][C][logger:444]:   Level: DEBUG
[07:41:51][C][logger:445]:   Log Baud Rate:
[07:41:51][C][logger:447]:   Hardware UART: UART0
[07:41:51][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'Fensterkontakt'
[07:41:51][C][gpio.binary_sensor:015]:   Device Class: 'window'
[07:41:51][C][gpio.binary_sensor:016]:   Pin: GPIO14
[07:41:51][C][light:103]: Light 'NeoPixel Light 1'
[07:41:51][C][light:105]:   Default Transition Length: 1.0s
[07:41:51][C][light:106]:   Gamma Correct: 2.80
[07:41:51][C][light:103]: Light 'Fenster_offen'
[07:41:51][C][light:105]:   Default Transition Length: 1.0s
[07:41:51][C][light:106]:   Gamma Correct: 2.80
[07:41:51][C][light:103]: Light 'Balkonlicht_an'
[07:41:51][C][light:105]:   Default Transition Length: 1.0s
[07:41:51][C][light:106]:   Gamma Correct: 2.80
[07:41:52][C][captive_portal:088]: Captive Portal:
[07:41:52][C][mdns:115]: mDNS:
[07:41:52][C][api:142]:   Using noise encryption: YES
[07:42:02][D][light:036]: 'Balkonlicht_an' Setting:
[07:42:02][D][light:047]:   State: ON
[07:42:02][D][light:085]:   Transition length: 1.0s
[07:42:07][D][light:036]: 'Balkonlicht_an' Setting:
[07:42:07][D][light:047]:   State: OFF
[07:42:07][D][light:085]:   Transition length: 1.0s
[07:42:09][D][light:036]: 'Fenster_offen' Setting:
[07:42:09][D][light:047]:   State: ON
[07:42:09][D][light:085]:   Transition length: 1.0s
[07:42:12][D][light:036]: 'Fenster_offen' Setting:
[07:42:12][D][light:047]:   State: OFF
[07:42:12][D][light:085]:   Transition length: 1.0s
[07:42:15][D][light:036]: 'Fenster_offen' Setting:
[07:42:15][D][light:047]:   State: ON
[07:42:15][D][light:085]:   Transition length: 1.0s
[07:42:17][D][light:036]: 'Balkonlicht_an' Setting:
[07:42:17][D][light:047]:   State: ON
[07:42:17][D][light:085]:   Transition length: 1.0s
[07:42:19][D][light:036]: 'Balkonlicht_an' Setting:
[07:42:19][D][light:047]:   State: OFF
[07:42:19][D][light:085]:   Transition length: 1.0s
[07:42:21][D][light:036]: 'Fenster_offen' Setting:
[07:42:21][D][light:047]:   State: OFF
[07:42:21][D][light:085]:   Transition length: 1.0s