esphome-docs/esphomeyaml/cookbook/garage-door.rst

49 lines
1.4 KiB
ReStructuredText
Raw Normal View History

2018-06-01 18:10:00 +02:00
Simple Garage Door
==================
The following is a possible configuration file for garage doors that are controlled by two relays:
One for opening and another one for closing the garage door. When either one of them is turned on
for a short period of time, the close/open action begins.
.. code:: yaml
switch:
- platform: gpio
pin: D3
name: "Garage Door Open Switch"
id: open_switch
- platform: gpio
pin: D4
name: "Garage Door Close Switch"
id: close_switch
cover:
- platform: template
name: "Garage Door"
open_action:
# Cancel any previous action
2018-11-10 14:33:24 +01:00
- switch.turn_off: close_switch
2018-06-01 18:10:00 +02:00
# Turn the OPEN switch on briefly
2018-11-10 14:33:24 +01:00
- switch.turn_on: open_switch
2018-06-01 18:10:00 +02:00
- delay: 0.1s
2018-11-10 14:33:24 +01:00
- switch.turn_off: open_switch
2018-06-01 18:10:00 +02:00
close_action:
2018-11-10 14:33:24 +01:00
- switch.turn_off: open_switch
- switch.turn_on: close_switch
2018-06-01 18:10:00 +02:00
- delay: 0.1s
2018-11-10 14:33:24 +01:00
- switch.turn_off: close_switch
2018-06-01 18:10:00 +02:00
stop_action:
2018-11-10 14:33:24 +01:00
- switch.turn_off: close_switch
- switch.turn_off: open_switch
2018-06-01 18:10:00 +02:00
optimistic: true
See Also
2018-08-24 22:44:01 +02:00
--------
2018-06-01 18:10:00 +02:00
- :doc:`/esphomeyaml/guides/automations`
- :doc:`/esphomeyaml/components/cover/template`
2018-06-04 08:17:22 +02:00
- `Edit this page on GitHub <https://github.com/OttoWinter/esphomedocs/blob/current/esphomeyaml/cookbook/garage-door.rst>`__
2018-10-12 16:33:22 +02:00
.. disqus::