diff --git a/esphomeyaml/changelog/index.rst b/esphomeyaml/changelog/index.rst index 974708af6..e323cda92 100644 --- a/esphomeyaml/changelog/index.rst +++ b/esphomeyaml/changelog/index.rst @@ -121,16 +121,6 @@ Breaking Changes the :docspr:`62` changeset for more information (:libpr:`231`, :docspr:`62`, :yamlpr:`197`) -- In 1.8.2, you might have noticed that the WiFi performance has been greatly improved. This was due to the new default of - the :ref:`power save mode ` option: ``NONE``. However, that default made some other ESPs not - connect to WiFi at all 😥. So now the default is back to ``LIGHT``. If you had a good WiFi perfomance in 1.8.2, do: - - .. code:: yaml - - wifi: - # ... - power_save_mode: NONE - All changes ----------- diff --git a/esphomeyaml/components/esp32_ble_tracker.rst b/esphomeyaml/components/esp32_ble_tracker.rst index 1de1ebf96..540b4f95d 100644 --- a/esphomeyaml/components/esp32_ble_tracker.rst +++ b/esphomeyaml/components/esp32_ble_tracker.rst @@ -4,7 +4,7 @@ ESP32 Bluetooth Low Energy Tracker Hub The ``esp32_ble_tracker`` component creates a global hub so that you can track bluetooth low energy devices using your ESP32 node. -See `Setting up devices `__ +See :ref:`Setting up devices ` for information on how you can find out the MAC address of a device and track it using esphomelib. .. code:: yaml diff --git a/esphomeyaml/components/esphomeyaml.rst b/esphomeyaml/components/esphomeyaml.rst index 8ab1b85e3..2e6b71810 100644 --- a/esphomeyaml/components/esphomeyaml.rst +++ b/esphomeyaml/components/esphomeyaml.rst @@ -181,10 +181,9 @@ Configuration variables: - ``100``: This is where all hardware initialization of vital components is executed. For example setting switches to their initial state. + - ``50.0``: This is where most sensors are set up. - ``10``: At this priority, WiFi is initialized. - ``7.5``: MQTT initialization takes place at this priority. - - ``0.0``: This is where most sensors are set up. They are usually set up this late so that they can dump their - configuration in the MQTT logs. - ``-5.0``: The individual frontend counterparts for the backend components are configured at this priority - ``-10.0``: At this priority, pretty much everything should already be initialized. diff --git a/esphomeyaml/components/wifi.rst b/esphomeyaml/components/wifi.rst index 7819cb3ed..7dcf9941a 100644 --- a/esphomeyaml/components/wifi.rst +++ b/esphomeyaml/components/wifi.rst @@ -109,12 +109,11 @@ WiFi. While some options *can* reduce the power usage of the ESP, they generally reliability of the WiFi connection, with frequent disconnections from the router in the highest power saving mode. -The default is ``light`` (a bit of power saving). If you experience frequent WiFi disconnection problems, -please switch to ``none`` (no power saving). However, ``none`` sometimes works even worse than ``light``, so it's -best to test with both (hence ``none`` is also not the default). +The default is ``none`` (a bit of power saving). If you experience frequent WiFi disconnection problems, +please also try ``light``. -- ``NONE`` (least power saving) -- ``LIGHT`` (Default) +- ``NONE`` (least power saving, Default) +- ``LIGHT`` - ``HIGH`` (most power saving) .. code:: yaml diff --git a/esphomeyaml/guides/automations.rst b/esphomeyaml/guides/automations.rst index 4d7625944..842a3d6cf 100644 --- a/esphomeyaml/guides/automations.rst +++ b/esphomeyaml/guides/automations.rst @@ -249,6 +249,49 @@ if you have a light and want to set it to a pre-defined color when a button is p Every parameter in actions that has the label "templatable" in the docs can be templated like above, using all of the usual lambda syntax. + +.. _config-globals: + +Bonus 2: Global Variables +************************* + +In some cases you might require to share a global variable across multiple lambdas. For example, +global variables can be used to store the state of a garage door. + +.. code:: yaml + + # Example configuration entry + globals: + - id: my_global_int + type: int + restore_state: no + initial_value: '0' + + # In an automation + on_press: + then: + - lambda: |- + if (id(my_global_int) > 5) { + // global value is greater than 5 + id(my_global_int) += 1; + } else { + id(my_global_int) += 10; + } + + ESP_LOGD(TAG, "Global value is: %d", id(my_global_int)); + +Configuration options: + +- **id** (**Required**, :ref:`config-id`): Give the global variable an ID so that you can refer + to it later in :ref:`lambdas `. +- **type** (**Required**, string): The C++ type of the global variable, for example ``bool`` (for ``true``/``false``), + ``int`` (for integers), ``float`` (for decimal numbers), ``int[50]`` for an array of 50 integers, etc. +- **restore_state** (*Optional*, boolean): Whether to try to restore the state on boot up. + Be careful: on the ESP8266, you only have a total of 96 bytes available for this! Defaults to ``no``. +- **initial_value** (*Optional*, string): The value with which to initialize this variable if the state + can not be restored or if state restoration is not enabled. This needs to be wrapped in quotes! Defaults to + the C++ default value for this type (for example ``0`` for integers). + All Triggers ------------ diff --git a/esphomeyaml/guides/faq.rst b/esphomeyaml/guides/faq.rst index dd050d0a6..2a75ef833 100644 --- a/esphomeyaml/guides/faq.rst +++ b/esphomeyaml/guides/faq.rst @@ -219,7 +219,7 @@ not have a real solution. Some steps that can help with the issue: -- Set the ``power_save_mode`` to ``NONE`` in the ``wifi:`` config. See :ref:`wifi-power_save_mode`. +- Set the ``power_save_mode`` to ``light`` in the ``wifi:`` config. See :ref:`wifi-power_save_mode`. - Use the most recent version of th arduino framework. The platformio arduino package always takes some time to update and the most recent version often includes some awesome patches. See :ref:`esphomeyaml-arduino_version`.