True mode: INPUT_PULLUP on_press:then:- switch.toggle:id: relay_1 status_led:pin: GPIO13 binary_sensor:- platform: gpio id: button_1 pin:number: GPIO2 inverted: True mode: INPUT_PULLUP filters:- delayed_on: 10ms
PULLUPname:UpButtonid:up_buttoninternal:Trueon_press:then:-while:condition:-binary_sensor.is_on:...
binary_sensor:-platform:gpio pin:GPIO14name:"Physical Button (GPIO14)"id:gpio14_button filters:-delayed_on:50ms # 消抖滤波-delayed_off:50ms on_press:# 按下按键时切换GPIO5then:-switch.toggle:gpio5_switch # 控制GPIO5、GPIO4、GPIO12switch:# 主控开关(GPIO5)-platform:gpio name:"ming Room ...
binary_sensor: - platform: gpio pin: GPIO4 name: "Living Room Dehumidifier Toggle Button" on_press: then: - switch.toggle: dehumidifier1 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 在这个例子中,我们定义了两个硬件component:一个连接到GPIO4的简单按钮开关,和一个连接到GPIO3的控...
binary_sensor: - platform: gpio # Physical button on unit pin: number: GPIO0 id: sw_user_btn filters: - invert: - delayed_on_off: 25ms on_press: then: - logger.log: format: "sw_user_btn pressed. Calling script run motor." ...
lambda'return 50.0 / 180.0;'# 除了远程控制外,我还接了一个开关,用于手动开门,为了避免误触,我设定开关是长按启动,并设置一个传感器用来接收开关信号binary_sensor:# 这里定义了一个二元传感器,也就是只有ON/OFF两个输出-platform:gpiopin:number:GPIO4inverted:True# 这里是将信号反转,因为我的开关是按下后...
# Enable Home Assistant APIapi:# password: "1"ota:password:"123"web_server:port:80switch:-platform:gpiopin:GPIO0name:"书房灯1"id:relay2inverted:Truebinary_sensor:-platform:gpiopin:GPIO2name:"press_switch_lib1"device_class:openingfilters:-delayed_on_off:100ms #这里一定要加这个这个起到滤波...
Binary sensors have a similar payload and also only support GET requests. For example requesting the current state of a binary sensor using the URL binary_sensor/living_room_status could result in following payload: { "id": "binary_sensor-living_room_status", "state": "ON", "value": true...
-platform:gpiopin:number:GPIO13inverted:Truename:"${plug_name}_button"on_press: -switch.toggle:switch1output: -platform:gpiopin:GPIO15id:relay-platform:gpiopin:GPIO00inverted:Trueid:led1status_led:pin:number:GPIO02inverted:Trueswitch:
Configuration for the binary sensor (Boot Switch)binary_sensor: - platform: gpio pin: number: GPIO2 mode: input: true pullup: true name: Boot Switch internal: true on_press: - voice_assistant.start: - light.turn_off: light0 on_release: - voice_assistant.stop: - light.turn_on: light...