Disregard, a little messing around in ChatGPT and I got it working. I tried for hours last night and wasn’t able to. Not sure what was different about the prompts I gave it today, but at any rate here is the working yaml.
esphome:
name: screen-time-indicator-light
friendly_name: Screen Time Indicator Light
esp32:
board: esp32-s3-devkitc-1
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "*****"
ota:
- platform: esphome
password: "*****"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Screen-Time-Indicator-Light"
password: "*****"
captive_portal:
light:
- platform: neopixelbus
type: RGB
variant: WS2812
pin: GPIO21
num_leds: 1
name: "Screen Time RGB"
id: rgb_light
restore_mode: ALWAYS_OFF
select:
- platform: template
name: "Screen Time Indicator State"
optimistic: true
options:
- "Off"
- "Red"
- "Green"
initial_option: "Off"
on_value:
then:
- if:
condition:
lambda: 'return x == "Red";'
then:
- light.turn_on:
id: rgb_light
red: 1.0
green: 0.0
blue: 0.0
- if:
condition:
lambda: 'return x == "Green";'
then:
- light.turn_on:
id: rgb_light
red: 0.0
green: 1.0
blue: 0.0
- if:
condition:
lambda: 'return x == "Off";'
then:
- light.turn_off: rgb_light