Below is my ESPHome Config for an LED strip that lights my stairs. It works great for the PIR sensor attached to it, but I would also like to use HA triggers to create more lighting effects like addressable rainbow
or other things mentioned in the docs.
What I am confused most about is the yaml for accessing api > on_press > for a service. I’m not sure if that makes sense. What I ideally want to happen is for when motion is detected on camera A (sensor.camera_a), for this light, (light.led_stairs) to show addressable rainbow or some other effect.
I currently have the light turn on a different color using scenes & automation. A scene for the LED light color and then automation for when the motion is detected. However, I can’t do any fun effects via automation/scenes. If I can, please correct me. If not, it looks like I can do that via the ESPHome yaml. Can anyone offer any help?
binary_sensor:
- platform: gpio
pin:
number: GPIO16
mode: INPUT_PULLDOWN_16
name: "Stair_motion"
id: stair_motion
device_class: motion
on_press:
- if:
condition:
binary_sensor.is_on: stair_motion
then:
- light.turn_on: led_stairs_light
- delay: 7s
- light.turn_off: led_stairs_light
else:
- wait_until:
binary_sensor.is_on: stair_motion
light:
- platform: neopixelbus
type: GRB
pin: GPIO3
num_leds: 60
name: "led_stairs_strip"
id: led_stairs_light
variant: WS2812