Compare commits
	
		
			64 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					a5d0ecdb13 | ||
| 
						 | 
					71cbc9cfb0 | ||
| 
						 | 
					88625c656d | ||
| 
						 | 
					971b15ac67 | ||
| 
						 | 
					407c46cb03 | ||
| 
						 | 
					340530566c | ||
| 
						 | 
					f4a55eafd7 | ||
| 
						 | 
					fc8f270a9f | ||
| 
						 | 
					6be47488a4 | ||
| 
						 | 
					5b94bb894e | ||
| 
						 | 
					26aa399bea | ||
| 
						 | 
					1404d39ffe | ||
| 
						 | 
					b71b14cd06 | ||
| 
						 | 
					145e7b00ee | ||
| 
						 | 
					07c80dfcda | ||
| 
						 | 
					0e52c9a778 | ||
| 
						 | 
					94bd179256 | ||
| 
						 | 
					11c38ca4e8 | ||
| 
						 | 
					dc71d11a21 | ||
| 
						 | 
					e385c8435b | ||
| 
						 | 
					13eca6012d | ||
| 
						 | 
					cb3e3e024d | ||
| 
						 | 
					79bdec32b8 | ||
| 
						 | 
					c153dba5bc | ||
| 
						 | 
					fa2c2917c1 | ||
| 
						 | 
					2a06f4dbf4 | ||
| 
						 | 
					49b618bb0c | ||
| 
						 | 
					20ec3900be | ||
| 
						 | 
					605be1a6ec | ||
| 
						 | 
					33b67de32e | ||
| 
						 | 
					1ffedb291c | ||
| 
						 | 
					8f251848ef | ||
| 
						 | 
					4046a16d85 | ||
| 
						 | 
					5ed987adcd | ||
| 
						 | 
					a463c59733 | ||
| 
						 | 
					1726c4237b | ||
| 
						 | 
					f1241af91d | ||
| 
						 | 
					7ae6777fd6 | ||
| 
						 | 
					a169d37557 | ||
| 
						 | 
					be21aa786d | ||
| 
						 | 
					9a881100e6 | ||
| 
						 | 
					c2f88776c7 | ||
| 
						 | 
					846fcb8ccd | ||
| 
						 | 
					44495c919c | ||
| 
						 | 
					d4ce7699d4 | ||
| 
						 | 
					318bb8b254 | ||
| 
						 | 
					1ad65516cf | ||
| 
						 | 
					d4c7e6c634 | ||
| 
						 | 
					9a939d2d27 | ||
| 
						 | 
					06eeed9ee9 | ||
| 
						 | 
					5655b5fe10 | ||
| 
						 | 
					0dec7cfbf8 | ||
| 
						 | 
					f51d301d53 | ||
| 
						 | 
					30e7797577 | ||
| 
						 | 
					0e5cabadc1 | ||
| 
						 | 
					aa5f887ff3 | ||
| 
						 | 
					28561ea6a4 | ||
| 
						 | 
					6b8125f5f2 | ||
| 
						 | 
					ab43390983 | ||
| 
						 | 
					d7d3a4aa36 | ||
| 
						 | 
					4dce7fa103 | ||
| 
						 | 
					467ef9902f | ||
| 
						 | 
					6a2e9a8503 | ||
| 
						 | 
					74fefea5bb | 
@@ -17,8 +17,7 @@ from esphome.core import CORE, EsphomeError
 | 
			
		||||
from esphome.cpp_generator import Expression, RawStatement, add, statement
 | 
			
		||||
from esphome.helpers import color, indent
 | 
			
		||||
from esphome.py_compat import IS_PY2, safe_input, text_type
 | 
			
		||||
from esphome.storage_json import StorageJSON, esphome_storage_path, \
 | 
			
		||||
    start_update_check_thread, storage_path
 | 
			
		||||
from esphome.storage_json import StorageJSON, storage_path
 | 
			
		||||
from esphome.util import run_external_command, run_external_process, safe_print
 | 
			
		||||
 | 
			
		||||
_LOGGER = logging.getLogger(__name__)
 | 
			
		||||
@@ -157,12 +156,7 @@ def write_cpp(config):
 | 
			
		||||
 | 
			
		||||
def compile_program(args, config):
 | 
			
		||||
    _LOGGER.info("Compiling app...")
 | 
			
		||||
    update_check = not os.getenv('ESPHOME_NO_UPDATE_CHECK', '')
 | 
			
		||||
    if update_check:
 | 
			
		||||
        thread = start_update_check_thread(esphome_storage_path(CORE.config_dir))
 | 
			
		||||
    rc = platformio_api.run_compile(config, args.verbose)
 | 
			
		||||
    if update_check:
 | 
			
		||||
        thread.join()
 | 
			
		||||
    return rc
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -13,7 +13,7 @@ MULTI_CONF = True
 | 
			
		||||
 | 
			
		||||
CONFIG_SCHEMA = vol.Schema({
 | 
			
		||||
    cv.GenerateID(): cv.declare_variable_id(DallasComponent),
 | 
			
		||||
    vol.Required(CONF_PIN): pins.input_pullup_pin,
 | 
			
		||||
    vol.Required(CONF_PIN): pins.input_pin,
 | 
			
		||||
    vol.Optional(CONF_UPDATE_INTERVAL): cv.update_interval,
 | 
			
		||||
}).extend(cv.COMPONENT_SCHEMA.schema)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -13,8 +13,8 @@ I2CDevice = pins.I2CDevice
 | 
			
		||||
 | 
			
		||||
