Merge branch 'next' into rc

This commit is contained in:
Otto Winter 2018-11-13 19:06:32 +01:00
commit 48e514c570
No known key found for this signature in database
GPG Key ID: DB66C0BE6013F97E
16 changed files with 311 additions and 22 deletions

30
api/output/my9231.rst Normal file
View File

@ -0,0 +1,30 @@
MY9231/MY9291 Output
====================
FloatOutput support for an MY9231/MY9291 LED driver chain.
Example Usage
-------------
.. code-block:: cpp
// Create the MY9231 Output hub connected to GPIO12 (DI pin) and
// GPIO14 (DCKI pin).
auto *pmy9231 = App.make_my9231_component(12, 14);
.. cpp:namespace:: nullptr
See :cpp:func:`Application::make_my9231_component`.
API Reference
-------------
.. cpp:namespace:: nullptr
MY9231OutputComponent
**********************
.. doxygenclass:: output::MY9231OutputComponent
:members:
:protected-members:
:undoc-members:

View File

@ -13,6 +13,7 @@ Changelog - Version 1.9.0
esphomeflasher, guides/faq.html#i-can-t-get-flashing-over-usb-to-work, logo.svg
Total Daily Energy, components/sensor/total_daily_energy, sigma.svg
MY9231/MY9291 LED driver, components/my9231, my9231.svg
New Components
@ -28,6 +29,8 @@ New Components
- Added :doc:`CSE7766 Power Sensor </esphomeyaml/components/sensor/cse7766>` to support power measurements
on the Sonoff Pow R2 (:libpr:`277`, :yamlpr:`190`, :docspr:`59`)
- Thanks to :ghuser:`puuu`, the LED driver in the Sonoff B1 (MY9231) is now supported!
(:libpr:`266`, :yamlpr:`227`, :docspr:`80`)
- Added the :doc:`PMSX003 Particulate Matter Sensor </esphomeyaml/components/sensor/pmsx003>`
(:libpr:`229`, :yamlpr:`192`, :docspr:`58`)
@ -47,7 +50,10 @@ New Features
flashing on Windows/MacOS machines **without having to install esphomeyaml**. So if esphomeyaml for some reason
can't find your USB port, you now can use the esphomeflasher app. See :ref:`esphomeflasher`.
- ESP8266s now save the states of lights/switches/... internally and restore them on boot. (:libpr:`258`)
- ESP8266s now save the states of lights/switches/... internally and restores them on boot.
Additionally, esphomelib can now operate in fully offline mode if your WiFi network goes down
or the MQTT broker is unreachable, see :ref:`automation-networkless`
(:libpr:`258`, :libpr:`267`, :yamlpr:`229`)
- The :doc:`Over-the-Air Update </esphomeyaml/components/ota>` process was quite buggy sometimes and the Arduino-library
esphomelib used was doing some weird stuff. The OTA-process has now been completely re-written to be more stable
@ -104,6 +110,9 @@ New Features
- You can now upload OTA firmware files with the :doc:`web server component </esphomeyaml/components/web_server>`
- Added the ability to define global variables in esphomeyaml: :ref:`config-globals`.
- Added a ``frequency`` option to the :doc:`/esphomeyaml/components/output/esp8266_pwm`.
Breaking Changes
----------------

View File

@ -208,7 +208,7 @@ This automation will be triggered when a button is pressed in a user-specified s
- ON for 0.5s to 1s
- OFF for at least 0.2s
then:
- logger.log: "Double-Clicked"
- logger.log: "Double-Clicked"
Configuration variables:
@ -238,27 +238,23 @@ presses.
on_multi_click:
- timing:
- ON for at most 1s
- OFF for at most 1s
- ON for at most 1s
- OFF for at least 0.2s
- ON for at most 1s
- OFF for at most 1s
- ON for at most 1s
- OFF for at least 0.2s
then:
- logger.log:
format: "Double Clicked"
level: warn
- logger.log: "Double Clicked"
- timing:
- OFF for 1s to 2s
- ON for 1s to 2s
- OFF for at least 0.5s
- OFF for 1s to 2s
- ON for 1s to 2s
- OFF for at least 0.5s
then:
- logger.log: "Single Long Clicked"
- logger.log: "Single Long Clicked"
- timing:
- ON for at most 1s
- OFF for at least 0.5s
- ON for at most 1s
- OFF for at least 0.5s
then:
- logger.log:
format: "Single Short Clicked"
level: warn
- logger.log: "Single Short Clicked"
lambda calls
************

View File

