Switches in ESPHome

Аватар автора
JavaScript и Web Audio API
#switch Learn how to use pins of ESP8266 and ESP32 development boards as switches in Home Assistant. This is done with ESPHome add on. Simple Switch: switch: - platform: gpio name: "Switch 1" pin: xx Define ID: switch: - platform: gpio name: "Switch 1" pin: xx id: relay - platform: gpio name: "Switch 3" pin: 5 restore_mode: RESTORE_default_ON - platform: gpio name: "Switch 4" pin: 12 inverted: true - platform: gpio name: "Switch 6" pin: 14 icon: "mdi:gate" on_turn_on: - delay: 2000ms - switch.turn_off: relay restore_mode (Optional): Control how the GPIO Switch attempts to restore state on bootup. RESTORE_DEFAULT_OFF (Default) - Attempt to restore state and default to OFF if not possible to restore. RESTORE_DEFAULT_ON - Attempt to restore state and default to ON. RESTORE_INVERTED_OFF - Attempt to restore state inverted from the previous state and default to OFF. RESTORE_INVERTED_ON - Attempt to restore state inverted from the previous state and default to ON. ALWAYS_OFF - Always initialize the pin as OFF on bootup. ALWAYS_ON - Always initialize the pin as ON on bootup. Link of other tutorials: Home Assistant integration with ESP32 flashed with ESPHome: Setup ESPHome with Home Assistant: Buy Me A Coffee: #gpio_switch

0/0


0/0

0/0

0/0