CONFIG_SCHEMA = vol.Schema({
 | 
			
		||||
    cv.GenerateID(): cv.declare_variable_id(I2CComponent),
 | 
			
		||||
    vol.Optional(CONF_SDA, default='SDA'): pins.input_pullup_pin,
 | 
			
		||||
    vol.Optional(CONF_SCL, default='SCL'): pins.input_pullup_pin,
 | 
			
		||||
    vol.Optional(CONF_SDA, default='SDA'): pins.input_pin,
 | 
			
		||||
    vol.Optional(CONF_SCL, default='SCL'): pins.input_pin,
 | 
			
		||||
    vol.Optional(CONF_FREQUENCY): vol.All(cv.frequency, vol.Range(min=0, min_included=False)),
 | 
			
		||||
    vol.Optional(CONF_SCAN): cv.boolean,
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -51,7 +51,7 @@ REQUIRED_BUILD_FLAGS = '-DUSE_NEW_OTA'
 | 
			
		||||
 | 
			
		||||
def lib_deps(config):
 | 
			
		||||
    if CORE.is_esp32:
 | 
			
		||||
        return ['Update', 'ESPmDNS']
 | 
			
		||||
        return ['Update']
 | 
			
		||||
    if CORE.is_esp8266:
 | 
			
		||||
        return ['Hash', 'ESP8266mDNS']
 | 
			
		||||
        return ['Hash']
 | 
			
		||||
    raise NotImplementedError
 | 
			
		||||
 
 | 
			
		||||
@@ -2,10 +2,10 @@
 | 
			
		||||
 | 
			
		||||
MAJOR_VERSION = 1
 | 
			
		||||
MINOR_VERSION = 11
 | 
			
		||||
PATCH_VERSION = '0b2'
 | 
			
		||||
PATCH_VERSION = '2'
 | 
			
		||||
__short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION)
 | 
			
		||||
__version__ = '{}.{}'.format(__short_version__, PATCH_VERSION)
 | 
			
		||||
ESPHOME_CORE_VERSION = '1.11.0b2'
 | 
			
		||||
ESPHOME_CORE_VERSION = '1.11.2'
 | 
			
		||||
 | 
			
		||||
ESP_PLATFORM_ESP32 = 'ESP32'
 | 
			
		||||
ESP_PLATFORM_ESP8266 = 'ESP8266'
 | 
			
		||||
@@ -415,5 +415,7 @@ CONF_SEGMENTS = 'segments'
 | 
			
		||||
 | 
			
		||||
ALLOWED_NAME_CHARS = u'abcdefghijklmnopqrstuvwxyz0123456789_'
 | 
			
		||||
ARDUINO_VERSION_ESP32_DEV = 'https://github.com/platformio/platform-espressif32.git#feature/stage'
 | 
			
		||||
ARDUINO_VERSION_ESP32_1_0_1 = 'espressif32@1.6.0'
 | 
			
		||||
ARDUINO_VERSION_ESP8266_DEV = 'https://github.com/platformio/platform-espressif8266.git#feature' \
 | 
			
		||||
                              '/stage'
 | 
			
		||||
ARDUINO_VERSION_ESP8266_2_5_0 = 'espressif8266@2.0.0'
 | 
			
		||||
 
 | 
			
		||||
@@ -114,6 +114,7 @@ def validate_platform(value):
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
PLATFORMIO_ESP8266_LUT = {
 | 
			
		||||
    '2.5.0': 'espressif8266@2.0.0',
 | 
			
		||||
    '2.4.2': 'espressif8266@1.8.0',
 | 
			
		||||
    '2.4.1': 'espressif8266@1.7.3',
 | 
			
		||||
    '2.4.0': 'espressif8266@1.6.0',
 | 
			
		||||
@@ -125,6 +126,7 @@ PLATFORMIO_ESP8266_LUT = {
 | 
			
		||||
 | 
			
		||||
PLATFORMIO_ESP32_LUT = {
 | 
			
		||||
    '1.0.0': 'espressif32@1.4.0',
 | 
			
		||||
    '1.0.1': 'espressif32@1.6.0',
 | 
			
		||||
    'RECOMMENDED': 'espressif32@1.5.0',
 | 
			
		||||
    'LATEST': 'espressif32',
 | 
			
		||||
    'DEV': ARDUINO_VERSION_ESP32_DEV,
 | 
			
		||||
 
 | 
			
		||||
@@ -150,6 +150,7 @@ ul.stepper:not(.horizontal) .step.active::before, ul.stepper:not(.horizontal) .s
 | 
			
		||||
.select-action {
 | 
			
		||||
  width: auto !important;
 | 
			
		||||
  height: auto !important;
 | 
			
		||||
  white-space: nowrap;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.tap-target-wrapper {
 | 
			
		||||
 
 | 
			
		||||
@@ -35,8 +35,9 @@
 | 
			
		||||
    <h5>Select Upload Port</h5>
 | 
			
		||||
    <p>
 | 
			
		||||
      Here you can select where ESPHome will attempt to show logs and upload firmwares to.
 | 
			
		||||
      By default, this is "OTA", or Over-The-Air. Note that you might have to restart the Hass.io add-on
 | 
			
		||||
      for new serial ports to be detected.
 | 
			
		||||
      For newly plugged in serial devices to be detected, restart the add-on.
 | 
			
		||||
      (Also see <a href="https://esphome.io/guides/faq#i-can-t-get-flashing-over-usb-to-work" target="_blank">
 | 
			
		||||
      esphomeflasher</a>)
 | 
			
		||||
    </p>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
@@ -151,27 +152,24 @@
 | 
			
		||||
        <div class="step-content">
 | 
			
		||||
          <div class="row">
 | 
			
		||||
            <p>
 | 
			
		||||
              Hi there! I'm the ESPHome setup wizard and will guide you through setting up
 | 
			
		||||
              Hi there! This is the ESPHome setup wizard. It will guide you through setting up
 | 
			
		||||
              your first ESP8266 or ESP32-powered device using ESPHome.
 | 
			
		||||
            </p>
 | 
			
		||||
              <a href="https://www.espressif.com/en/products/hardware/esp8266ex/overview" target="_blank">ESP8266s</a> and
 | 
			
		||||
              their successors (the <a href="https://www.espressif.com/en/products/hardware/esp32/overview" target="_blank">ESP32s</a>)
 | 
			
		||||
              are great low-cost microcontrollers that can communicate with the outside world using WiFi.
 | 
			
		||||
              They're found in many devices such as the popular Sonoff/iTead, but also exist as development boards
 | 
			
		||||
              such as the <a
 | 
			
		||||
                  href="https://esphome.io/devices/nodemcu_esp8266.html"
 | 
			
		||||
                  rel="noreferrer" target="_blank">NodeMCU</a>.
 | 
			
		||||
              such as the <a href="https://esphome.io/devices/nodemcu_esp8266.html" rel="noreferrer" target="_blank">NodeMCU</a>.
 | 
			
		||||
            <p>
 | 
			
		||||
            </p>
 | 
			
		||||
              <a href="https://esphome.io/index.html" rel="noreferrer"
 | 
			
		||||
                 target="_blank">ESPHome</a>,
 | 
			
		||||
              <a href="https://esphome.io/index.html" rel="noreferrer" target="_blank">ESPHome</a>,
 | 
			
		||||
              the tool you're using here, creates custom firmwares for these devices using YAML configuration
 | 
			
		||||
              files (similar to the ones you might be used to with Home Assistant).
 | 
			
		||||
            <p>
 | 
			
		||||
            </p>
 | 
			
		||||
              This wizard will create a basic YAML configuration file for your "node" (the microcontroller).
 | 
			
		||||
              Later, you will be able to customize this file and add some of ESPHome's
 | 
			
		||||
              many integrations.
 | 
			
		||||
              Later, you will be able to customize this file and add some of ESPHome's many
 | 
			
		||||
              integrations.
 | 
			
		||||
            <p>
 | 
			
		||||
            <p>
 | 
			
		||||
              First, I need to know what this node should be called. Choose this name wisely, it should be unique among
 | 
			
		||||
@@ -196,8 +194,11 @@
 | 
			
		||||
          <div class="row">
 | 
			
		||||
            <p>
 | 
			
		||||
              Great! Now I need to know what type of microcontroller you're using so that I can compile firmware for them.
 | 
			
		||||
              Please choose the board you're using below. If you're not sure you can also use similar ones
 | 
			
		||||
              or even the "Generic" option. In most cases that will work too.
 | 
			
		||||
              Please choose the board you're using below.
 | 
			
		||||
            </p>
 | 
			
		||||
            <p>
 | 
			
		||||
              If you're not sure you can also use similar ones or even the
 | 
			
		||||
              "Generic" option. In most cases that will work too.
 | 
			
		||||
            </p>
 | 
			
		||||
            <div class="input-field col s12">
 | 
			
		||||
              <select id="board" name="board" required>
 | 
			
		||||
@@ -332,41 +333,36 @@
 | 
			
		||||
        <div class="step-content">
 | 
			
		||||
          <p>
 | 
			
		||||
            Hooray! 🎉🎉🎉 You've successfully created your first ESPHome configuration file.
 | 
			
		||||
            When you click Submit, I will save this configuration file under
 | 
			
		||||
              <code class="inlinecode"><HASS_CONFIG_FOLDER>/esphome/<NAME_OF_NODE>.yaml</code>
 | 
			
		||||
              and
 | 
			
		||||
            you will be able to edit this file with the
 | 
			
		||||
            <a href="https://www.home-assistant.io/addons/configurator/" target="_blank">HASS Configuratior add-on</a>.
 | 
			
		||||
            When you click Submit, the wizard will save a configuration file under
 | 
			
		||||
            <code class="inlinecode"><HASS_CONFIG_FOLDER>/esphome/<NAME_OF_NODE>.yaml</code>.
 | 
			
		||||
          </p>
 | 
			
		||||
          <h5>Next steps</h5>
 | 
			
		||||
          <ul class="browser-default">
 | 
			
		||||
            <li>
 | 
			
		||||
              Flash the firmware. This can be done using the “UPLOAD” option in the dashboard. See
 | 
			
		||||
                <a href="https://esphome.io/index.html#devices" rel="noreferrer"
 | 
			
		||||
                   target="_blank">this</a>
 | 
			
		||||
              for guides on how to flash different types of devices. Note that you need to restart this add-on
 | 
			
		||||
              for newly plugged in serial devices to be detected.
 | 
			
		||||
              <a href="https://esphome.io/index.html#devices" rel="noreferrer" target="_blank">this</a>
 | 
			
		||||
              for guides on how to flash different types of devices. For newly plugged in serial
 | 
			
		||||
              devices to be detected, restart the add-on.
 | 
			
		||||
            </li>
 | 
			
		||||
            <li>
 | 
			
		||||
              With the current configuration, your node will only connect to WiFi and MQTT. To make it actually <i>do</i>
 | 
			
		||||
              stuff, follow
 | 
			
		||||
                <a href="https://esphome.io/guides/getting_started_hassio.html#adding-some-basic-features"
 | 
			
		||||
                   rel="noreferrer">
 | 
			
		||||
              With the current configuration, your node will only connect to WiFi. To make it
 | 
			
		||||
              actually <i>do</i> stuff, follow
 | 
			
		||||
              <a href="https://esphome.io/guides/getting_started_hassio.html#adding-some-basic-features"
 | 
			
		||||
                 rel="noreferrer">
 | 
			
		||||
                the rest of the getting started guide
 | 
			
		||||
              </a>.
 | 
			
		||||
            </li>
 | 
			
		||||
            <li>
 | 
			
		||||
                See the <a href="https://esphome.io/index.html" rel="noreferrer"
 | 
			
		||||
                           target="_blank">ESPHome index</a>
 | 
			
		||||
              See the <a href="https://esphome.io/index.html" rel="noreferrer"
 | 
			
		||||
                         target="_blank">ESPHome index</a>
 | 
			
		||||
              for a list of supported sensors/devices.
 | 
			
		||||
            </li>
 | 
			
		||||
            <li>
 | 
			
		||||
              Join the <a href="https://discord.gg/KhAMKrd" target="_blank">Discord server</a> and say hi! When I
 | 
			
		||||
              have time, I would be happy to help with issues and discuss new features.
 | 
			
		||||
              Join the <a href="https://discord.gg/KhAMKrd" target="_blank">Discord server</a> and
 | 
			
		||||
              say hi! Discord's the best place to ask if you have issues/ideas.
 | 
			
		||||
            </li>
 | 
			
		||||
            <li>
 | 
			
		||||
                Star <a href="https://github.com/esphome/esphome"
 | 
			
		||||
                        target="_blank">ESPHome</a> on GitHub
 | 
			
		||||
              Star <a href="https://github.com/esphome/esphome" target="_blank">ESPHome</a> on GitHub
 | 
			
		||||
              if you find this software awesome and report issues using the bug trackers there.
 | 
			
		||||
            </li>
 | 
			
		||||
          </ul>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,9 @@
 | 
			
		||||
import binascii
 | 
			
		||||
import codecs
 | 
			
		||||
from datetime import datetime, timedelta
 | 
			
		||||
from datetime import datetime
 | 
			
		||||
import json
 | 
			
		||||
import logging
 | 
			
		||||
import os
 | 
			
		||||
import threading
 | 
			
		||||
 | 
			
		||||
from esphome import const
 | 
			
		||||
from esphome.core import CORE
 | 
			
		||||
@@ -226,72 +225,3 @@ class EsphomeStorageJSON(object):
 | 
			
		||||
 | 
			
		||||
    def __eq__(self, o):  # type: (Any) -> bool
 | 
			
		||||
        return isinstance(o, EsphomeStorageJSON) and self.as_dict() == o.as_dict()
 | 
			
		||||
 | 
			
		||||
    @property
 | 
			
		||||
    def should_do_esphome_update_check(self):  # type: () -> bool
 | 
			
		||||
        if self.last_update_check is None:
 | 
			
		||||
            return True
 | 
			
		||||
        return self.last_update_check + timedelta(days=3) < datetime.utcnow()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class CheckForUpdateThread(threading.Thread):
 | 
			
		||||
    def __init__(self, path):
 | 
			
		||||
        threading.Thread.__init__(self)
 | 
			
		||||
        self._path = path
 | 
			
		||||
 | 
			
		||||
    @property
 | 
			
		||||
    def docs_base(self):
 | 
			
		||||
        return 'https://beta.esphome.io' if 'b' in const.__version__ else \
 | 
			
		||||
            'https://esphome.io'
 | 
			
		||||
 | 
			
		||||
    def fetch_remote_version(self):
 | 
			
		||||
        import requests
 | 
			
		||||
 | 
			
		||||
        storage = EsphomeStorageJSON.load(self._path) or \
 | 
			
		||||
            EsphomeStorageJSON.get_default()
 | 
			
		||||
        if not storage.should_do_esphome_update_check:
 | 
			
		||||
            return storage
 | 
			
		||||
 | 
			
		||||
        req = requests.get('{}/_static/version'.format(self.docs_base))
 | 
			
		||||
        req.raise_for_status()
 | 
			
		||||
        storage.remote_version = req.text.strip()
 | 
			
		||||
        storage.last_update_check = datetime.utcnow()
 | 
			
		||||
        storage.save(self._path)
 | 
			
		||||
        return storage
 | 
			
		||||
 | 
			
		||||
    @staticmethod
 | 
			
		||||
    def format_version(ver):
 | 
			
		||||
        vstr = '.'.join(map(str, ver.version))
 | 
			
		||||
        if ver.prerelease:
 | 
			
		||||
            vstr += ver.prerelease[0] + str(ver.prerelease[1])
 | 
			
		||||
        return vstr
 | 
			
		||||
 | 
			
		||||
    def cmp_versions(self, storage):
 | 
			
		||||
        # pylint: disable=no-name-in-module, import-error
 | 
			
		||||
        from distutils.version import StrictVersion
 | 
			
		||||
 | 
			
		||||
        remote_version = StrictVersion(storage.remote_version)
 | 
			
		||||
        self_version = StrictVersion(const.__version__)
 | 
			
		||||
        if remote_version > self_version:
 | 
			
		||||
            _LOGGER.warning("*" * 80)
 | 
			
		||||
            _LOGGER.warning("A new version of ESPHome is available: %s (this is %s)",
 | 
			
		||||
                            self.format_version(remote_version), self.format_version(self_version))
 | 
			
		||||
            _LOGGER.warning("Changelog: %s/changelog/index.html", self.docs_base)
 | 
			
		||||
            _LOGGER.warning("Update Instructions: %s/guides/faq.html"
 | 
			
		||||
                            "#how-do-i-update-to-the-latest-version", self.docs_base)
 | 
			
		||||
            _LOGGER.warning("*" * 80)
 | 
			
		||||
 | 
			
		||||
    def run(self):
 | 
			
		||||
        try:
 | 
			
		||||
            storage = self.fetch_remote_version()
 | 
			
		||||
            self.cmp_versions(storage)
 | 
			
		||||
        except Exception:  # pylint: disable=broad-except
 | 
			
		||||
            pass
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def start_update_check_thread(path):
 | 
			
		||||
    # dummy call to strptime as python 2.7 has a bug with strptime when importing from threads
 | 
			
		||||
    datetime.strptime('20180101', '%Y%m%d')
 | 
			
		||||
    thread = CheckForUpdateThread(os.path.abspath(path))
 | 
			
		||||
    thread.start()
 | 
			
		||||
    return thread
 | 
			
		||||
 
 | 
			
		||||
@@ -8,10 +8,10 @@ import re
 | 
			
		||||
import shutil
 | 
			
		||||
 | 
			
		||||
from esphome.config import iter_components
 | 
			
		||||
from esphome.const import ARDUINO_VERSION_ESP32_DEV, ARDUINO_VERSION_ESP8266_DEV, \
 | 
			
		||||
    CONF_ARDUINO_VERSION, CONF_BOARD_FLASH_MODE, CONF_BRANCH, CONF_COMMIT, CONF_ESPHOME, \
 | 
			
		||||
    CONF_LOCAL, \
 | 
			
		||||
    CONF_PLATFORMIO_OPTIONS, CONF_REPOSITORY, CONF_TAG, CONF_USE_CUSTOM_CODE
 | 
			
		||||
from esphome.const import ARDUINO_VERSION_ESP32_1_0_1, ARDUINO_VERSION_ESP32_DEV, \
 | 
			
		||||
    ARDUINO_VERSION_ESP8266_2_5_0, ARDUINO_VERSION_ESP8266_DEV, CONF_BOARD_FLASH_MODE, \
 | 
			
		||||
    CONF_BRANCH, CONF_COMMIT, CONF_ESPHOME, CONF_LOCAL, CONF_PLATFORMIO_OPTIONS, CONF_REPOSITORY, \
 | 
			
		||||
    CONF_TAG, CONF_USE_CUSTOM_CODE
 | 
			
		||||
from esphome.core import CORE, EsphomeError
 | 
			
		||||
from esphome.core_config import GITHUB_ARCHIVE_ZIP, LIBRARY_URI_REPO, VERSION_REGEX
 | 
			
		||||
from esphome.helpers import mkdir_p, run_system_command
 | 
			
		||||
@@ -285,11 +285,13 @@ def gather_lib_deps():
 | 
			
		||||
        lib_deps.discard('AsyncTCP@1.0.3')
 | 
			
		||||
 | 
			
		||||
        # Manual fix for AsyncTCP
 | 
			
		||||
        if CORE.config[CONF_ESPHOME].get(CONF_ARDUINO_VERSION) == ARDUINO_VERSION_ESP32_DEV:
 | 
			
		||||
        if CORE.arduino_version in (ARDUINO_VERSION_ESP32_DEV, ARDUINO_VERSION_ESP32_1_0_1):
 | 
			
		||||
            lib_deps.add('AsyncTCP@1.0.3')
 | 
			
		||||
            lib_deps.discard('AsyncTCP@1.0.1')
 | 
			
		||||
        lib_deps.add('ESPmDNS')
 | 
			
		||||
    elif CORE.is_esp8266:
 | 
			
		||||
        lib_deps.add('ESPAsyncTCP@1.1.3')
 | 
			
		||||
        lib_deps.add('ESP8266mDNS')
 | 
			
		||||
    # avoid changing build flags order
 | 
			
		||||
    lib_deps_l = list(lib_deps)
 | 
			
		||||
    lib_deps_l.sort()
 | 
			
		||||
@@ -356,14 +358,14 @@ def get_ini_content():
 | 
			
		||||
        if CORE.arduino_version in ('espressif8266@1.8.0', 'espressif8266@1.7.3',
 | 
			
		||||
                                    'espressif8266@1.6.0', 'espressif8266@1.5.0'):
 | 
			
		||||
            ld_script = ld_scripts[0]
 | 
			
		||||
        elif CORE.arduino_version == ARDUINO_VERSION_ESP8266_DEV:
 | 
			
		||||
        elif CORE.arduino_version in (ARDUINO_VERSION_ESP8266_DEV, ARDUINO_VERSION_ESP8266_2_5_0):
 | 
			
		||||
            ld_script = ld_scripts[1]
 | 
			
		||||
 | 
			
		||||
        if ld_script is not None:
 | 
			
		||||
            build_flags.append('-Wl,-T{}'.format(ld_script))
 | 
			
		||||
 | 
			
		||||
    data = {
 | 
			
		||||
        'platform': CORE.config[CONF_ESPHOME][CONF_ARDUINO_VERSION],
 | 
			
		||||
        'platform': CORE.arduino_version,
 | 
			
		||||
        'board': CORE.board,
 | 
			
		||||
        'framework': 'arduino',
 | 
			
		||||
        'lib_deps': lib_deps + ['${common.lib_deps}'],
 | 
			
		||||
@@ -393,7 +395,6 @@ def get_ini_content():
 | 
			
		||||
        data['lib_ldf_mode'] = 'chain'
 | 
			
		||||
        REMOVABLE_LIBRARIES = [
 | 
			
		||||
            'ArduinoOTA',
 | 
			
		||||
            'ESPmDNS',
 | 
			
		||||
            'Update',
 | 
			
		||||
            'Wire',
 | 
			
		||||
            'FastLED',
 | 
			
		||||
 
 | 
			
		||||
@@ -2,108 +2,7 @@
 | 
			
		||||
 | 
			
		||||
[](https://esphomelib.com/esphomeyaml/index.html)
 | 
			
		||||
 | 
			
		||||
[](https://github.com/OttoWinter/esphomelib)
 | 
			
		||||
[![GitHub Release][releases-shield]][releases]
 | 
			
		||||
[![Discord][discord-shield]][discord]
 | 
			
		||||
# This Add-On has moved!
 | 
			
		||||
 | 
			
		||||
## About
 | 
			
		||||
 | 
			
		||||
This add-on allows you to manage and program your ESP8266 and ESP32 based microcontrollers
 | 
			
		||||
directly through Hass.io **with no programming experience required**. All you need to do
 | 
			
		||||
is write YAML configuration files; the rest (over-the-air updates, compiling) is all
 | 
			
		||||
handled by esphomeyaml.
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
<img title="esphomeyaml dashboard screenshot" src="https://raw.githubusercontent.com/OttoWinter/esphomeyaml/dev/esphomeyaml-edge/images/screenshot.png" width="700px"></img>
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
[_View the esphomeyaml documentation here_](https://esphomelib.com/esphomeyaml/index.html)
 | 
			
		||||
 | 
			
		||||
## Example
 | 
			
		||||
 | 
			
		||||
With esphomeyaml, you can go from a few lines of YAML straight to a custom-made
 | 
			
		||||
firmware. For example, to include a [DHT22][dht22].
 | 
			
		||||
temperature and humidity sensor, you just need to include 8 lines of YAML
 | 
			
		||||
in your configuration file:
 | 
			
		||||
 | 
			
		||||
<img title="esphomeyaml DHT configuration example" src="https://raw.githubusercontent.com/OttoWinter/esphomeyaml/dev/esphomeyaml-edge/images/dht-example.png" width="500px"></img>
 | 
			
		||||
 | 
			
		||||
Then just click UPLOAD and the sensor will magically appear in Home Assistant:
 | 
			
		||||
 | 
			
		||||
<img title="esphomelib Home Assistant MQTT discovery" src="https://raw.githubusercontent.com/OttoWinter/esphomeyaml/dev/esphomeyaml-edge/images/temperature-humidity.png" width="600px"></img>
 | 
			
		||||
 | 
			
		||||
## Installation
 | 
			
		||||
 | 
			
		||||
To install this Hass.io add-on you need to add the esphomeyaml add-on repository
 | 
			
		||||
first:
 | 
			
		||||
 | 
			
		||||
1. Add the epshomeyaml add-ons repository to your Hass.io instance. You can do this by navigating to the "Add-on Store" tab in the Hass.io panel and then entering https://github.com/OttoWinter/esphomeyaml in the "Add new repository by URL" field.
 | 
			
		||||
2. Now scroll down and select the "esphomeyaml" add-on.
 | 
			
		||||
3. Press install to download the add-on and unpack it on your machine. This can take some time.
 | 
			
		||||
4. Optional: If you're using SSL certificates and want to encrypt your communication to this add-on, please enter `true` into the `ssl` field and set the `fullchain` and `certfile` options accordingly.
 | 
			
		||||
5. Start the add-on, check the logs of the add-on to see if everything went well.
 | 
			
		||||
6. Click "OPEN WEB UI" to open the esphomeyaml dashboard. You will be asked for your Home Assistant credentials - esphomeyaml uses Hass.io's authentication system to log you in.
 | 
			
		||||
 | 
			
		||||
**NOTE**: Installation on RPis running in 64-bit mode is currently not possible. Please use the 32-bit variant of HassOS instead.
 | 
			
		||||
 | 
			
		||||
You can view the esphomeyaml docs here: https://esphomelib.com/esphomeyaml/index.html
 | 
			
		||||
 | 
			
		||||
## Configuration
 | 
			
		||||
 | 
			
		||||
**Note**: _Remember to restart the add-on when the configuration is changed._
 | 
			
		||||
 | 
			
		||||
Example add-on configuration:
 | 
			
		||||
 | 
			
		||||
```json
 | 
			
		||||
{
 | 
			
		||||
  "ssl": false,
 | 
			
		||||
  "certfile": "fullchain.pem",
 | 
			
		||||
  "keyfile": "privkey.pem",
 | 
			
		||||
  "port": 6052
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### Option: `port`
 | 
			
		||||
 | 
			
		||||
The port to start the dashboard server on. Default is 6052.
 | 
			
		||||
 | 
			
		||||
### Option: `ssl`
 | 
			
		||||
 | 
			
		||||
Enables/Disables encrypted SSL (HTTPS) connections to the web server of this add-on.
 | 
			
		||||
Set it to `true` to encrypt communications, `false` otherwise.
 | 
			
		||||
Please note that if you set this to `true` you must also generate the key and certificate
 | 
			
		||||
files for encryption. For example using [Let's Encrypt](https://www.home-assistant.io/addons/lets_encrypt/)
 | 
			
		||||
or [Self-signed certificates](https://www.home-assistant.io/docs/ecosystem/certificates/tls_self_signed_certificate/).
 | 
			
		||||
 | 
			
		||||
### Option: `certfile`
 | 
			
		||||
 | 
			
		||||
The certificate file to use for SSL. If this file doesn't exist, the add-on start will fail.
 | 
			
		||||
 | 
			
		||||
**Note**: The file MUST be stored in `/ssl/`, which is the default for Hass.io
 | 
			
		||||
 | 
			
		||||
### Option: `keyfile`
 | 
			
		||||
 | 
			
		||||
The private key file to use for SSL. If this file doesn't exist, the add-on start will fail.
 | 
			
		||||
 | 
			
		||||
**Note**: The file MUST be stored in `/ssl/`, which is the default for Hass.io
 | 
			
		||||
 | 
			
		||||
### Option: `leave_front_door_open`
 | 
			
		||||
 | 
			
		||||
Adding this option to the add-on configuration allows you to disable
 | 
			
		||||
authentication by setting it to `true`.
 | 
			
		||||
 | 
			
		||||
### Option: `esphomeyaml_version`
 | 
			
		||||
 | 
			
		||||
Manually override which esphomeyaml version to use in the addon.
 | 
			
		||||
For example to install the latest development version, use `"esphomeyaml_version": "dev"`,
 | 
			
		||||
or for version 1.10.0: `"esphomeyaml_version": "v1.10.0""`.
 | 
			
		||||
 
 | 
			
		||||
Please note that this does not always work and is only meant for testing, usually the
 | 
			
		||||
esphomeyaml add-on and dashboard version must match to guarantee a working system.  
 | 
			
		||||
 | 
			
		||||
[discord-shield]: https://img.shields.io/discord/429907082951524364.svg
 | 
			
		||||
[dht22]: https://esphomelib.com/esphomeyaml/components/sensor/dht.html
 | 
			
		||||
[discord]: https://discord.me/KhAMKrd
 | 
			
		||||
[releases-shield]: https://img.shields.io/github/release/OttoWinter/esphomeyaml.svg
 | 
			
		||||
[releases]: https://esphomelib.com/esphomeyaml/changelog/index.html
 | 
			
		||||
[repository]: https://github.com/OttoWinter/esphomeyaml
 | 
			
		||||
See https://esphome.io/changelog/v1.11.0.html#installation-methods-changed
 | 
			
		||||
for updated instructions
 | 
			
		||||
 
 | 
			
		||||
| 
		 Before Width: | Height: | Size: 2.8 KiB  | 
| 
		 Before Width: | Height: | Size: 8.6 KiB  | 
@@ -1,59 +0,0 @@
 | 
			
		||||
ARG BUILD_FROM=hassioaddons/ubuntu-base:2.2.1
 | 
			
		||||
# hadolint ignore=DL3006
 | 
			
		||||
FROM ${BUILD_FROM}
 | 
			
		||||
 | 
			
		||||
# Set shell
 | 
			
		||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
 | 
			
		||||
 | 
			
		||||
# Copy root filesystem
 | 
			
		||||
COPY rootfs /
 | 
			
		||||
 | 
			
		||||
RUN \
 | 
			
		||||
    # Temporarily move nginx.conf (otherwise dpkg fails)
 | 
			
		||||
    mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bkp \
 | 
			
		||||
    # Install add-on dependencies
 | 
			
		||||
    && apt-get update \
 | 
			
		||||
    && apt-get install -y --no-install-recommends \
 | 
			
		||||
        # Python 2 for ESPHome
 | 
			
		||||
        python \
 | 
			
		||||
        python-pip \
 | 
			
		||||
        python-setuptools \
 | 
			
		||||
        # Python Pillow for display component
 | 
			
		||||
        python-pil \
 | 
			
		||||
        # Git for esphomelib downloads
 | 
			
		||||
        git \
 | 
			
		||||
        # NGINX proxy
 | 
			
		||||
        nginx \
 | 
			
		||||
    \
 | 
			
		||||
    && mv /etc/nginx/nginx.conf.bkp /etc/nginx/nginx.conf \
 | 
			
		||||
    \
 | 
			
		||||
    && pip2 install --no-cache-dir --no-binary :all: https://github.com/esphome/esphome/archive/dev.zip \
 | 
			
		||||
    \
 | 
			
		||||
    # Change some platformio settings
 | 
			
		||||
    && platformio settings set enable_telemetry No \
 | 
			
		||||
    && platformio settings set check_libraries_interval 1000000 \
 | 
			
		||||
    && platformio settings set check_platformio_interval 1000000 \
 | 
			
		||||
    && platformio settings set check_platforms_interval 1000000 \
 | 
			
		||||
    \
 | 
			
		||||
    # Build an empty platformio project to force platformio to install all fw build dependencies
 | 
			
		||||
    # The return-code will be non-zero since there's nothing to build.
 | 
			
		||||
    && (platformio run -d /opt/pio; echo "Done") \
 | 
			
		||||
    \
 | 
			
		||||
    # Cleanup
 | 
			
		||||
    && rm -fr \
 | 
			
		||||
        /tmp/* \
 | 
			
		||||
        /var/{cache,log}/* \
 | 
			
		||||
        /var/lib/apt/lists/* \
 | 
			
		||||
        /opt/pio/
 | 
			
		||||
 | 
			
		||||
# Build arugments
 | 
			
		||||
ARG BUILD_ARCH=amd64
 | 
			
		||||
ARG BUILD_VERSION
 | 
			
		||||
 | 
			
		||||
# Labels
 | 
			
		||||
LABEL \
 | 
			
		||||
    io.hass.name="ESPHome" \
 | 
			
		||||
    io.hass.description="Manage and program ESP8266/ESP32 microcontrollers through YAML configuration files" \
 | 
			
		||||
    io.hass.arch="${BUILD_ARCH}" \
 | 
			
		||||
    io.hass.type="addon" \
 | 
			
		||||
    io.hass.version=${BUILD_VERSION}
 | 
			
		||||
@@ -1,109 +0,0 @@
 | 
			
		||||
# Esphomeyaml Hass.io Add-On
 | 
			
		||||
 | 
			
		||||
[](https://esphomelib.com/esphomeyaml/index.html)
 | 
			
		||||
 | 
			
		||||
[](https://github.com/OttoWinter/esphomelib)
 | 
			
		||||
[![GitHub Release][releases-shield]][releases]
 | 
			
		||||
[![Discord][discord-shield]][discord]
 | 
			
		||||
 | 
			
		||||
## About
 | 
			
		||||
 | 
			
		||||
This add-on allows you to manage and program your ESP8266 and ESP32 based microcontrollers
 | 
			
		||||
directly through Hass.io **with no programming experience required**. All you need to do
 | 
			
		||||
is write YAML configuration files; the rest (over-the-air updates, compiling) is all
 | 
			
		||||
handled by esphomeyaml.
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
<img title="esphomeyaml dashboard screenshot" src="https://raw.githubusercontent.com/OttoWinter/esphomeyaml/dev/esphomeyaml-edge/images/screenshot.png" width="700px"></img>
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
[_View the esphomeyaml documentation here_](https://esphomelib.com/esphomeyaml/index.html)
 | 
			
		||||
 | 
			
		||||
## Example
 | 
			
		||||
 | 
			
		||||
With esphomeyaml, you can go from a few lines of YAML straight to a custom-made
 | 
			
		||||
firmware. For example, to include a [DHT22][dht22].
 | 
			
		||||
temperature and humidity sensor, you just need to include 8 lines of YAML
 | 
			
		||||
in your configuration file:
 | 
			
		||||
 | 
			
		||||
<img title="esphomeyaml DHT configuration example" src="https://raw.githubusercontent.com/OttoWinter/esphomeyaml/dev/esphomeyaml-edge/images/dht-example.png" width="500px"></img>
 | 
			
		||||
 | 
			
		||||
Then just click UPLOAD and the sensor will magically appear in Home Assistant:
 | 
			
		||||
 | 
			
		||||
<img title="esphomelib Home Assistant MQTT discovery" src="https://raw.githubusercontent.com/OttoWinter/esphomeyaml/dev/esphomeyaml-edge/images/temperature-humidity.png" width="600px"></img>
 | 
			
		||||
 | 
			
		||||
## Installation
 | 
			
		||||
 | 
			
		||||
To install this Hass.io add-on you need to add the esphomeyaml add-on repository
 | 
			
		||||
first:
 | 
			
		||||
 | 
			
		||||
1. Add the epshomeyaml add-ons repository to your Hass.io instance. You can do this by navigating to the "Add-on Store" tab in the Hass.io panel and then entering https://github.com/OttoWinter/esphomeyaml in the "Add new repository by URL" field.
 | 
			
		||||
2. Now scroll down and select the "esphomeyaml" add-on.
 | 
			
		||||
3. Press install to download the add-on and unpack it on your machine. This can take some time.
 | 
			
		||||
4. Optional: If you're using SSL certificates and want to encrypt your communication to this add-on, please enter `true` into the `ssl` field and set the `fullchain` and `certfile` options accordingly.
 | 
			
		||||
5. Start the add-on, check the logs of the add-on to see if everything went well.
 | 
			
		||||
6. Click "OPEN WEB UI" to open the esphomeyaml dashboard. You will be asked for your Home Assistant credentials - esphomeyaml uses Hass.io's authentication system to log you in.
 | 
			
		||||
 | 
			
		||||
**NOTE**: Installation on RPis running in 64-bit mode is currently not possible. Please use the 32-bit variant of HassOS instead.
 | 
			
		||||
 | 
			
		||||
You can view the esphomeyaml docs here: https://esphomelib.com/esphomeyaml/index.html
 | 
			
		||||
 | 
			
		||||
## Configuration
 | 
			
		||||
 | 
			
		||||
**Note**: _Remember to restart the add-on when the configuration is changed._
 | 
			
		||||
 | 
			
		||||
Example add-on configuration:
 | 
			
		||||
 | 
			
		||||
```json
 | 
			
		||||
{
 | 
			
		||||
  "ssl": false,
 | 
			
		||||
  "certfile": "fullchain.pem",
 | 
			
		||||
  "keyfile": "privkey.pem",
 | 
			
		||||
  "port": 6052
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### Option: `port`
 | 
			
		||||
 | 
			
		||||
The port to start the dashboard server on. Default is 6052.
 | 
			
		||||
 | 
			
		||||
### Option: `ssl`
 | 
			
		||||
 | 
			
		||||
Enables/Disables encrypted SSL (HTTPS) connections to the web server of this add-on.
 | 
			
		||||
Set it to `true` to encrypt communications, `false` otherwise.
 | 
			
		||||
Please note that if you set this to `true` you must also generate the key and certificate
 | 
			
		||||
files for encryption. For example using [Let's Encrypt](https://www.home-assistant.io/addons/lets_encrypt/)
 | 
			
		||||
or [Self-signed certificates](https://www.home-assistant.io/docs/ecosystem/certificates/tls_self_signed_certificate/).
 | 
			
		||||
 | 
			
		||||
### Option: `certfile`
 | 
			
		||||
 | 
			
		||||
The certificate file to use for SSL. If this file doesn't exist, the add-on start will fail.
 | 
			
		||||
 | 
			
		||||
**Note**: The file MUST be stored in `/ssl/`, which is the default for Hass.io
 | 
			
		||||
 | 
			
		||||
### Option: `keyfile`
 | 
			
		||||
 | 
			
		||||
The private key file to use for SSL. If this file doesn't exist, the add-on start will fail.
 | 
			
		||||
 | 
			
		||||
**Note**: The file MUST be stored in `/ssl/`, which is the default for Hass.io
 | 
			
		||||
 | 
			
		||||
### Option: `leave_front_door_open`
 | 
			
		||||
 | 
			
		||||
Adding this option to the add-on configuration allows you to disable
 | 
			
		||||
authentication by setting it to `true`.
 | 
			
		||||
 | 
			
		||||
### Option: `esphomeyaml_version`
 | 
			
		||||
 | 
			
		||||
Manually override which esphomeyaml version to use in the addon.
 | 
			
		||||
For example to install the latest development version, use `"esphomeyaml_version": "dev"`,
 | 
			
		||||
or for version 1.10.0: `"esphomeyaml_version": "v1.10.0""`.
 | 
			
		||||
 
 | 
			
		||||
Please note that this does not always work and is only meant for testing, usually the
 | 
			
		||||
esphomeyaml add-on and dashboard version must match to guarantee a working system.  
 | 
			
		||||
 | 
			
		||||
[discord-shield]: https://img.shields.io/discord/429907082951524364.svg
 | 
			
		||||
[dht22]: https://esphomelib.com/esphomeyaml/components/sensor/dht.html
 | 
			
		||||
[discord]: https://discord.me/KhAMKrd
 | 
			
		||||
[releases-shield]: https://img.shields.io/github/release/OttoWinter/esphomeyaml.svg
 | 
			
		||||
[releases]: https://esphomelib.com/esphomeyaml/changelog/index.html
 | 
			
		||||
[repository]: https://github.com/OttoWinter/esphomeyaml
 | 
			
		||||
@@ -1,10 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "squash": false,
 | 
			
		||||
  "build_from": {
 | 
			
		||||
    "aarch64": "hassioaddons/ubuntu-base-aarch64:2.2.1",
 | 
			
		||||
    "amd64": "hassioaddons/ubuntu-base-amd64:2.2.1",
 | 
			
		||||
    "armhf": "hassioaddons/ubuntu-base-armhf:2.2.1",
 | 
			
		||||
    "i386": "hassioaddons/ubuntu-base-i386:2.2.1"
 | 
			
		||||
  },
 | 
			
		||||
  "args": {}
 | 
			
		||||
}
 | 
			
		||||
@@ -1,40 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "esphomeyaml-edge",
 | 
			
		||||
  "version": "dev",
 | 
			
		||||
  "slug": "esphomeyaml-edge",
 | 
			
		||||
  "description": "Development Version! Manage and program ESP8266/ESP32 microcontrollers through YAML configuration files",
 | 
			
		||||
  "url": "https://github.com/OttoWinter/esphomeyaml/tree/dev/esphomeyaml-edge/README.md",
 | 
			
		||||
  "webui": "http://[HOST]:[PORT:6052]",
 | 
			
		||||
  "startup": "application",
 | 
			
		||||
  "arch": [
 | 
			
		||||
    "amd64",
 | 
			
		||||
    "armhf",
 | 
			
		||||
    "i386"
 | 
			
		||||
  ],
 | 
			
		||||
  "hassio_api": true,
 | 
			
		||||
  "auth_api": true,
 | 
			
		||||
  "hassio_role": "default",
 | 
			
		||||
  "homeassistant_api": false,
 | 
			
		||||
  "host_network": true,
 | 
			
		||||
  "boot": "auto",
 | 
			
		||||
  "auto_uart": true,
 | 
			
		||||
  "map": [
 | 
			
		||||
    "ssl",
 | 
			
		||||
    "config:rw"
 | 
			
		||||
  ],
 | 
			
		||||
  "options": {
 | 
			
		||||
    "ssl": false,
 | 
			
		||||
    "certfile": "fullchain.pem",
 | 
			
		||||
    "keyfile": "privkey.pem",
 | 
			
		||||
    "port": 6052,
 | 
			
		||||
    "esphome_version": "dev"
 | 
			
		||||
  },
 | 
			
		||||
  "schema": {
 | 
			
		||||
    "ssl": "bool",
 | 
			
		||||
    "certfile": "str",
 | 
			
		||||
    "keyfile": "str",
 | 
			
		||||
    "port": "int",
 | 
			
		||||
    "leave_front_door_open": "bool?",
 | 
			
		||||
    "esphome_version": "str?"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
		 Before Width: | Height: | Size: 2.8 KiB  | 
| 
		 Before Width: | Height: | Size: 17 KiB  | 
| 
		 Before Width: | Height: | Size: 50 KiB  | 
| 
		 Before Width: | Height: | Size: 5.3 KiB  | 
| 
		 Before Width: | Height: | Size: 8.6 KiB  | 
@@ -1,35 +0,0 @@
 | 
			
		||||
#!/usr/bin/with-contenv bash
 | 
			
		||||
# ==============================================================================
 | 
			
		||||
# Community Hass.io Add-ons: ESPHome
 | 
			
		||||
# This files check if all user configuration requirements are met
 | 
			
		||||
# ==============================================================================
 | 
			
		||||
# shellcheck disable=SC1091
 | 
			
		||||
source /usr/lib/hassio-addons/base.sh
 | 
			
		||||
 | 
			
		||||
# Check SSL requirements, if enabled
 | 
			
		||||
if hass.config.true 'ssl'; then
 | 
			
		||||
    if ! hass.config.has_value 'certfile'; then
 | 
			
		||||
        hass.die 'SSL is enabled, but no certfile was specified.'
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
    if ! hass.config.has_value 'keyfile'; then
 | 
			
		||||
        hass.die 'SSL is enabled, but no keyfile was specified'
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
    if ! hass.file_exists "/ssl/$(hass.config.get 'certfile')"; then
 | 
			
		||||
        if ! hass.file_exists "/ssl/$(hass.config.get 'keyfile')"; then
 | 
			
		||||
            # Both files are missing, let's print a friendlier error message
 | 
			
		||||
            text="You enabled encrypted connections using the \"ssl\": true option.
 | 
			
		||||
            However, the SSL files \"$(hass.config.get 'certfile')\" and \"$(hass.config.get 'keyfile')\"
 | 
			
		||||
            were not found. If you're using Hass.io on your local network and don't want
 | 
			
		||||
            to encrypt connections to the ESPHome dashboard, you can manually disable
 | 
			
		||||
            SSL by setting \"ssl\" to false."
 | 
			
		||||
            hass.die "${text}"
 | 
			
		||||
        fi
 | 
			
		||||
        hass.die 'The configured certfile is not found'
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
    if ! hass.file_exists "/ssl/$(hass.config.get 'keyfile')"; then
 | 
			
		||||
        hass.die 'The configured keyfile is not found'
 | 
			
		||||
    fi
 | 
			
		||||
fi
 | 
			
		||||
@@ -1,28 +0,0 @@
 | 
			
		||||
#!/usr/bin/with-contenv bash
 | 
			
		||||
# ==============================================================================
 | 
			
		||||
# Community Hass.io Add-ons: ESPHome
 | 
			
		||||
# Configures NGINX for use with ESPHome
 | 
			
		||||
# ==============================================================================
 | 
			
		||||
# shellcheck disable=SC1091
 | 
			
		||||
source /usr/lib/hassio-addons/base.sh
 | 
			
		||||
 | 
			
		||||
declare certfile
 | 
			
		||||
declare keyfile
 | 
			
		||||
declare port
 | 
			
		||||
 | 
			
		||||
mkdir -p /var/log/nginx
 | 
			
		||||
 | 
			
		||||
# Enable SSL
 | 
			
		||||
if hass.config.true 'ssl'; then
 | 
			
		||||
    rm /etc/nginx/nginx.conf
 | 
			
		||||
    mv /etc/nginx/nginx-ssl.conf /etc/nginx/nginx.conf
 | 
			
		||||
 | 
			
		||||
    certfile=$(hass.config.get 'certfile')
 | 
			
		||||
    keyfile=$(hass.config.get 'keyfile')
 | 
			
		||||
 | 
			
		||||
    sed -i "s/%%certfile%%/${certfile}/g" /etc/nginx/nginx.conf
 | 
			
		||||
    sed -i "s/%%keyfile%%/${keyfile}/g" /etc/nginx/nginx.conf
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
port=$(hass.config.get 'port')
 | 
			
		||||
sed -i "s/%%port%%/${port}/g" /etc/nginx/nginx.conf
 | 
			
		||||
@@ -1,14 +0,0 @@
 | 
			
		||||
#!/usr/bin/with-contenv bash
 | 
			
		||||
# ==============================================================================
 | 
			
		||||
# Community Hass.io Add-ons: ESPHome
 | 
			
		||||
# This files installs the user ESPHome version if specified
 | 
			
		||||
# ==============================================================================
 | 
			
		||||
# shellcheck disable=SC1091
 | 
			
		||||
source /usr/lib/hassio-addons/base.sh
 | 
			
		||||
 | 
			
		||||
declare esphome_version
 | 
			
		||||
 | 
			
		||||
if hass.config.has_value 'esphome_version'; then
 | 
			
		||||
    esphome_version=$(hass.config.get 'esphome_version')
 | 
			
		||||
    pip2 install --no-cache-dir --no-binary :all: "https://github.com/esphome/esphome/archive/${esphome_version}.zip"
 | 
			
		||||
fi
 | 
			
		||||
@@ -1,13 +0,0 @@
 | 
			
		||||
#!/usr/bin/with-contenv bash
 | 
			
		||||
# ==============================================================================
 | 
			
		||||
# Community Hass.io Add-ons: ESPHome
 | 
			
		||||
# This files migrates the esphome config directory from the old path
 | 
			
		||||
# ==============================================================================
 | 
			
		||||
# shellcheck disable=SC1091
 | 
			
		||||
source /usr/lib/hassio-addons/base.sh
 | 
			
		||||
 | 
			
		||||
if [[ ! -d /config/esphome && -d /config/esphomeyaml ]]; then
 | 
			
		||||
    echo "Moving config directory from /config/esphomeyaml to /config/esphome"
 | 
			
		||||
    mv /config/esphomeyaml /config/esphome
 | 
			
		||||
    mv /config/esphome/.esphomeyaml /config/esphome/.esphome
 | 
			
		||||
fi
 | 
			
		||||
@@ -1,62 +0,0 @@
 | 
			
		||||
worker_processes  1;
 | 
			
		||||
pid /var/run/nginx.pid;
 | 
			
		||||
error_log stderr;
 | 
			
		||||
 | 
			
		||||
events {
 | 
			
		||||
    worker_connections  1024;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
http {
 | 
			
		||||
    access_log         stdout;
 | 
			
		||||
    include            mime.types;
 | 
			
		||||
    default_type       application/octet-stream;
 | 
			
		||||
    sendfile           on;
 | 
			
		||||
    keepalive_timeout  65;
 | 
			
		||||
 | 
			
		||||
    upstream esphome {
 | 
			
		||||
        ip_hash;
 | 
			
		||||
        server unix:/var/run/esphome.sock;
 | 
			
		||||
    }
 | 
			
		||||
    map $http_upgrade $connection_upgrade {
 | 
			
		||||
        default upgrade;
 | 
			
		||||
        ''      close;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    server {
 | 
			
		||||
        server_name hassio.local;
 | 
			
		||||
        listen %%port%% default_server ssl;
 | 
			
		||||
        root /dev/null;
 | 
			
		||||
 | 
			
		||||
        ssl_certificate /ssl/%%certfile%%;
 | 
			
		||||
        ssl_certificate_key /ssl/%%keyfile%%;
 | 
			
		||||
        ssl_protocols TLSv1.2;
 | 
			
		||||
        ssl_prefer_server_ciphers on;
 | 
			
		||||
        ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA;
 | 
			
		||||
        ssl_ecdh_curve secp384r1;
 | 
			
		||||
        ssl_session_timeout  10m;
 | 
			
		||||
        ssl_session_cache shared:SSL:10m;
 | 
			
		||||
        ssl_session_tickets off;
 | 
			
		||||
        ssl_stapling on;
 | 
			
		||||
        ssl_stapling_verify on;
 | 
			
		||||
 | 
			
		||||
        # Redirect http requests to https on the same port.
 | 
			
		||||
        # https://rageagainstshell.com/2016/11/redirect-http-to-https-on-the-same-port-in-nginx/
 | 
			
		||||
        error_page 497 https://$http_host$request_uri;
 | 
			
		||||
 | 
			
		||||
        location / {
 | 
			
		||||
            proxy_redirect off;
 | 
			
		||||
            proxy_pass http://esphome;
 | 
			
		||||
 | 
			
		||||
            proxy_http_version 1.1;
 | 
			
		||||
            proxy_set_header Upgrade $http_upgrade;
 | 
			
		||||
            proxy_set_header Connection $connection_upgrade;
 | 
			
		||||
            proxy_set_header Authorization "";
 | 
			
		||||
 | 
			
		||||
            proxy_set_header X-Real-IP $remote_addr;
 | 
			
		||||
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 | 
			
		||||
            proxy_set_header X-Forwarded-Proto $scheme;
 | 
			
		||||
            proxy_set_header Host $http_host;
 | 
			
		||||
            proxy_set_header X-NginX-Proxy true;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,46 +0,0 @@
 | 
			
		||||
worker_processes  1;
 | 
			
		||||
pid /var/run/nginx.pid;
 | 
			
		||||
error_log stderr;
 | 
			
		||||
 | 
			
		||||
events {
 | 
			
		||||
    worker_connections  1024;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
http {
 | 
			
		||||
    access_log         stdout;
 | 
			
		||||
    include            mime.types;
 | 
			
		||||
    default_type       application/octet-stream;
 | 
			
		||||
    sendfile           on;
 | 
			
		||||
    keepalive_timeout  65;
 | 
			
		||||
 | 
			
		||||
    upstream esphome {
 | 
			
		||||
        ip_hash;
 | 
			
		||||
        server unix:/var/run/esphome.sock;
 | 
			
		||||
    }
 | 
			
		||||
    map $http_upgrade $connection_upgrade {
 | 
			
		||||
        default upgrade;
 | 
			
		||||
        ''      close;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    server {
 | 
			
		||||
        server_name hassio.local;
 | 
			
		||||
        listen %%port%% default_server;
 | 
			
		||||
        root /dev/null;
 | 
			
		||||
 | 
			
		||||
        location / {
 | 
			
		||||
            proxy_redirect off;
 | 
			
		||||
            proxy_pass http://esphome;
 | 
			
		||||
 | 
			
		||||
            proxy_http_version 1.1;
 | 
			
		||||
            proxy_set_header Upgrade $http_upgrade;
 | 
			
		||||
            proxy_set_header Connection $connection_upgrade;
 | 
			
		||||
            proxy_set_header Authorization "";
 | 
			
		||||
 | 
			
		||||
            proxy_set_header X-Real-IP $remote_addr;
 | 
			
		||||
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 | 
			
		||||
            proxy_set_header X-Forwarded-Proto $scheme;
 | 
			
		||||
            proxy_set_header Host $http_host;
 | 
			
		||||
            proxy_set_header X-NginX-Proxy true;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,9 +0,0 @@
 | 
			
		||||
#!/usr/bin/execlineb -S0
 | 
			
		||||
# ==============================================================================
 | 
			
		||||
# Community Hass.io Add-ons: ESPHome
 | 
			
		||||
# Take down the S6 supervision tree when ESPHome fails
 | 
			
		||||
# ==============================================================================
 | 
			
		||||
if -n { s6-test $# -ne 0 }
 | 
			
		||||
if -n { s6-test ${1} -eq 256 }
 | 
			
		||||
 | 
			
		||||
s6-svscanctl -t /var/run/s6/services
 | 
			
		||||
@@ -1,14 +0,0 @@
 | 
			
		||||
#!/usr/bin/with-contenv bash
 | 
			
		||||
# ==============================================================================
 | 
			
		||||
# Community Hass.io Add-ons: ESPHome
 | 
			
		||||
# Runs the ESPHome dashboard
 | 
			
		||||
# ==============================================================================
 | 
			
		||||
# shellcheck disable=SC1091
 | 
			
		||||
source /usr/lib/hassio-addons/base.sh
 | 
			
		||||
 | 
			
		||||
if hass.config.true 'leave_front_door_open'; then
 | 
			
		||||
    export DISABLE_HA_AUTHENTICATION=true
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
hass.log.info "Starting ESPHome dashboard..."
 | 
			
		||||
exec esphome /config/esphome dashboard --socket /var/run/esphome.sock --hassio
 | 
			
		||||
@@ -1,9 +0,0 @@
 | 
			
		||||
#!/usr/bin/execlineb -S0
 | 
			
		||||
# ==============================================================================
 | 
			
		||||
# Community Hass.io Add-ons: ESPHome
 | 
			
		||||
# Take down the S6 supervision tree when NGINX fails
 | 
			
		||||
# ==============================================================================
 | 
			
		||||
if -n { s6-test $# -ne 0 }
 | 
			
		||||
if -n { s6-test ${1} -eq 256 }
 | 
			
		||||
 | 
			
		||||
s6-svscanctl -t /var/run/s6/services
 | 
			
		||||
@@ -1,10 +0,0 @@
 | 
			
		||||
#!/usr/bin/with-contenv bash
 | 
			
		||||
# ==============================================================================
 | 
			
		||||
# Community Hass.io Add-ons: ESPHome
 | 
			
		||||
# Runs the NGINX proxy
 | 
			
		||||
# ==============================================================================
 | 
			
		||||
# shellcheck disable=SC1091
 | 
			
		||||
source /usr/lib/hassio-addons/base.sh
 | 
			
		||||
 | 
			
		||||
hass.log.info "Starting NGINX..."
 | 
			
		||||
exec nginx -g "daemon off;"
 | 
			
		||||
@@ -1,12 +0,0 @@
 | 
			
		||||
; This file allows the docker build file to install the required platformio
 | 
			
		||||
; platforms
 | 
			
		||||
 | 
			
		||||
[env:espressif8266]
 | 
			
		||||
platform = espressif8266@1.8.0
 | 
			
		||||
board = nodemcuv2
 | 
			
		||||
framework = arduino
 | 
			
		||||
 | 
			
		||||
[env:espressif32]
 | 
			
		||||
platform = espressif32@1.5.0
 | 
			
		||||
board = nodemcu-32s
 | 
			
		||||
framework = arduino
 | 
			
		||||
@@ -2,108 +2,7 @@
 | 
			
		||||
 | 
			
		||||
[](https://esphomelib.com/esphomeyaml/index.html)
 | 
			
		||||
 | 
			
		||||
[](https://github.com/OttoWinter/esphomelib)
 | 
			
		||||
[![GitHub Release][releases-shield]][releases]
 | 
			
		||||
[![Discord][discord-shield]][discord]
 | 
			
		||||
# This Add-On has moved!
 | 
			
		||||
 | 
			
		||||
## About
 | 
			
		||||
 | 
			
		||||
This add-on allows you to manage and program your ESP8266 and ESP32 based microcontrollers
 | 
			
		||||
directly through Hass.io **with no programming experience required**. All you need to do
 | 
			
		||||
is write YAML configuration files; the rest (over-the-air updates, compiling) is all
 | 
			
		||||
handled by esphomeyaml.
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
<img title="esphomeyaml dashboard screenshot" src="https://raw.githubusercontent.com/OttoWinter/esphomeyaml/dev/esphomeyaml-edge/images/screenshot.png" width="700px"></img>
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
[_View the esphomeyaml documentation here_](https://esphomelib.com/esphomeyaml/index.html)
 | 
			
		||||
 | 
			
		||||
## Example
 | 
			
		||||
 | 
			
		||||
With esphomeyaml, you can go from a few lines of YAML straight to a custom-made
 | 
			
		||||
firmware. For example, to include a [DHT22][dht22].
 | 
			
		||||
temperature and humidity sensor, you just need to include 8 lines of YAML
 | 
			
		||||
in your configuration file:
 | 
			
		||||
 | 
			
		||||
<img title="esphomeyaml DHT configuration example" src="https://raw.githubusercontent.com/OttoWinter/esphomeyaml/dev/esphomeyaml-edge/images/dht-example.png" width="500px"></img>
 | 
			
		||||
 | 
			
		||||
Then just click UPLOAD and the sensor will magically appear in Home Assistant:
 | 
			
		||||
 | 
			
		||||
<img title="esphomelib Home Assistant MQTT discovery" src="https://raw.githubusercontent.com/OttoWinter/esphomeyaml/dev/esphomeyaml-edge/images/temperature-humidity.png" width="600px"></img>
 | 
			
		||||
 | 
			
		||||
## Installation
 | 
			
		||||
 | 
			
		||||
To install this Hass.io add-on you need to add the esphomeyaml add-on repository
 | 
			
		||||
first:
 | 
			
		||||
 | 
			
		||||
1. Add the epshomeyaml add-ons repository to your Hass.io instance. You can do this by navigating to the "Add-on Store" tab in the Hass.io panel and then entering https://github.com/OttoWinter/esphomeyaml in the "Add new repository by URL" field.
 | 
			
		||||
2. Now scroll down and select the "esphomeyaml" add-on.
 | 
			
		||||
3. Press install to download the add-on and unpack it on your machine. This can take some time.
 | 
			
		||||
4. Optional: If you're using SSL certificates and want to encrypt your communication to this add-on, please enter `true` into the `ssl` field and set the `fullchain` and `certfile` options accordingly.
 | 
			
		||||
5. Start the add-on, check the logs of the add-on to see if everything went well.
 | 
			
		||||
6. Click "OPEN WEB UI" to open the esphomeyaml dashboard. You will be asked for your Home Assistant credentials - esphomeyaml uses Hass.io's authentication system to log you in.
 | 
			
		||||
 | 
			
		||||
**NOTE**: Installation on RPis running in 64-bit mode is currently not possible. Please use the 32-bit variant of HassOS instead.
 | 
			
		||||
 | 
			
		||||
You can view the esphomeyaml docs here: https://esphomelib.com/esphomeyaml/index.html
 | 
			
		||||
 | 
			
		||||
## Configuration
 | 
			
		||||
 | 
			
		||||
**Note**: _Remember to restart the add-on when the configuration is changed._
 | 
			
		||||
 | 
			
		||||
Example add-on configuration:
 | 
			
		||||
 | 
			
		||||
```json
 | 
			
		||||
{
 | 
			
		||||
  "ssl": false,
 | 
			
		||||
  "certfile": "fullchain.pem",
 | 
			
		||||
  "keyfile": "privkey.pem",
 | 
			
		||||
  "port": 6052
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### Option: `port`
 | 
			
		||||
 | 
			
		||||
The port to start the dashboard server on. Default is 6052.
 | 
			
		||||
 | 
			
		||||
### Option: `ssl`
 | 
			
		||||
 | 
			
		||||
Enables/Disables encrypted SSL (HTTPS) connections to the web server of this add-on.
 | 
			
		||||
Set it to `true` to encrypt communications, `false` otherwise.
 | 
			
		||||
Please note that if you set this to `true` you must also generate the key and certificate
 | 
			
		||||
files for encryption. For example using [Let's Encrypt](https://www.home-assistant.io/addons/lets_encrypt/)
 | 
			
		||||
or [Self-signed certificates](https://www.home-assistant.io/docs/ecosystem/certificates/tls_self_signed_certificate/).
 | 
			
		||||
 | 
			
		||||
### Option: `certfile`
 | 
			
		||||
 | 
			
		||||
The certificate file to use for SSL. If this file doesn't exist, the add-on start will fail.
 | 
			
		||||
 | 
			
		||||
**Note**: The file MUST be stored in `/ssl/`, which is the default for Hass.io
 | 
			
		||||
 | 
			
		||||
### Option: `keyfile`
 | 
			
		||||
 | 
			
		||||
The private key file to use for SSL. If this file doesn't exist, the add-on start will fail.
 | 
			
		||||
 | 
			
		||||
**Note**: The file MUST be stored in `/ssl/`, which is the default for Hass.io
 | 
			
		||||
 | 
			
		||||
### Option: `leave_front_door_open`
 | 
			
		||||
 | 
			
		||||
Adding this option to the add-on configuration allows you to disable
 | 
			
		||||
authentication by setting it to `true`.
 | 
			
		||||
 | 
			
		||||
### Option: `esphomeyaml_version`
 | 
			
		||||
 | 
			
		||||
Manually override which esphomeyaml version to use in the addon.
 | 
			
		||||
For example to install the latest development version, use `"esphomeyaml_version": "dev"`,
 | 
			
		||||
or for version 1.10.0: `"esphomeyaml_version": "v1.10.0""`.
 | 
			
		||||
 
 | 
			
		||||
Please note that this does not always work and is only meant for testing, usually the
 | 
			
		||||
esphomeyaml add-on and dashboard version must match to guarantee a working system.  
 | 
			
		||||
 | 
			
		||||
[discord-shield]: https://img.shields.io/discord/429907082951524364.svg
 | 
			
		||||
[dht22]: https://esphomelib.com/esphomeyaml/components/sensor/dht.html
 | 
			
		||||
[discord]: https://discord.me/KhAMKrd
 | 
			
		||||
[releases-shield]: https://img.shields.io/github/release/OttoWinter/esphomeyaml.svg
 | 
			
		||||
[releases]: https://esphomelib.com/esphomeyaml/changelog/index.html
 | 
			
		||||
[repository]: https://github.com/OttoWinter/esphomeyaml
 | 
			
		||||
See https://esphome.io/changelog/v1.11.0.html#installation-methods-changed
 | 
			
		||||
for updated instructions
 | 
			
		||||
 
 | 
			
		||||
| 
		 Before Width: | Height: | Size: 2.8 KiB  | 
| 
		 Before Width: | Height: | Size: 5.5 KiB  |