All,
I am learning ESPHOME. This is one of my first configuration.
I have setup a neopixel led as follow
light:
- platform: neopixelbus
type: GRBW
variant: 800KBPS
restore_mode: ALWAYS_OFF
pin: GPIO22
num_leds: 11
name: "kitchen light"
id: kitchenlight
effects:
- addressable_rainbow:
name: Rainbow Effect With Custom Values
speed: 10
width: 50
I have a button that turn it on and off after 60 sec.
binary_sensor:
- platform: gpio
pin:
number: 23
mode:
input: true
pulldown : true
name: "OnOff Button"
filters:
- delayed_on: 10ms
- delayed_off: 20s
on_press:
then:
- logger.log: "Button is pressed, we'll switch light on"
- light.addressable_set:
id: kitchenlight
red: 0
green: 0
blue: 0
white: 60%
- light.turn_on:
id: kitchenlight
red: 0
green: 0
blue: 0
white: 60%
Goal is to only light the white led. I have tried percentage, value less than 1, but I always get below when running.
[19:49:51][D][main:235]: Button is pressed, we'll switch light on
[19:49:51][D][light:035]: 'kitchen light' Setting:
[19:49:51][D][light:046]: State: ON
[19:49:51][D][light:058]: Red: 100%, Green: 100%, Blue: 100%
[19:49:51][D][light:062]: White: 60%
[19:49:51][D][light:084]: Transition length: 1.0s
The odd part is that it wants to turn on the RGB led at 100%, while I don’t want it to happen.
I am unsure what I am doing wrong.
The complete YML is below. It is incomplete, as I am trying to test. The goal is to be able to light a led strip that will have 150 leds on the kitchen countertop. I don’t want to have it at full power
substitutions:
devicename: kitchen-light-1
esphome:
name: $devicename
friendly_name: kitchen-light-1
esp32:
board: nodemcu-32s
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: !secret api_key
ota:
safe_mode: true
password: !secret ota_key
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "${devicename} Fallback"
password: !secret fallback_pwd
binary_sensor:
- platform: gpio
pin:
number: 23
mode:
input: true
pulldown : true
name: "OnOff Button"
filters:
- delayed_on: 10ms
- delayed_off: 20s
on_press:
then:
- logger.log: "Button is pressed, we'll switch light on"
- light.addressable_set:
id: kitchenlight
red: 0
green: 0
blue: 0
white: 60%
- light.turn_on:
id: kitchenlight
red: 0
green: 0
blue: 0
white: 60%
on_release:
- logger.log: "Button is not pressed anymore, we'll switch light off"
- light.turn_off:
id: kitchenlight
transition_length: 10s
- platform: gpio
pin:
number: 18
mode:
input: true
pulldown : true
device_class: motion
name: "PIR Sensor"
filters:
- delayed_on: 10ms
- delayed_off: 60s
light:
- platform: neopixelbus
type: GRBW
variant: 800KBPS
restore_mode: ALWAYS_OFF
pin: GPIO22
num_leds: 11
name: "kitchen light"
id: kitchenlight
effects:
- addressable_rainbow:
name: Rainbow Effect With Custom Values
speed: 10
width: 50