Created
May 20, 2019 01:01
-
-
Save Snipercaine/f3908a051fd79e6d7d7b765152666c2a to your computer and use it in GitHub Desktop.
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
esphome: | |
name: garage | |
platform: ESP8266 | |
board: esp01_1m | |
wifi: | |
ssid: !secret wifi | |
password: !secret wifi_pw | |
# Enable logging | |
logger: | |
# Enable Home Assistant API | |
api: | |
ota: | |
binary_sensor: | |
- platform: gpio | |
pin: | |
number: GPIO14 | |
mode: INPUT_PULLUP | |
inverted: True | |
name: "Janis Garage Door" | |
device_class: garage_door | |
- platform: template | |
name: "Janis Car" | |
device_class: presence | |
lambda: |- | |
if (id(ultrasonic_sensor1).state < 1.5) { | |
// car is in the garage | |
return true; | |
} else { | |
// no car | |
return false; | |
} | |
switch: | |
- platform: gpio | |
pin: GPIO12 | |
id: relay | |
- platform: template | |
icon: "mdi:arrow-up-down-bold-outline" | |
name: "Janis Garage Control" | |
turn_on_action: | |
- switch.turn_on: relay | |
- delay: 500ms | |
- switch.turn_off: relay | |
sensor: | |
- platform: ultrasonic | |
id: ultrasonic_sensor1 | |
trigger_pin: GPIO05 | |
echo_pin: GPIO04 | |
name: "Janis US Car" | |
update_interval: 60s | |
filters: | |
filter_out: nan | |
timeout: 9m |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment