diff --git a/.github/issue-close-app.yml b/.github/issue-close-app.yml
new file mode 100644
index 000000000..3a8ae3b52
--- /dev/null
+++ b/.github/issue-close-app.yml
@@ -0,0 +1,7 @@
+comment: >-
+ https://github.com/esphome/esphome-docs/issues/162
+issueConfigs:
+- content:
+ - "OTHERWISE THE ISSUE WILL BE CLOSED AUTOMATICALLY"
+
+caseInsensitive: false
diff --git a/_static/custom.css b/_static/custom.css
index 44d607455..6dad41e47 100644
--- a/_static/custom.css
+++ b/_static/custom.css
@@ -82,3 +82,25 @@ img.index-shield {
height: 26px;
margin-top: 10px;
}
+
+.supporters-row {
+ display: flex;
+}
+
+.supporters-column {
+ flex: 50%;
+ text-align: center;
+ padding-left: 10px;
+ padding-right: 10px;
+}
+
+.supporters-row .supporters-column:first-child {
+ border-right: 1px solid #a0a0a0;
+}
+
+.supporters-column img {
+ width: 75%;
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
diff --git a/components/mqtt.rst b/components/mqtt.rst
index 949cfcc25..4ebc51f5c 100644
--- a/components/mqtt.rst
+++ b/components/mqtt.rst
@@ -12,6 +12,12 @@ just be able to copy over the `MQTT
section `__ of your Home
Assistant configuration.
+.. warning::
+
+ When enabling MQTT and you do *not* use the "native API" for Home Assistant, you must
+ remove the ``api:`` line from your ESPHome configuration, otherwise the ESP will
+ reboot every 5 minutes because no client connected to the native API.
+
.. code-block:: yaml
# Example configuration entry
diff --git a/conf.py b/conf.py
index bb2d56556..f40d66539 100644
--- a/conf.py
+++ b/conf.py
@@ -20,7 +20,7 @@
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
-
+import hashlib
import os
import subprocess
from sphinx import addnodes
@@ -114,7 +114,7 @@ html_theme = 'alabaster'
#
html_baseurl = os.getenv('BASE_URL', 'https://esphome.io')
with open('_static/custom.css', 'rb') as f:
- custom_css_hash = "{:08X}".format(hash(f.read()) % 2**32)
+ custom_css_hash = hashlib.md5(f.read()).hexdigest()[:8]
html_theme_options = {
# 'logo': 'logo-full.png',
diff --git a/cookbook/bme280_environment.rst b/cookbook/bme280_environment.rst
index bea9513c9..3ace2801d 100644
--- a/cookbook/bme280_environment.rst
+++ b/cookbook/bme280_environment.rst
@@ -47,7 +47,8 @@ After validating the sensor is working, we can proceed and add some formulas.
const float r = 8.31447215; // Universal gas constant J/mol/K
return (6.112 * powf(2.718281828, (17.67 * id(bme280_temperature).state) /
(id(bme280_temperature).state + 243.5)) * id(bme280_humidity).state * mw) /
- ((273.15 + id(bme280_temperature).state) * r); // in grams/m^3
+ ((273.15 + id(bme280_temperature).state) * r); // in micrograms/m^3
+ accuracy_decimals: 2
update_interval: 15s
Altitude and absolute humidity:
diff --git a/cookbook/brilliant-mirabella-genio-smart-plugs.rst b/cookbook/brilliant-mirabella-genio-smart-plugs.rst
new file mode 100644
index 000000000..3702401ff
--- /dev/null
+++ b/cookbook/brilliant-mirabella-genio-smart-plugs.rst
@@ -0,0 +1,240 @@
+Brilliant / Mirabella Genio Smart Plugs
+=======================================
+
+Brilliant / Mirabella Genio Smart Plugs are a tuya based smart plugs sold by Bunnings and Kmart respectively in Australia.
+
+.. figure:: images/brilliant-mirabella-genio-smart-plugs.jpg
+ :align: center
+ :width: 50.0%
+
+Originally intended to be used with their companion apps once flashed using `tuya-convert `__ ESPHome generated
+firmware can be uploaded allowing you to control the smart plugs via Home Assistant.
+
+1. Create the ESPHome Firmware
+------------------------------
+
+#. Refer to either :doc:`/guides/getting_started_command_line` or :doc:`/guides/getting_started_hassio` before moving onto the next step.
+#. Select a plug configuration below based on the plug/s you have and copy all of the text in the code block and paste into your
+ ``name_of_esphome_configuration.yaml`` file.
+#. Compile the firmware, again depending on your chosen setup refer to the guides in the first point.
+
+2. Flashing
+-----------
+
+2.1 Prerequisites
+*****************
+
+#. Before you begin you'll need one of the following linux machines running the latest copy of `Raspbian Stretch Lite
+ `__
+
+ a. Raspberry Pi 2B/B+ with `USB WiFi Dongle `__.
+ b. Raspberry Pi 3B/B+.
+
+.. note::
+
+ As per the `tuya-convert documentation `__:
+
+ Any Linux with a Wifi adapter which can act as an Access Point should also work. Please note that we have tested the Raspberry Pi with clean installations
+ only. If you use your Raspberry Pi for anything else, we recommend using another SD card with a clean installation.
+
+#. A microSD card (minimum 2GB, 8GB+ recommended).
+#. Any WiFi device which can connect to the SSID generated by the Raspberry Pi and eventually the flashed tuya device. **This cannot be an iOS / Apple device.
+ Android devices will work.**
+
+2.2 Installing the OS
+*********************
+
+#. It's recommended to read the documentation provided by the Raspberry Pi Foundation on the best way to flash the OS to the microSD card depending on your
+ platform - `Installing operating system images `__.
+#. After you've flashed the microSD card browse to the "boot" partition and add a blank file called "ssh" **(without any extension)** which will enable the
+ SSH server upon first boot, extended information on this step can be found `here
+ `__.
+#. Plug the microSD card into the Raspberry Pi, connect network cable and power, the Raspberry Pi will start to boot.
+
+2.3 Connecting to the Pi via SSH
+********************************
+
+#. Download and install `Putty `__.
+#. Open Putty.
+#. Enter the IP of Raspberry Pi in the box that says "Host Name", leaving the port set to 22 (default for SSH). A list of recommended ways can be found `here
+ `__, but the easiest is to download and use `Fing `__
+ (`Android `__ / `iOS
+ `__).
+#. In the "Saved Sessions" input box, name the Raspberry Pi connection and then press "Save".
+#. Select your new saved session from the list.
+#. Press "Open".
+
+2.4 Configuring the Pi
+**********************
+
+#. In the putty window login with the **pi** as the user and **raspberry** for the password.
+#. Type ``sudo apt-get update && sudo apt-get dist-upgrade -y`` and wait for the upgrades to install.
+#. Type ``sudo apt-get install git`` and wait for it to install.
+
+2.5 Setup and Install tuya-convert
+**********************************
+
+#. In the putty window type ``git clone https://github.com/ct-Open-Source/tuya-convert`` press enter and wait while the repository is cloned.
+#. Type ``cd tuya-convert`` and press enter.
+#. Type ``./install_prereq.sh`` press enter and wait as the script gathers all the required components needed to function.
+
+2.6 Upload ESPHome Firmware using SFTP
+**************************************
+
+#. Download `FileZilla `__ or `WinSCP `__ or use your preferred FTP
+ client.
+#. Depending on the program you need to connect to the Pi using the IP address as the hostname and the username and password the same as you used to connect
+ via SSH and ensure your connection type is set to **SFTP**
+#. Browse to ``/root/tuya-convert/files``.
+#. Upload your compiled ``firmware.bin`` file to this directory. For command line based installs you can access the file under
+ ``//.pioenvs//firmware.bin`` alternatively Hass.io users can download the file directly from the web ui.
+
+2.7 Use tuya-convert to install ESPHome Firmware
+************************************************
+
+#. Type ``./start_flash.sh``
+#. Type ``yes`` to accept the warning.
+#. Connect your alternative WiFi device (non iOS / Apple based) to the ``vtrust-flash`` SSID using ``flashmeifyoucan`` as the password. This is the network
+ being broadcast by the Pi from the tuya flash script.
+#. If you haven't already connect your smart plug and turn it on. It should automatically enter pairing mode, if it doesn't follow the instructions below:
+
+ * Brilliant `(PDF Manual) `__
+
+ * To connect the Smart WiFi Plug to your WiFi press and hold the manual control button for about 5 seconds until you hear a click. Let go of the button
+ as soon as you hear the **click**. Then press button once again to activate blinking. **The red indicator light should now blink rapidly (2 times per
+ second)**.
+
+ * Mirabella `(PDF Manual) `__
+
+ * To do this, ensure your plug is on (the indicator light should be blue), hold the power button down for 5 seconds until you hear a click, let go of the
+ power button and then press the button once to activate.
+
+#. Press enter on your putty window to start the flash process and wait. If the connection is successful you should see a large amount of scrolling text, this
+ is the script backing up the factory shipped firmware.
+#. Once the process is complete you can type ``curl http://10.42.42.42/flashURL?url=http://10.42.42.1/files/firmware.bin``
+#. The plug will restart and if everything is working correctly after a few seconds you should be able to press the button triggering the relay and turning the
+ blue led on.
+
+3. Smart Plug Configurations
+----------------------------
+
+Thanks to the existing work by `@ideasman69 `__ and
+`afalzon `__
+which these adaptions created by `@cryptelli `__ are based on.
+
+
+3.1 Brilliant Smart Plug
+************************
+
+.. code-block:: yaml
+
+ esphome:
+ name: brilliant_smart_plug
+ platform: ESP8266
+ board: esp01_1m
+
+ wifi:
+ ssid: 'WIFI'
+ password: 'WIFIPASS'
+
+ logger:
+
+ api:
+
+ ota:
+
+ binary_sensor:
+ - platform: gpio
+ pin:
+ number: 14
+ mode: INPUT_PULLUP
+ inverted: true
+ name: "Power Button"
+ on_press:
+ - switch.toggle: relay
+
+ - platform: status
+ name: "Status"
+
+ switch:
+ - platform: gpio
+ id: red_led
+ pin:
+ number: GPIO12
+ inverted: true
+
+ - platform: gpio
+ name: "Brilliant Smart Plug"
+ pin: GPIO5
+ id: relay
+
+ # Turn off red LED to show blue when turned on
+ on_turn_on:
+ - switch.turn_off: red_led
+
+ # Turns on the red LED once the plug is turned off. Stock plug doesn't do this, to restore normal behavior remove the on_turn_on and on_turn_off
+ # blocks.
+ on_turn_off:
+ - switch.turn_on: red_led
+
+
+3.2 Mirabella Genio Wi-Fi 1 USB Adaptor
+***************************************
+
+.. code-block:: yaml
+
+ esphome:
+ name: mirabella_genio_smart_plug
+ platform: ESP8266
+ board: esp01_1m
+
+ wifi:
+ ssid: 'WIFI'
+ password: 'WIFIPASS'
+
+ logger:
+
+ api:
+
+ ota:
+
+ binary_sensor:
+ - platform: gpio
+ pin:
+ number: GPIO13
+ mode: INPUT_PULLUP
+ inverted: true
+ name: "Power Button"
+ on_press:
+ - switch.toggle: relay
+ - platform: status
+ name: Status
+
+ switch:
+ - platform: gpio
+ name: "Mirabella Genio Smart Plug"
+ pin: GPIO12
+ id: relay
+
+4. Adding to Home Assistant
+---------------------------
+
+You can now add your smart plug to home assistant via the configurations page, look for 'ESPHome' under the Integrations option and click 'Configure'.
+
+.. figure:: images/brilliant-mirabella-genio-smart-plugs-homeassistant.jpg
+ :align: center
+ :width: 50.0%
+
+See Also
+--------
+
+- :doc:`/components/switch/index`
+- :doc:`/components/binary_sensor/index`
+- :doc:`/components/light/index`
+- :doc:`/components/light/monochromatic`
+- :doc:`/components/output/index`
+- :doc:`/components/output/esp8266_pwm`
+- :doc:`/guides/automations`
+- :ghedit:`Edit`
+
+.. disqus::
diff --git a/cookbook/dual-r2-cover.rst b/cookbook/dual-r2-cover.rst
index bc118b02d..b2f65a9ff 100644
--- a/cookbook/dual-r2-cover.rst
+++ b/cookbook/dual-r2-cover.rst
@@ -31,13 +31,13 @@ for some motors.
.. code-block:: yaml
esphome:
- name: cover
- platform: ESP8266
- board: esp01_1m
+ name: cover
+ platform: ESP8266
+ board: esp01_1m
wifi:
- ssid: '***'
- password: '***'
+ ssid: '***'
+ password: '***'
api:
@@ -48,7 +48,7 @@ for some motors.
binary_sensor:
- platform: gpio
pin:
- number: 10
+ number: GPIO10
inverted: true
id: button
on_press:
@@ -75,10 +75,10 @@ for some motors.
switch:
- platform: gpio
- pin: 12
+ pin: GPIO12
id: open
- platform: gpio
- pin: 5
+ pin: GPIO5
id: close
cover:
@@ -102,7 +102,8 @@ for some motors.
stop_action:
- switch.turn_off: open
- switch.turn_off: close
- optimistic: true
+ optimistic: True
+ assumed_state: True
See Also
--------
diff --git a/cookbook/endstop-cover.rst b/cookbook/endstop-cover.rst
new file mode 100644
index 000000000..2c1a0469b
--- /dev/null
+++ b/cookbook/endstop-cover.rst
@@ -0,0 +1,113 @@
+Template Cover with Endstops
+============================
+
+.. seo::
+ :description: An example of how to integrate covers with endstops in ESPHome.
+ :image: window-open.jpg
+
+The following is an example configuration for controlling covers (like window blinds etc)
+with ESPHome. This guide assumes that the cover is set up with two endstops at the top
+and the bottom. When these endstops are reached, the cover will automatically stop.
+
+To protect the motors from spinning indefinitely (in case an endstop fails) the motors
+also have a maximum run time - after 3 minutes they will automatically turn off even if the
+endstop is not reached.
+
+ESPHome uses Home Assistant's cover architecture model which has two states: "OPEN" or
+"CLOSED". We will map OPEN to "cover is at the top endstop" and CLOSE to "cover is at the bottom".
+
+.. code-block:: yaml
+
+ switch:
+ # The switch that turns the UP direction on
+ - platform: gpio
+ pin: D1
+ id: up_pin
+ # Use interlocking to keep at most one of the two directions on
+ interlock: &interlock_group [up_pin, down_pin]
+ # If ESP reboots, do not attempt to restore switch state
+ restore_mode: always off
+
+ # The switch that turns the DOWN direction on
+ - platform: gpio
+ pin: D2
+ id: down_pin
+ interlock: *interlock_group
+ restore_mode: always off
+
+
+ binary_sensor:
+ # The top endstop
+ - platform: gpio
+ pin: D4
+ id: top_endstop
+ on_press:
+ # Acknowledge that the cover is open
+ - cover.template.publish:
+ id: my_cover
+ state: OPEN
+ # Stop the cover motors
+ - cover.stop: my_cover
+
+ - platform: gpio
+ pin: D5
+ id: bottom_endstop
+ on_press:
+ # Acknowledge that the cover is closed
+ - cover.template.publish:
+ id: my_cover
+ state: CLOSED
+ # Stop the cover motors
+ - cover.stop: my_cover
+
+ cover:
+ - platform: template
+ name: "My Endstop Cover"
+ id: my_cover
+ open_action:
+ - switch.turn_on: up_pin
+ # Failsafe: Turn off motors after 3min if endstop not reached.
+ - delay: 3 min
+ - cover.stop: my_cover
+ close_action:
+ - switch.turn_on: down_pin
+ - delay: 3 min
+ - cover.stop: my_cover
+ stop_action:
+ - switch.turn_off: up_pin
+ - switch.turn_off: down_pin
+ optimistic: True
+ assumed_state: True
+
+You can then optionally also add manual controls to the cover with three buttons:
+open, close, and stop.
+
+.. code-block:: yaml
+
+ binary_sensor:
+ # [...] - Previous binary sensors
+ - platform: gpio
+ id: open_button
+ pin: D3
+ on_press:
+ - cover.open: my_cover
+ - platform: gpio
+ id: close_button
+ pin: D6
+ on_press:
+ - cover.close: my_cover
+ - platform: gpio
+ id: stop_button
+ pin: D7
+ on_press:
+ - cover.stop: my_cover
+
+See Also
+--------
+
+- :doc:`/guides/automations`
+- :doc:`/components/cover/template`
+- :doc:`dual-r2-cover`
+- :ghedit:`Edit`
+
+.. disqus::
diff --git a/cookbook/garage-door.rst b/cookbook/garage-door.rst
index e23d6162f..b55d09195 100644
--- a/cookbook/garage-door.rst
+++ b/cookbook/garage-door.rst
@@ -9,8 +9,6 @@ The following is a possible configuration file for garage doors that are control
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-block:: yaml
switch:
diff --git a/cookbook/images/brilliant-mirabella-genio-smart-plugs-homeassistant.jpg b/cookbook/images/brilliant-mirabella-genio-smart-plugs-homeassistant.jpg
new file mode 100644
index 000000000..d8c4e8918
Binary files /dev/null and b/cookbook/images/brilliant-mirabella-genio-smart-plugs-homeassistant.jpg differ
diff --git a/cookbook/images/brilliant-mirabella-genio-smart-plugs.jpg b/cookbook/images/brilliant-mirabella-genio-smart-plugs.jpg
new file mode 100644
index 000000000..1e32b4dae
Binary files /dev/null and b/cookbook/images/brilliant-mirabella-genio-smart-plugs.jpg differ
diff --git a/guides/faq.rst b/guides/faq.rst
index d4e1de6c6..d07c7fd24 100644
--- a/guides/faq.rst
+++ b/guides/faq.rst
@@ -273,18 +273,6 @@ And a docker compose file looks like this:
1. Enable Avahi on both subnets.
2. Enable UDP traffic from ESPHome node's subnet to 224.0.0.251/32 on port 5353.
-Donations
----------
-
-I invest a lot of time into this project, so if you like ESPHome and want to
-support the project, donations are very welcome :)
-
-You can donate to me via PayPal. Other donation options are being
-explored. https://www.paypal.me/ottowinter
-
-(Please do not donate for specific features as I cannot guarantee I will
-be able to implement a feature because of complexity or other problems.)
-
See Also
--------
diff --git a/guides/supporters.rst b/guides/supporters.rst
new file mode 100644
index 000000000..a0e532180
--- /dev/null
+++ b/guides/supporters.rst
@@ -0,0 +1,142 @@
+Supporters & Contributors
+=========================
+
+**Hi! I'm Otto Winter, the author and main developer of ESPHome.**
+
+Developing ESPHome takes a lot of time. There's a lot of things that go
+into developing and maintaining an open-source project: from developing new features, fixing bugs,
+answering questions to maintaining servers, preparing releases and moderating discussions.
+And of course all of the hardware for new features has to be bought too. I'm a student
+so I really appreciate donations :)
+
+**You can support ESPHome's development** by becoming a Patron or a one-time contribution
+with PayPal.
+
+.. raw:: html
+
+
+