Light by uart from esp01 in esphome

Hello, I am trying to create a light based on neopixels, the intention is for it to have light effects that require faster processing speed and more complex code than I can create with esphome.

For this, my idea is to use an esp01 as a junction point between esphome (HA) and an esp32c3 supermini that will send commands to the neopixel strip, for this I have to provide a string in json format with the following through Uart communication structure: {“color”:{“R”:100,“G”:100,“B”:100,“W”:100,“Y”:100},“effect”:“effect”}

Being (“R” = red, “G” = green, “B” = blue, “W” = white and “Y” = brightness, numbers from 0 to 100 and “effect” a text string of 8 characters)

I have tried with this base code:

esphome:
  name: ge00-demouart
  friendly_name: GE00_DemoUart

esp8266:
  board: esp01_1m

# Enable logging
logger:
  level: none

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

ote:
  password: "*****"

Wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Ge00-DemoUart"
    password: "*****"

captive_portal:

uart:
  tx_pin: GPIO1
  rx_pin: GPIO3
  baud_rate: 115200

Light:
  network: network
  blue: blue
  green: green
  id: algo
  platform: rgb
  name: "GE00_DemoUart"
  effects:
    lambda:
      - name: "none"
        update_interval: 1s
        lambda: |-
          #

      - name: "fire"
        update_interval: 1s
        lambda: |-
          #

on_state:
  - uart.write: !lambda
    return: {id(algo).red}

but when I compile it I get this error, for now I’m just trying to get the colors:

INFO ESPHome 2024.5.5
INFO Reading configuration /config/esphome/ge00-demouart.yaml...
Failed config

light.rgb: [source /config/esphome/ge00-demouart.yaml:37]
  network: network
  blue: blue
  green: green
  id: pepe
  platform: rgb
  name: GE00_DemoUart
  effects: 
    
    expected a dictionary.
    lambda: 
      - name: none
        update_interval: 1s
        lambda: #
      - name: fire
        update_interval: 1s
        lambda: #
on_state: [source /config/esphome/ge00-demouart.yaml:56]
  
  Component not found: on_state.
  - uart.write: !lambda |-
    
    return: 
      id(algo).red:

I don’t know how to obtain this data or if there is an easier way to do it, any ideas?

I don’t really quite get what you are trying to do, but as a start, thus isn’t indented to the right level.