@ -41,6 +41,15 @@ Configuration variables:
See :ref:`deep_sleep-esp32_wakeup_pin_mode`. Defaults to ``IGNORE``
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
Advanced features:
- **esp32_ext1_wakeup** (*Optional*): Use the EXT1 wakeup source of the ESP32 to wake from deep sleep to
wake up on multiple pins. This cannot be used together with wakeup pin.
- **pins** (**Required**, list of pin numbers): The pins to wake up on.
- **mode** (*Optional*): The mode to use for the wakeup source. Must be one of ``ALL_LOW`` (wake up when
all pins go LOW) or ``ANY_HIGH`` (wake up when any pin goes HIGH).
.. note::
The :ref:`availability feature <mqtt-last_will_birth>` of the MQTT client will cause all values

View File

@ -58,6 +58,7 @@ See Also
- :doc:`/esphomeyaml/components/output/ledc`
- :doc:`/esphomeyaml/components/output/esp8266_pwm`
- :doc:`/esphomeyaml/components/output/pca9685`
- :doc:`/esphomeyaml/components/output/my9231`
- :doc:`API Reference </api/light/index>`
- `Edit this page on GitHub <https://github.com/OttoWinter/esphomedocs/blob/current/esphomeyaml/components/light/monochromatic.rst>`__

View File

@ -60,6 +60,7 @@ See Also
- :doc:`/esphomeyaml/components/output/ledc`
- :doc:`/esphomeyaml/components/output/esp8266_pwm`
- :doc:`/esphomeyaml/components/output/pca9685`
- :doc:`/esphomeyaml/components/output/my9231`
- :doc:`API Reference </api/light/index>`
- `Edit this page on GitHub <https://github.com/OttoWinter/esphomedocs/blob/current/esphomeyaml/components/light/rgb.rst>`__

View File

@ -47,6 +47,7 @@ See Also
- :doc:`/esphomeyaml/components/output/ledc`
- :doc:`/esphomeyaml/components/output/esp8266_pwm`
- :doc:`/esphomeyaml/components/output/pca9685`
- :doc:`/esphomeyaml/components/output/my9231`
- :doc:`API Reference </api/light/index>`
- `Edit this page on GitHub <https://github.com/OttoWinter/esphomedocs/blob/current/esphomeyaml/components/light/rgbw.rst>`__

View File

@ -58,6 +58,7 @@ See Also
- :doc:`/esphomeyaml/components/output/ledc`
- :doc:`/esphomeyaml/components/output/esp8266_pwm`
- :doc:`/esphomeyaml/components/output/pca9685`
- :doc:`/esphomeyaml/components/output/my9231`
- :doc:`API Reference </api/light/index>`
- `Edit this page on GitHub <https://github.com/OttoWinter/esphomedocs/blob/current/esphomeyaml/components/light/rgbww.rst>`__

View File

@ -49,7 +49,7 @@ Configuration variables:
for verifying SSL connections. See :ref:`mqtt-ssl_fingerprints`
for more information.
- **reboot_timeout** (*Optional*, :ref:`time <config-time>`): The amount of time to wait before rebooting when no
MQTT connection exists. Can be disabled by setting this to ``0s``. Defaults to ``60s``.
MQTT connection exists. Can be disabled by setting this to ``0s``. Defaults to ``5min``.
- **keepalive** (*Optional*, :ref:`config-time`): The time
to keep the MQTT socket alive, decreasing this can help with overall stability due to more
WiFi traffic with more pings. Defaults to 15 seconds.

View File

@ -0,0 +1,144 @@
MY9231/MY9291 LED driver Component
==================================
The MY9231/MY9291 component represents a MY9231/MY9291 LED diver chain
(`MY9231 description <http://www.my-semi.com.tw/file/MY9231_BF_0.91.pdf>`__,
`MY9291 description <http://www.my-semi.com.tw/file/MY9291_BF_0.91.pdf>`__) in
esphomelib. Communication is done with two GPIO pins (DI and DCKI) and multiple
driver chips can be chained. There are two models with different number of
output channels (MY9291 with 4 channels and MY9231 with 3 channels). They are
popular driver chips used in smart light blubs:
- Sonoff B1 (MY9231)
- Ai-Thinker AiLight WiFi light bulb (MY9291)
- Arilux E27 Smart Bulb (MY9231)
To use the channels of this components, you first need to setup the
global ``my9231`` hub and give it an id, and then define the
:doc:`individual output channels </esphomeyaml/components/output/my9231>`.
.. note::
One of the features of the MY9231/MY9291 driver is that the chips
remember their state after a power cycling. Unfortunately, the
state of the driver can not be read. Therefore, if esphomelib can
not restore the previous state, it will result in a mismatch of
the driver output and the internal state (= MQTT state). So you
can configure the behaviour on boot time:
``update_on_boot: True``
On device power up/boot, the light may flash shortly, to the
state before powering off.
``update_on_boot: False``
On device power up/boot, the light show the last state, but the
internal data will not reflect this state. Thus, the first fade
is wrong, as well as the MQTT state.
.. code:: yaml
# Example configuration entry
my9231:
- data_pin: GPIO12
clock_pin: GPIO14
# Individual outputs
output:
- platform: my9231
id: 'my9231_output1'
channel: 0
Configuration variables:
------------------------
- **data_pin** (**Required**, :ref:`config-pin_schema`): The pin which DI is connected
to.
- **clock_pin** (**Required**, :ref:`config-pin_schema`): The pin which DCKI is
connected to.
- **num_channels** (*Optional*, int): Total number of channels of the whole
chain. Must be in range from 3 to 1020. Defaults to 6.
- **num_chips** (*Optional*, int): Number of chips in the chain. Must be
in range from 1 to 255. Defaults to 2.
- **bit_depths** (*Optional*, int): The bit depth to use for all output
channels in this chain. Must be one of 8, 12, 14 or 16. Defaults to 16.
- **update_on_boot** (*Optional*, boolean): Update/reset duty data at boot. Defaults to ``True``.
- **id** (*Optional*, :ref:`config-id`): The id to use for
this ``my9231`` component. Use this if you have multiple MY9231/MY9291 chains
connected at the same time.
Sonoff B1 configuration example
-------------------------------
This component can be used with a Sonoff B1 smart light blub. To flash
the Sonoff B1, open the plastic cover and connect/solder wires to the
PCB pads (3.3V, RX, TX, GND, GPIO0). If you connect GPIO0 to GND
during power up, the device enters flash mode. For more information
about flashing Sonoff devices, see:
:doc:`/esphomeyaml/devices/sonoff_s20`. All LEDs are connected to a
chain of two MY9321 chips that are connected to GPIO12 and GPIO14. A
complete configuration for a Sonoff B1 looks like:
.. code:: yaml
esphomeyaml:
name: <NAME_OF_NODE>
platform: ESP8266
board: esp01_1m
board_flash_mode: dout
wifi:
ssid: <YOUR_SSID>
password: <YOUR_WIFI_PASSPHRASE>
mqtt:
broker: <YOUR_MQTT_BROKER>
username: <YOUR_MQTT_USERNAME>
password: <YOUR_MQTT_PASSWORD>
logger:
ota:
password: <YOUR_OTA_PASSWORD>
my9231:
data_pin: GPIO12
clock_pin: GPIO14
num_channels: 6
num_chips: 2
output:
- platform: my9231
id: output_blue
channel: 0
- platform: my9231
id: output_red
channel: 1
- platform: my9231
id: output_green
channel: 2
- platform: my9231
id: output_warm_white
channel: 4
- platform: my9231
id: output_cold_white
channel: 5
light:
- platform: rgbww
name: <LIGHT_NAME>
red: output_red
green: output_green
blue: output_blue
cold_white: output_cold_white
warm_white: output_warm_white
cold_white_color_temperature: 6500 K
warm_white_color_temperature: 2800 K
See Also
--------
- :doc:`output/my9231`
- :doc:`API Reference </api/output/my9231>`
- `Edit this page on GitHub <https://github.com/OttoWinter/esphomedocs/blob/current/esphomeyaml/components/my9231.rst>`__
.. disqus::

View File

@ -8,8 +8,6 @@ limitations.
- There can be a noticeable amount of flickering with increased WiFi activity.
- The output range only goes up to about 80%.
- Its mostly fixed to a frequency of 1kHz, you can :ref:`increase this a
bit manually <esp8266_pwm-example_usage>` in code though.
If you need a stable PWM signal, its definitely recommended to use the
successor of the ESP8266, the ESP32, and its :doc:`ESP32 LEDC PWM <ledc>` instead.
@ -20,6 +18,7 @@ successor of the ESP8266, the ESP32, and its :doc:`ESP32 LEDC PWM <ledc>` instea
output:
- platform: esp8266_pwm
pin: D1
frequency: 1000 Hz
id: pwm-output
Configuration variables:
@ -27,6 +26,8 @@ Configuration variables:
- **pin** (**Required**, :ref:`Pin Schema <config-pin_schema>`): The pin to use PWM on.
- **id** (**Required**, :ref:`config-id`): The id to use for this output component.
- **frequency** (*Optional*, frequency): The frequency to run the PWM with. Lower frequencies
have more visual artifacts, but can represent much more colors. Defaults to ``1000 Hz``.
- All other options from :ref:`Output <config-output>`.
See Also

View File

@ -0,0 +1,45 @@
MY9231/MY9291 Output
====================
The MY931/MY9291 output component exposes a MY931/MY9291 channel of a global
:doc:`/esphomeyaml/components/my9231` as a float output.
.. code:: yaml
# Example configuration entry
my9231:
- data_pin: GPIO12
clock_pin: GPIO14
# Individual outputs
output:
- platform: my9231
id: 'my9231_output1'
channel: 0
Configuration variables:
------------------------
- **id** (**Required**, :ref:`config-id`): The id to use for this output component.
- **channel** (**Required**, int): Chose the channel of the MY9231/MY9291 chain of
this output component. Channel 0 is the most close channel.
- **my9231_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the
:doc:`/esphomeyaml/components/my9231`.
Use this if you have multiple MY9231/MY9291 chains you want to use at the same time.
- All other options from :ref:`Output <config-output>`.
See Also
--------
- :doc:`/esphomeyaml/components/my9231`
- :doc:`/esphomeyaml/components/output/index`
- :doc:`/esphomeyaml/components/output/esp8266_pwm`
- :doc:`/esphomeyaml/components/output/ledc`
- :doc:`/esphomeyaml/components/light/monochromatic`
- :doc:`/esphomeyaml/components/fan/speed`
- :doc:`/esphomeyaml/components/power_supply`
- :doc:`API Reference </api/output/my9231>`
- `MY92XX LED driver library for Arduino AVR and ESP8266 <https://github.com/xoseperez/my92xx>`__ by `@xoseperez <https://github.com/xoseperez>`__
- `Edit this page on GitHub <https://github.com/OttoWinter/esphomedocs/blob/current/esphomeyaml/components/output/my9231.rst>`__
.. disqus::

View File

@ -55,7 +55,7 @@ Configuration variables:
Defaults to ``.local``.
- **reboot_timeout** (*Optional*, :ref:`time <config-time>`): The amount of time to wait before rebooting when no
WiFi connection exists. Can be disabled by setting this to ``0s``, but note that the low level IP stack currently
seems to have issues with WiFi where a full reboot is required to get the interface back working. Defaults to ``60s``.
seems to have issues with WiFi where a full reboot is required to get the interface back working. Defaults to ``5min``.
- **power_save_mode** (*Optional*, string): The power save mode for the WiFi interface. Defaults to no power saving.
See :ref:`wifi-power_save_mode`
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.

View File

@ -292,6 +292,19 @@ Configuration options:
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).
.. _automation-networkless:
Do Automations Work Without a Network Connection
************************************************
YES! All automations you define in esphomelib are execute on the ESP itself and will continue to
work even if the WiFi network is down or the MQTT server is not reachable.
There is one caveat though: esphomelib automatically reboots if no connection to the MQTT broker can be
made. This is because the ESPs typically have issues in their network stacks that require a reboot to fix.
You can adjust this behavior (or even disable automatic rebooting) using the ``reboot_timeout`` option
in the :doc:`wifi component </esphomeyaml/components/wifi>` and :doc:`mqtt component </esphomeyaml/components/mqtt>`.
All Triggers
------------

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 240 60"
height="60"
width="240"
xml:space="preserve"
id="svg2"
version="1.1"><metadata
id="metadata8"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
id="defs6" /><g
transform="matrix(1.3333333,0,0,-1.3333333,0,60)"
id="g10"><g
transform="scale(0.1)"
id="g12"><path
id="path14"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 148.418,445 H 1651.58 c 77.32,0 140,-62.68 140,-140 V 150 c 0,-77.3203 -62.68,-140 -140,-140 H 148.418 C 71.0977,10 8.41797,72.6797 8.41797,150 v 155 c 0,77.32 62.67973,140 140.00003,140 z" /><path
id="path16"
style="fill:none;stroke:#000000;stroke-width:10;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
d="M 148.418,445 H 1651.58 c 77.32,0 140,-62.68 140,-140 V 150 c 0,-77.3203 -62.68,-140 -140,-140 H 148.418 C 71.0977,10 8.41797,72.6797 8.41797,150 v 155 c 0,77.32 62.67973,140 140.00003,140 z" /><g
transform="scale(10)"
id="g18"><text
id="text22"
style="font-variant:normal;font-weight:900;font-size:35px;font-family:Montserrat;-inkscape-font-specification:Montserrat-Black;writing-mode:lr-tb;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
transform="matrix(1,0,0,-1,12.1375,10.25)"><tspan
id="tspan20"
y="0"
x="0 36.355 63.539997 89.290001 113.57 138.095">MY9231</tspan></text>
</g></g></g></svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -165,6 +165,7 @@ Output Components
GPIO Output, components/output/gpio, pin.svg
ESP32 LEDC, components/output/ledc, pwm.png
PCA9685, components/output/pca9685, pca9685.jpg
MY9231/MY9291, components/output/my9231, my9231.svg
Light Components
----------------
@ -259,6 +260,7 @@ Misc Components
RDM6300, components/rdm6300, rdm6300.jpg
Time, components/time, clock-outline.svg
Stepper, components/stepper/index, stepper.svg
MY9231/MY9291 LED driver, components/my9231, my9231.svg
.. _cookbook: