Hello,
I have the LoraTap Remote 3 Button SS600ZB and have been able to pair it with my Zigbee coordinator, however so far I have only been able to see the button presses in zha_event which tells me it is working. Have done a bit of digging around, but am unable to find anything relating to either using HA automations or sending the button press events directly to the esphome?
My use case is this… I installed some WS2812B LED’s connected to a Wemos Mini running esphome in my daughters bedroom. The setup has a motion sensor so acts as a night light when it detects movement.
This all works great… but my 7 year old daughter asked if I could add a button to make the LED’s do other light sequences. So of course Dad (me) said no problem, and here I am.
Here’s the esphome code on the Wemos Mini…
substitutions:
off_hour: '5'
esp8266:
board: d1_mini
framework:
version: recommended
esphome:
name: esp4-bdrmlights
on_boot:
- light.turn_off:
id: bdrm_led_lights
transition_length: 2.5s
status_led:
pin: GPIO2
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
password: "REDACTED"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esp4-Bdrmlights Fallback Hotspot"
password: "REDACTED"
captive_portal:
script:
- id: turn_off
mode: restart
then:
- delay: 90s
- light.turn_off:
id: bdrm_led_lights
transition_length: 7.5s
- logger.log: "LED lights are OFF"
binary_sensor:
- platform: gpio
pin: D5
id: bdrm_pir
name: "Bdrm PIR Sensor"
device_class: motion
on_press:
then:
- if:
condition:
and:
# If it's night time
- sun.is_below_horizon:
- lambda: |-
auto hour = id(my_time).now().hour;
return hour > 12 || hour < ${off_hour};
then:
#Turn on the LED lights
- light.turn_on:
id: bdrm_led_lights
brightness: 40%
effect: random
- logger.log: "LED lights are ON"
on_release:
- script.execute: turn_off
sun:
latitude: !secret latitude
longitude: !secret longitude
time:
platform: sntp
id: my_time
timezone: !secret timezone
servers:
- 0.au.pool.ntp.org
- 1.au.pool.ntp.org
- 2.au.pool.ntp.org
on_time:
- hours: ${off_hour}
minutes: 0
seconds: 0
then:
- light.turn_off:
id: bdrm_led_lights
light:
- platform: fastled_clockless
chipset: WS2812B
pin: D1
num_leds: 54
rgb_order: GRB
name: "FastLED WS2812B Light"
id: bdrm_led_lights
default_transition_length: 7.5s
effects:
# Use default parameters:
- random:
# Customize parameters
- random:
name: "My Slow Random Effect"
transition_length: 30s
update_interval: 20s
- addressable_rainbow:
name: Rainbow Effect With Custom Values
speed: 10
width: 50
- addressable_color_wipe:
- addressable_color_wipe:
name: Color Wipe Effect With Custom Values
colors:
- red: 100%
green: 100%
blue: 100%
num_leds: 1
- red: 0%
green: 0%
blue: 0%
num_leds: 1
add_led_interval: 100ms
reverse: false
All I want to happen is this… daughter presses button 1, 2, or 3… the button presses translate to one of the effects available on the Wemos Mini. I figure that should be possible, but so far haven’t been able to crack the solution.
Here’s an attempt at an automation… but it doesn’t trigger the lights?
alias: Bedroom Lights
description: ''
trigger:
- device_id: db6041c525345e87fcf5053d2ed2b666
domain: zha
platform: device
type: remote_button_short_press
subtype: button_2
condition: []
action:
- service: light.turn_on
target:
entity_id: light.fastled_ws2812b_light
data:
effect: addressable_rainbow
mode: single
Open to ideas, and appreciate any help.