Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===================================================================================
- #When holding the board with USB down
- # GND RST | -GPIO 1 GND
- # NC GPIO 36 | -GPIO 3 *GPIO 27
- # GPIO 39 *GPIO 26 | GPIO 22 GPIO 25
- # GPIO 35 GPIO 18 | GPIO 21 *GPIO 32
- # *GPIO 33 GPIO 19 | GPIO 17 *GPIO 12
- # GPIO 34 GPIO 23 | *GPIO 16 GPIO 4
- # *GPIO 14 GPIO 5 | GND GPIO 0
- # NC 3.3V | 5V GPIO 2
- # GPIO 9 *GPIO 13 | *GPIO 15 -GPIO 8
- # -GPIO 11 GPIO 10 | -GPIO 7 -GPIO 6
- #Notes
- # * Pins are best to use
- # - Pins that should never be use
- # Unmark pins could be used as input only but ESPHome won't allow it
- #===================================================================================
- binary_sensor:
- - platform: gpio
- pin:
- number: GPIO27
- mode: INPUT_PULLUP
- inverted: true
- name: "Shop North Overhead Door Closed Postion"
- device_class: garage_door
- id: contact_sensor_closed_postion
- internal: false
- filters:
- - delayed_on: 100ms
- - platform: gpio
- pin:
- number: GPIO12
- mode: INPUT_PULLUP
- inverted: true
- name: "Shop North Overhead Door Open Postion"
- device_class: garage_door
- id: contact_sensor_open_postion
- internal: false
- filters:
- - delayed_on: 100ms
- - platform: gpio
- pin:
- number: GPIO32
- mode: INPUT_PULLUP
- inverted: False
- name: "Shop Door"
- device_class: door
- filters:
- - delayed_on: 100ms
- switch:
- - platform: gpio
- pin:
- number: GPIO13
- inverted: true
- name: "Shop North Overhead Door Relay"
- id: relay
- internal: true
- - platform: restart
- name: "Reset Shop garage Door ESPHome"
- # This creates the actual garage door in HA. The state is based
- # on the contact sensor. Opening/closing the garage door simply
- # turns the relay on/off with a 0.5s delay in between.
- #return COVER_CLOSED;
- cover:
- - platform: template
- device_class: garage
- name: "Shop North Overhead Door"
- id: template_cov
- lambda: |-
- if ((id(contact_sensor_open_postion).state) == true) {
- return 1.0;
- } else if (id(contact_sensor_closed_postion).state == true) {
- return 0.0;
- } else {
- return 0.5;
- }
- open_action:
- - switch.turn_on: relay
- - delay: 0.5s
- - switch.turn_off: relay
- close_action:
- - switch.turn_on: relay
- - delay: 0.5s
- - switch.turn_off: relay
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement