本帖最后由 kylin_fedora 于 2019-12-15 21:57 编辑
ESP8266 ESP-01S WS2812 RGB LED 灯模块加装人体感应模块=床脚夜灯
问题:使用带光敏电阻的人体感应模块时esp模块启动不了(esp上的灯不亮,led灯模块上的灯时亮的),使用未加光敏电阻的人体感应模块时没有问题,请问大侠来帮忙解决下--已解决,感谢@602293544,不能使用GPIO0作为人体感应的引脚,使用了RX=GPIO3
模块信息如下:
esp8226 esp-01S
LED 灯模块
人体红外感应模块 完整版 HC-SR501 人体模块焊接上光敏电阻5528 光电开关元件让白天不触发
链接情况
esphome配置如下:
esphome:
name: cw_night_light
platform: ESP8266
board: esp01_1m
wifi:
ssid: "xxx"
password: "xxx"
manual_ip:
static_ip: xxx
gateway: xxx
subnet: xxx
# Enable logging
logger:
# Enable Home Assistant API
api:
password: "xxx"
ota:
password: "xxx"
light:
- platform: fastled_clockless
chipset: WS2812B
pin: GPIO2
num_leds: 48
rgb_order: GRB
name: "CW Night light"
id: cwlight01
effects:
- addressable_scan:
- random:
name: "My Fast Random Effect"
transition_length: 4s
update_interval: 5s
- strobe:
- addressable_color_wipe:
- addressable_twinkle:
- addressable_fireworks:
binary_sensor:
- platform: gpio
pin: GPIO3
name: "PIR Sensor"
device_class: motion
on_press: #按下(有人),打开开关
then:
- if:
condition:
light.is_off: cwlight01 #判断灯是否是开着的,关闭才执行
then:
- light.dim_relative:
id: cwlight01
relative_brightness: 50%
- delay: 360s #持续亮360S
- light.turn_off: cwlight01
|