Les boutons dans tous leurs états avec ESPHome
Автор: pyc tech
Загружено: 2023-09-16
Просмотров: 3044
Tout (ou presque) ce que vous devez savoir sur les boutons avec ESPHome !!!
Code Yaml :
web_server:
#ESP32 --- Bouton
#GND --- GND
#3V3 --- VCC
#D13 --- OUT
web_server:
binary_sensor:
boot button
platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
name: "boot button"
id: "boot_button"
Red button
platform: gpio
pin:
number: GPIO13
#mode: INPUT_PULLUP
inverted: False
name: "red button"
id: "red_button"
on_press:
then:
logger.log: "on_press"
on_release:
then:
logger.log: "on_release"
on_state:
then:
logger.log: "on_state"
on_click:
min_length: 50ms
max_length: 350ms
then:
logger.log: "short click"
min_length: 351ms
max_length: 2000ms
then:
logger.log: "long click"
EndStop button
- platform: gpio
pin:
number: GPIO15
mode: INPUT_PULLUP
inverted: True
name: "End Stop button"
id: "endstop_button"
PULLUP button
platform: gpio
pin:
number: GPIO15
mode: INPUT_PULLUP
inverted: True
name: "PULLUP button"
id: "pullup_button"
filters:
delayed_on: 10ms
0:00 Présentation
0:55 Bouton flash
2:06 Module bouton
3:10 Endstop
3:45 Bouton sans resistance Pullup
5:07 Filter delayed_on
5:46 Switch
6:15 Les triggers on_press / on_state
6:58 Short click / Long click
7:30 Composants boutons
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: