Skip to content

Commit 48e514c

Browse files
committed
Merge branch 'next' into rc
2 parents e2e2722 + 1d8147a commit 48e514c

File tree

16 files changed

+311
-22
lines changed

16 files changed

+311
-22
lines changed

api/output/my9231.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
MY9231/MY9291 Output
2+
====================
3+
4+
FloatOutput support for an MY9231/MY9291 LED driver chain.
5+
6+
Example Usage
7+
-------------
8+
9+
.. code-block:: cpp
10+
11+
// Create the MY9231 Output hub connected to GPIO12 (DI pin) and
12+
// GPIO14 (DCKI pin).
13+
auto *pmy9231 = App.make_my9231_component(12, 14);
14+
15+
.. cpp:namespace:: nullptr
16+
17+
See :cpp:func:`Application::make_my9231_component`.
18+
19+
API Reference
20+
-------------
21+
22+
.. cpp:namespace:: nullptr
23+
24+
MY9231OutputComponent
25+
**********************
26+
27+
.. doxygenclass:: output::MY9231OutputComponent
28+
:members:
29+
:protected-members:
30+
:undoc-members:

esphomeyaml/changelog/index.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Changelog - Version 1.9.0
1313

1414
esphomeflasher, guides/faq.html#i-can-t-get-flashing-over-usb-to-work, logo.svg
1515
Total Daily Energy, components/sensor/total_daily_energy, sigma.svg
16+
MY9231/MY9291 LED driver, components/my9231, my9231.svg
1617

1718

1819
New Components
@@ -28,6 +29,8 @@ New Components
2829
- Added :doc:`CSE7766 Power Sensor </esphomeyaml/components/sensor/cse7766>` to support power measurements
2930
on the Sonoff Pow R2 (:libpr:`277`, :yamlpr:`190`, :docspr:`59`)
3031

32+
- Thanks to :ghuser:`puuu`, the LED driver in the Sonoff B1 (MY9231) is now supported!
33+
(:libpr:`266`, :yamlpr:`227`, :docspr:`80`)
3134

3235
- Added the :doc:`PMSX003 Particulate Matter Sensor </esphomeyaml/components/sensor/pmsx003>`
3336
(:libpr:`229`, :yamlpr:`192`, :docspr:`58`)
@@ -47,7 +50,10 @@ New Features
4750
flashing on Windows/MacOS machines **without having to install esphomeyaml**. So if esphomeyaml for some reason
4851
can't find your USB port, you now can use the esphomeflasher app. See :ref:`esphomeflasher`.
4952

50-
- ESP8266s now save the states of lights/switches/... internally and restore them on boot. (:libpr:`258`)
53+
- ESP8266s now save the states of lights/switches/... internally and restores them on boot.
54+
Additionally, esphomelib can now operate in fully offline mode if your WiFi network goes down
55+
or the MQTT broker is unreachable, see :ref:`automation-networkless`
56+
(:libpr:`258`, :libpr:`267`, :yamlpr:`229`)
5157

5258
- The :doc:`Over-the-Air Update </esphomeyaml/components/ota>` process was quite buggy sometimes and the Arduino-library
5359
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
104110

105111
- You can now upload OTA firmware files with the :doc:`web server component </esphomeyaml/components/web_server>`
106112

113+
- Added the ability to define global variables in esphomeyaml: :ref:`config-globals`.
114+
115+
- Added a ``frequency`` option to the :doc:`/esphomeyaml/components/output/esp8266_pwm`.
107116

108117
Breaking Changes
109118
----------------

esphomeyaml/components/binary_sensor/index.rst

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ This automation will be triggered when a button is pressed in a user-specified s
208208
- ON for 0.5s to 1s
209209
- OFF for at least 0.2s
210210
then:
211-
- logger.log: "Double-Clicked"
211+
- logger.log: "Double-Clicked"
212212
213213
Configuration variables:
214214

@@ -238,27 +238,23 @@ presses.
238238
239239
on_multi_click:
240240
- timing:
241-
- ON for at most 1s
242-
- OFF for at most 1s
243-
- ON for at most 1s
244-
- OFF for at least 0.2s
241+
- ON for at most 1s
242+
- OFF for at most 1s
243+
- ON for at most 1s
244+
- OFF for at least 0.2s
245245
then:
246-
- logger.log:
247-
format: "Double Clicked"
248-
level: warn
246+
- logger.log: "Double Clicked"
249247
- timing:
250-
- OFF for 1s to 2s
251-
- ON for 1s to 2s
252-
- OFF for at least 0.5s
248+
- OFF for 1s to 2s
249+
- ON for 1s to 2s
250+
- OFF for at least 0.5s
253251
then:
254-
- logger.log: "Single Long Clicked"
252+
- logger.log: "Single Long Clicked"
255253
- timing:
256-
- ON for at most 1s
257-
- OFF for at least 0.5s
254+
- ON for at most 1s
255+
- OFF for at least 0.5s
258256
then:
259-
- logger.log:
260-
format: "Single Short Clicked"
261-
level: warn
257+
- logger.log: "Single Short Clicked"
262258
263259
lambda calls
264260
************

esphomeyaml/components/deep_sleep.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ Configuration variables:
4141
See :ref:`deep_sleep-esp32_wakeup_pin_mode`. Defaults to ``IGNORE``
4242
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
4343

44+
Advanced features:
45+
46+
- **esp32_ext1_wakeup** (*Optional*): Use the EXT1 wakeup source of the ESP32 to wake from deep sleep to
47+
wake up on multiple pins. This cannot be used together with wakeup pin.
48+
49+
- **pins** (**Required**, list of pin numbers): The pins to wake up on.
50+
- **mode** (*Optional*): The mode to use for the wakeup source. Must be one of ``ALL_LOW`` (wake up when
51+
all pins go LOW) or ``ANY_HIGH`` (wake up when any pin goes HIGH).
52+
4453
.. note::
4554

4655
The :ref:`availability feature <mqtt-last_will_birth>` of the MQTT client will cause all values

esphomeyaml/components/light/monochromatic.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ See Also
5858
- :doc:`/esphomeyaml/components/output/ledc`
5959
- :doc:`/esphomeyaml/components/output/esp8266_pwm`
6060
- :doc:`/esphomeyaml/components/output/pca9685`
61+
- :doc:`/esphomeyaml/components/output/my9231`
6162
- :doc:`API Reference </api/light/index>`
6263
- `Edit this page on GitHub <https://github.com/OttoWinter/esphomedocs/blob/current/esphomeyaml/components/light/monochromatic.rst>`__
6364

esphomeyaml/components/light/rgb.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ See Also
6060
- :doc:`/esphomeyaml/components/output/ledc`
6161
- :doc:`/esphomeyaml/components/output/esp8266_pwm`
6262
- :doc:`/esphomeyaml/components/output/pca9685`
63+
- :doc:`/esphomeyaml/components/output/my9231`
6364
- :doc:`API Reference </api/light/index>`
6465
- `Edit this page on GitHub <https://github.com/OttoWinter/esphomedocs/blob/current/esphomeyaml/components/light/rgb.rst>`__
6566

esphomeyaml/components/light/rgbw.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ See Also
4747
- :doc:`/esphomeyaml/components/output/ledc`
4848
- :doc:`/esphomeyaml/components/output/esp8266_pwm`
4949
- :doc:`/esphomeyaml/components/output/pca9685`
50+
- :doc:`/esphomeyaml/components/output/my9231`
5051
- :doc:`API Reference </api/light/index>`
5152
- `Edit this page on GitHub <https://github.com/OttoWinter/esphomedocs/blob/current/esphomeyaml/components/light/rgbw.rst>`__
5253

esphomeyaml/components/light/rgbww.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ See Also
5858
- :doc:`/esphomeyaml/components/output/ledc`
5959
- :doc:`/esphomeyaml/components/output/esp8266_pwm`
6060
- :doc:`/esphomeyaml/components/output/pca9685`
61+
- :doc:`/esphomeyaml/components/output/my9231`
6162
- :doc:`API Reference </api/light/index>`
6263
- `Edit this page on GitHub <https://github.com/OttoWinter/esphomedocs/blob/current/esphomeyaml/components/light/rgbww.rst>`__
6364

esphomeyaml/components/mqtt.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Configuration variables:
4949
for verifying SSL connections. See :ref:`mqtt-ssl_fingerprints`
5050
for more information.
5151
- **reboot_timeout** (*Optional*, :ref:`time <config-time>`): The amount of time to wait before rebooting when no
52-
MQTT connection exists. Can be disabled by setting this to ``0s``. Defaults to ``60s``.
52+
MQTT connection exists. Can be disabled by setting this to ``0s``. Defaults to ``5min``.
5353
- **keepalive** (*Optional*, :ref:`config-time`): The time
5454
to keep the MQTT socket alive, decreasing this can help with overall stability due to more
5555
WiFi traffic with more pings. Defaults to 15 seconds.

