Created
September 5, 2023 12:53
-
-
Save letsautomatenet/b7cffe868118ab2a416d3b2a0fdc7e3b to your computer and use it in GitHub Desktop.
ESPHome Example - Binary Sensor - PIR & Touch Button
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
substitutions: | |
variable1: "test1" | |
esphome: | |
name: ${variable1} | |
friendly_name: Test1 | |
esp8266: | |
board: d1_mini | |
web_server: | |
port: 80 | |
# Enable logging | |
logger: | |
# Enable Home Assistant API | |
api: | |
encryption: | |
# If you go to this page it generates one for you automatically! | |
# https://esphome.io/components/api.html#configuration-variables | |
key: "Generate a key and put it here" | |
ota: | |
password: "randomsecurepassword" | |
wifi: | |
ssid: !secret wifi_ssid | |
password: !secret wifi_password | |
# Enable fallback hotspot (captive portal) in case wifi connection fails | |
ap: | |
ssid: "Test1 Fallback Hotspot" | |
password: "differentrandomsecurepassword" | |
captive_portal: | |
binary_sensor: | |
- platform: gpio | |
pin: | |
number: D2 | |
mode: | |
input: true | |
pullup: true | |
name: Touch Button | |
- platform: gpio | |
pin: | |
number: D1 | |
mode: | |
input: true | |
pullup: true | |
name: PIR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment