mirror of
https://github.com/esphome/esphome-docs.git
synced 2025-02-01 23:21:29 +01:00
Extra example in cookbook / flashing DOIT ESP32 (#138)
* Link to garage door * Fix dead link * Help on flashing DOIT ESP32 DEVKIT V1 * Add remote control gate relay example * Gate example indenting * Add subsections * Typo * repo renames * Update docs build section * fix powershell docker call * Move example
This commit is contained in:
parent
c801e4de65
commit
c30d93a00b
@ -7,7 +7,7 @@ GPIO Output
|
|||||||
|
|
||||||
The GPIO output component is quite simple: It exposes a single GPIO pin
|
The GPIO output component is quite simple: It exposes a single GPIO pin
|
||||||
as an output component. Note that output components are **not** switches and
|
as an output component. Note that output components are **not** switches and
|
||||||
will not show up in Home Assistant. See :doc:`GPIO Switch <gpio>`.
|
will not show up in Home Assistant. See :doc:`/esphomeyaml/components/switch/gpio`.
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
@ -48,7 +48,9 @@ To create an active-low switch (one that is turned off by default), use the :ref
|
|||||||
number: 25
|
number: 25
|
||||||
inverted: yes
|
inverted: yes
|
||||||
|
|
||||||
And to create momentary switches, for example switches that toggle a pin for a moment, use :doc:`template switches <template>`:
|
To create momentary switches, for example switches that toggle a pin for a moment, you can use :doc:`template switches <template>`.
|
||||||
|
|
||||||
|
An example that uses a single relay to activate a remote control button. The button can only start or stop the motor of the gate. In itself, the button or remote can not know if it opens or closes the gate. The relay simulates the button press for 500ms.
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
@ -58,18 +60,24 @@ And to create momentary switches, for example switches that toggle a pin for a m
|
|||||||
pin: 25
|
pin: 25
|
||||||
id: relay
|
id: relay
|
||||||
- platform: template
|
- platform: template
|
||||||
name: "Momentary Switch"
|
name: "Gate Remote"
|
||||||
optimistic: yes
|
icon: "mdi:gate"
|
||||||
|
optimistic: no
|
||||||
turn_on_action:
|
turn_on_action:
|
||||||
- switch.turn_on: relay
|
- switch.turn_on: relay
|
||||||
- delay: 100ms
|
- delay: 500ms
|
||||||
- switch.turn_off: relay
|
- switch.turn_off: relay
|
||||||
|
|
||||||
|
.. figure:: images/gate-remote-ui.png
|
||||||
|
:align: center
|
||||||
|
|
||||||
See Also
|
See Also
|
||||||
--------
|
--------
|
||||||
|
|
||||||
- :doc:`index`
|
- :doc:`index`
|
||||||
- :doc:`/esphomeyaml/components/output/gpio`
|
- :doc:`/esphomeyaml/components/output/gpio`
|
||||||
|
- :doc:`/esphomeyaml/components/cover/template`
|
||||||
|
- :doc:`/esphomeyaml/cookbook/garage-door`
|
||||||
- :doc:`API Reference </api/switch/index>`
|
- :doc:`API Reference </api/switch/index>`
|
||||||
- `Edit this page on GitHub <https://github.com/OttoWinter/esphomedocs/blob/current/esphomeyaml/components/switch/gpio.rst>`__
|
- `Edit this page on GitHub <https://github.com/OttoWinter/esphomedocs/blob/current/esphomeyaml/components/switch/gpio.rst>`__
|
||||||
|
|
||||||
|
BIN
esphomeyaml/components/switch/images/gate-remote-ui.png
Normal file
BIN
esphomeyaml/components/switch/images/gate-remote-ui.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
@ -46,6 +46,7 @@ See Also
|
|||||||
--------
|
--------
|
||||||
|
|
||||||
- :doc:`/esphomeyaml/guides/automations`
|
- :doc:`/esphomeyaml/guides/automations`
|
||||||
|
- :doc:`/esphomeyaml/components/switch/gpio`
|
||||||
- :doc:`/esphomeyaml/components/cover/template`
|
- :doc:`/esphomeyaml/components/cover/template`
|
||||||
- `Edit this page on GitHub <https://github.com/OttoWinter/esphomedocs/blob/current/esphomeyaml/cookbook/garage-door.rst>`__
|
- `Edit this page on GitHub <https://github.com/OttoWinter/esphomedocs/blob/current/esphomeyaml/cookbook/garage-door.rst>`__
|
||||||
|
|
||||||
|
@ -38,12 +38,15 @@ To use a relay with esphomelib, use a :doc:`GPIO Switch </esphomeyaml/components
|
|||||||
- platform: gpio
|
- platform: gpio
|
||||||
name: "Relay"
|
name: "Relay"
|
||||||
pin: <PIN_RELAY_IS_CONNECTED_TO>
|
pin: <PIN_RELAY_IS_CONNECTED_TO>
|
||||||
|
|
||||||
|
For a more complete example, check :doc:`Simple Garage Door </esphomeyaml/cookbook/garage-door>`.
|
||||||
|
|
||||||
See Also
|
See Also
|
||||||
--------
|
--------
|
||||||
|
|
||||||
- :doc:`/esphomeyaml/components/switch/gpio`
|
- :doc:`/esphomeyaml/components/switch/gpio`
|
||||||
- :doc:`/esphomeyaml/components/output/gpio`
|
- :doc:`/esphomeyaml/components/output/gpio`
|
||||||
|
- :doc:`/esphomeyaml/cookbook/garage-door`
|
||||||
- `How do relays work <https://www.explainthatstuff.com/howrelayswork.html>`__.
|
- `How do relays work <https://www.explainthatstuff.com/howrelayswork.html>`__.
|
||||||
- `Edit this page on GitHub <https://github.com/OttoWinter/esphomedocs/blob/current/esphomeyaml/cookbook/relay.rst>`__
|
- `Edit this page on GitHub <https://github.com/OttoWinter/esphomedocs/blob/current/esphomeyaml/cookbook/relay.rst>`__
|
||||||
|
|
||||||
|
@ -25,6 +25,9 @@ setup, please feel free to submit a pull request.
|
|||||||
The esphomelib documentation is built using `sphinx <http://www.sphinx-doc.org/>`__ and uses
|
The esphomelib documentation is built using `sphinx <http://www.sphinx-doc.org/>`__ and uses
|
||||||
`reStructuredText <http://docutils.sourceforge.net/rst.html>`__ for all source files.
|
`reStructuredText <http://docutils.sourceforge.net/rst.html>`__ for all source files.
|
||||||
|
|
||||||
|
Syntax
|
||||||
|
******
|
||||||
|
|
||||||
In my opinion, markdown would have been the much better choice in hindsight, but at the time
|
In my opinion, markdown would have been the much better choice in hindsight, but at the time
|
||||||
I was setting up the documentation good doxygen integration was key to me. Anyway, here's a quick
|
I was setting up the documentation good doxygen integration was key to me. Anyway, here's a quick
|
||||||
RST primer:
|
RST primer:
|
||||||
@ -178,39 +181,49 @@ RST primer:
|
|||||||
reStructured text can do a lot more than this, so if you're looking for a more complete guide
|
reStructured text can do a lot more than this, so if you're looking for a more complete guide
|
||||||
please have a look at the `Sphinx reStructuredText Primer <http://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html>`__.
|
please have a look at the `Sphinx reStructuredText Primer <http://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html>`__.
|
||||||
|
|
||||||
To check your documentation changes locally, you first need install sphinx (**with Python 3**) and
|
Build
|
||||||
`doxygen <http://www.stack.nl/~dimitri/doxygen/>`__.
|
*****
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
# in esphomedocs repo:
|
|
||||||
pip3 install -r requirements.txt
|
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
Alternatively, you can use the `esphomedocs docker image <https://hub.docker.com/r/ottowinter/esphomedocs/>`__:
|
The easiest way is to use the `esphomedocs docker image <https://hub.docker.com/r/ottowinter/esphomedocs/>`__:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
docker run --rm -v "$PWD/..":/data -p 8000:8000 -it ottowinter/esphomedocs
|
docker run --rm -v "$PWD/..":/data -p 8000:8000 -it ottowinter/esphomedocs
|
||||||
|
|
||||||
|
.. code-block:: powershell
|
||||||
|
|
||||||
|
docker run --rm -v ${PWD}/..:/data -p 8000:8000 -it ottowinter/esphomedocs
|
||||||
|
|
||||||
And then go to ``<CONTAINER_IP>:8000`` in your browser.
|
And then go to ``<CONTAINER_IP>:8000`` in your browser.
|
||||||
|
|
||||||
Next, you will also need to clone the `esphomelib repository <https://github.com/OttoWinter/esphomelib>`__ into
|
This way, you don't have to install the dependencies to build the documentation.
|
||||||
the folder where ``esphomedocs`` sits like this:
|
|
||||||
|
To check your documentation changes locally, you first need install sphinx (**with Python 3**) and
|
||||||
|
`doxygen <http://www.doxygen.nl/>`__.
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
# in ESPHome-Docs repo:
|
||||||
|
pip3 install -r requirements.txt
|
||||||
|
|
||||||
|
Next, you will also need to clone the `ESPHome-Core repository <https://github.com/esphome/ESPHome-Core>`__ into
|
||||||
|
the paret folder where ``ESPHome-Docs`` sits like this:
|
||||||
|
|
||||||
.. code-block:: text
|
.. code-block:: text
|
||||||
|
|
||||||
├── esphomedocs/
|
├── ESPHome-Docs/
|
||||||
│ ├── api/
|
│ ├── api/
|
||||||
│ ├── esphomeyaml/
|
│ ├── esphomeyaml/
|
||||||
│ ├── Doxygen
|
│ ├── Doxygen
|
||||||
│ ├── Makefile
|
│ ├── Makefile
|
||||||
│ ├── index.rst
|
│ ├── index.rst
|
||||||
│ └── ...
|
│ └── ...
|
||||||
└── esphomelib/
|
└── ESPHome-Core/
|
||||||
├── src/
|
├── docker/
|
||||||
├── examples/
|
├── examples/
|
||||||
|
├── lib/
|
||||||
|
├── src/
|
||||||
├── library.json
|
├── library.json
|
||||||
├── platformio.ini
|
├── platformio.ini
|
||||||
└── ...
|
└── ...
|
||||||
@ -227,6 +240,9 @@ Then, use the provided Makefile to build the changes and start a simple web serv
|
|||||||
# Updates then happen via:
|
# Updates then happen via:
|
||||||
make html
|
make html
|
||||||
|
|
||||||
|
Notes
|
||||||
|
*****
|
||||||
|
|
||||||
Some notes about the docs:
|
Some notes about the docs:
|
||||||
|
|
||||||
* Use the english language (duh...)
|
* Use the english language (duh...)
|
||||||
|
@ -81,9 +81,10 @@ Select the firmware binary and finally press "Flash ESP".
|
|||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
If you're just seeing ``Connecting....____....`` on the screen and the flashing fails, that's
|
If you're just seeing ``Connecting....____....`` on the screen and the flashing fails, that might
|
||||||
usually a sign that the ESP is defect or cannot be programmed. Please double check the UART wires
|
be a sign that the ESP is defect or cannot be programmed. Please double check the UART wires
|
||||||
are connected correctly if flashing using a USB to UART bridge.
|
are connected correctly if flashing using a USB to UART bridge. For some devices you need to
|
||||||
|
keep pressing the BOOT button until flashing has begun (ie. Geekcreit DOIT ESP32 DEVKIT V1).
|
||||||
|
|
||||||
What's the difference between esphomelib and esphomeyaml?
|
What's the difference between esphomelib and esphomeyaml?
|
||||||
---------------------------------------------------------
|
---------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user