esphomeyaml/components/my9231.rst

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
MY9231/MY9291 LED driver Component
2+
==================================
3+
4+
The MY9231/MY9291 component represents a MY9231/MY9291 LED diver chain
5+
(`MY9231 description <http://www.my-semi.com.tw/file/MY9231_BF_0.91.pdf>`__,
6+
`MY9291 description <http://www.my-semi.com.tw/file/MY9291_BF_0.91.pdf>`__) in
7+
esphomelib. Communication is done with two GPIO pins (DI and DCKI) and multiple
8+
driver chips can be chained. There are two models with different number of
9+
output channels (MY9291 with 4 channels and MY9231 with 3 channels). They are
10+
popular driver chips used in smart light blubs:
11+
12+
- Sonoff B1 (MY9231)
13+
- Ai-Thinker AiLight WiFi light bulb (MY9291)
14+
- Arilux E27 Smart Bulb (MY9231)
15+
16+
To use the channels of this components, you first need to setup the
17+
global ``my9231`` hub and give it an id, and then define the
18+
:doc:`individual output channels </esphomeyaml/components/output/my9231>`.
19+
20+
.. note::
21+
22+
One of the features of the MY9231/MY9291 driver is that the chips
23+
remember their state after a power cycling. Unfortunately, the
24+
state of the driver can not be read. Therefore, if esphomelib can
25+
not restore the previous state, it will result in a mismatch of
26+
the driver output and the internal state (= MQTT state). So you
27+
can configure the behaviour on boot time:
28+
29+
``update_on_boot: True``
30+
On device power up/boot, the light may flash shortly, to the
31+
state before powering off.
32+
33+
``update_on_boot: False``
34+
On device power up/boot, the light show the last state, but the
35+
internal data will not reflect this state. Thus, the first fade
36+
is wrong, as well as the MQTT state.
37+
38+
.. code:: yaml
39+
40+
# Example configuration entry
41+
my9231:
42+
- data_pin: GPIO12
43+
clock_pin: GPIO14
44+
45+
# Individual outputs
46+
output:
47+
- platform: my9231
48+
id: 'my9231_output1'
49+
channel: 0
50+
51+
Configuration variables:
52+
------------------------
53+
54+
- **data_pin** (**Required**, :ref:`config-pin_schema`): The pin which DI is connected
55+
to.
56+
- **clock_pin** (**Required**, :ref:`config-pin_schema`): The pin which DCKI is
57+
connected to.
58+
- **num_channels** (*Optional*, int): Total number of channels of the whole
59+
chain. Must be in range from 3 to 1020. Defaults to 6.
60+
- **num_chips** (*Optional*, int): Number of chips in the chain. Must be
61+
in range from 1 to 255. Defaults to 2.
62+
- **bit_depths** (*Optional*, int): The bit depth to use for all output
63+
channels in this chain. Must be one of 8, 12, 14 or 16. Defaults to 16.
64+
- **update_on_boot** (*Optional*, boolean): Update/reset duty data at boot. Defaults to ``True``.
65+
- **id** (*Optional*, :ref:`config-id`): The id to use for
66+
this ``my9231`` component. Use this if you have multiple MY9231/MY9291 chains
67+
connected at the same time.
68+
69+
Sonoff B1 configuration example
70+
-------------------------------
71+
72+
This component can be used with a Sonoff B1 smart light blub. To flash
73+
the Sonoff B1, open the plastic cover and connect/solder wires to the
74+
PCB pads (3.3V, RX, TX, GND, GPIO0). If you connect GPIO0 to GND
75+
during power up, the device enters flash mode. For more information
76+
about flashing Sonoff devices, see:
77+
:doc:`/esphomeyaml/devices/sonoff_s20`. All LEDs are connected to a
78+
chain of two MY9321 chips that are connected to GPIO12 and GPIO14. A
79+
complete configuration for a Sonoff B1 looks like:
80+
81+
.. code:: yaml
82+
83+
esphomeyaml:
84+
name: <NAME_OF_NODE>
85+
platform: ESP8266
86+
board: esp01_1m
87+
board_flash_mode: dout
88+
89+
wifi:
90+
ssid: <YOUR_SSID>
91+
password: <YOUR_WIFI_PASSPHRASE>
92+
93+
mqtt:
94+
broker: <YOUR_MQTT_BROKER>
95+
username: <YOUR_MQTT_USERNAME>
96+
password: <YOUR_MQTT_PASSWORD>
97+
98+
logger:
99+
100+
ota:
101+
password: <YOUR_OTA_PASSWORD>
102+
103+
my9231:
104+
data_pin: GPIO12
105+
clock_pin: GPIO14
106+
num_channels: 6
107+
num_chips: 2
108+
109+
output:
110+
- platform: my9231
111+
id: output_blue
112+
channel: 0
113+
- platform: my9231
114+
id: output_red
115+
channel: 1
116+
- platform: my9231
117+
id: output_green
118+
channel: 2
119+
- platform: my9231
120+
id: output_warm_white
121+
channel: 4
122+
- platform: my9231
123+
id: output_cold_white
124+
channel: 5
125+
126+
light:
127+
- platform: rgbww
128+
name: <LIGHT_NAME>
129+
red: output_red
130+
green: output_green
131+
blue: output_blue
132+
cold_white: output_cold_white
133+
warm_white: output_warm_white
134+
cold_white_color_temperature: 6500 K
135+
warm_white_color_temperature: 2800 K
136+
137+
See Also
138+
--------
139+
140+
- :doc:`output/my9231`
141+
- :doc:`API Reference </api/output/my9231>`
142+
- `Edit this page on GitHub <https://github.com/OttoWinter/esphomedocs/blob/current/esphomeyaml/components/my9231.rst>`__
143+
144+
.. disqus::

0 commit comments

Comments
 (0)