2018-06-01 18:10:00 +02:00
|
|
|
Generic Sonoff
|
|
|
|
==============
|
|
|
|
|
2018-11-14 22:12:27 +01:00
|
|
|
.. seo::
|
|
|
|
:description: Instructions for using generic Sonoff devices with esphomelib.
|
2018-11-19 18:32:16 +01:00
|
|
|
:image: sonoff.png
|
2018-11-14 22:12:27 +01:00
|
|
|
|
2018-06-01 18:10:00 +02:00
|
|
|
In principle esphomelib supports all Sonoff devices, but as these devices are quite expensive
|
|
|
|
and shipping from China takes a long time, I've only set up dedicated guides for the
|
|
|
|
:doc:`Sonoff S20 <sonoff_s20>` and :doc:`Sonoff 4CH <sonoff_4ch>`.
|
|
|
|
|
|
|
|
To use sonoff devices with esphomeyaml, set the ``board`` in the
|
|
|
|
:doc:`esphomeyaml section </esphomeyaml/components/esphomeyaml>` to ``esp01_1m`` and set
|
|
|
|
``board_flash_mode`` to ``dout``.
|
|
|
|
|
2018-11-19 18:32:16 +01:00
|
|
|
.. code-block:: yaml
|
2018-06-01 18:10:00 +02:00
|
|
|
|
|
|
|
esphomeyaml:
|
|
|
|
name: <NAME_OF_NODE>
|
|
|
|
platform: ESP8266
|
|
|
|
board: esp01_1m
|
|
|
|
board_flash_mode: dout
|
|
|
|
|
|
|
|
After that use the following list of pin to function mappings to set up your Sonoff device.
|
|
|
|
This list has been compiled from the Sonoff Tasmota pin source file which can be found here:
|
|
|
|
https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/sonoff_template.h ❤️
|
|
|
|
|
|
|
|
Sonoff RF
|
2018-08-24 22:44:01 +02:00
|
|
|
---------
|
2018-06-01 18:10:00 +02:00
|
|
|
|
2018-11-15 20:13:28 +01:00
|
|
|
.. pintable::
|
|
|
|
|
|
|
|
GPIO0, Button (inverted),
|
|
|
|
GPIO12, Relay and Red LED,
|
|
|
|
GPIO13, Green LED (inverted),
|
2018-11-17 10:07:22 +01:00
|
|
|
GPIO1, UART TX pin (for external sensors)
|
|
|
|
GPIO3, UART RX pin (for external sensors)
|
2018-11-15 20:13:28 +01:00
|
|
|
GPIO4, Optional sensor
|
|
|
|
GPIO14, Optional sensor
|
2018-06-01 18:10:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
Sonoff SV
|
2018-08-24 22:44:01 +02:00
|
|
|
---------
|
2018-06-01 18:10:00 +02:00
|
|
|
|
2018-11-15 20:13:28 +01:00
|
|
|
.. pintable::
|
|
|
|
|
|
|
|
GPIO0, Button (inverted),
|
|
|
|
GPIO12, Relay and Red LED,
|
|
|
|
GPIO13, Green LED (inverted),
|
|
|
|
GPIO17, Analog Input,
|
2018-11-17 10:07:22 +01:00
|
|
|
GPIO1, UART TX pin (for external sensors)
|
|
|
|
GPIO3, UART RX pin (for external sensors)
|
2018-11-15 20:13:28 +01:00
|
|
|
GPIO4, Optional sensor
|
|
|
|
GPIO5, Optional sensor
|
|
|
|
GPIO14, Optional sensor
|
|
|
|
|
|
|
|
|
|
|
|
Sonoff TH10/TH16
|
|
|
|
----------------
|
|
|
|
|
|
|
|
.. pintable::
|
|
|
|
|
|
|
|
GPIO0, Button (inverted),
|
|
|
|
GPIO12, Relay and Red LED,
|
|
|
|
GPIO13, Green LED (inverted),
|
2018-11-17 10:07:22 +01:00
|
|
|
GPIO1, UART TX pin (for external sensors)
|
|
|
|
GPIO3, UART RX pin (for external sensors)
|
2018-11-15 20:13:28 +01:00
|
|
|
GPIO4, Optional sensor
|
|
|
|
GPIO14, Optional sensor
|
|
|
|
|
|
|
|
Sonoff Dual R1
|
|
|
|
--------------
|
|
|
|
|
|
|
|
.. pintable::
|
|
|
|
|
|
|
|
GPIO1, Relay #1,
|
|
|
|
GPIO3, Relay #2,
|
|
|
|
GPIO13, Blue LED (inverted),
|
|
|
|
GPIO4, Optional sensor
|
|
|
|
GPIO14, Optional sensor
|
|
|
|
|
|
|
|
Sonoff Dual R2
|
|
|
|
--------------
|
|
|
|
|
|
|
|
.. pintable::
|
|
|
|
|
|
|
|
GPIO12, Relay #1,
|
|
|
|
GPIO5, Relay #2,
|
|
|
|
GPIO10, Button,
|
|
|
|
GPIO13, Blue LED (inverted),
|
|
|
|
GPIO4, Optional sensor
|
|
|
|
GPIO14, Optional sensor
|
|
|
|
|
|
|
|
Sonoff Pow R1
|
|
|
|
-------------
|
2018-06-01 18:10:00 +02:00
|
|
|
|
2018-11-15 20:13:28 +01:00
|
|
|
(equivalent to Huafan SS)
|
2018-06-01 18:10:00 +02:00
|
|
|
|
2018-11-15 20:13:28 +01:00
|
|
|
.. pintable::
|
|
|
|
|
|
|
|
GPIO0, Button (inverted),
|
|
|
|
GPIO12, Relay and Red LED,
|
|
|
|
GPIO15, Blue LED,
|
|
|
|
|
|
|
|
GPIO5, HLW8012 SEL Pin
|
|
|
|
GPIO13, HLW8012 CF1 Pin
|
|
|
|
GPIO14, HLW8012 CF Pin
|
|
|
|
|
|
|
|
See :doc:`/esphomeyaml/components/sensor/hlw8012` for measuring power.
|
|
|
|
|
|
|
|
Sonoff Pow R2
|
|
|
|
-------------
|
|
|
|
|
|
|
|
(equivalent to Huafan SS)
|
|
|
|
|
|
|
|
.. pintable::
|
|
|
|
|
|
|
|
GPIO0, Button (inverted),
|
|
|
|
GPIO12, Relay and Red LED,
|
|
|
|
GPIO13, Blue LED (inverted),
|
|
|
|
|
|
|
|
See :doc:`/esphomeyaml/components/sensor/cse7766` for measuring power.
|
|
|
|
|
|
|
|
Sonoff S20, Sonoff S22, Sonoff S26
|
|
|
|
----------------------------------
|
|
|
|
|
|
|
|
See :doc:`sonoff_s20`.
|
2018-06-01 18:10:00 +02:00
|
|
|
|
|
|
|
Slampher
|
2018-08-24 22:44:01 +02:00
|
|
|
--------
|
2018-06-01 18:10:00 +02:00
|
|
|
|
2018-11-15 20:13:28 +01:00
|
|
|
.. pintable::
|
2018-06-01 18:10:00 +02:00
|
|
|
|
2018-11-15 20:13:28 +01:00
|
|
|
GPIO0, Button (inverted),
|
2019-01-25 17:33:14 +01:00
|
|
|
GPIO12, Relay and Red LED,
|
2018-11-15 20:13:28 +01:00
|
|
|
GPIO13, Blue LED (inverted),
|
2018-11-17 10:07:22 +01:00
|
|
|
GPIO1, UART TX pin (for external sensors)
|
|
|
|
GPIO3, UART RX pin (for external sensors)
|
2018-06-01 18:10:00 +02:00
|
|
|
|
|
|
|
Sonoff Touch
|
2018-08-24 22:44:01 +02:00
|
|
|
------------
|
2018-06-01 18:10:00 +02:00
|
|
|
|
2018-11-15 20:13:28 +01:00
|
|
|
.. pintable::
|
2018-06-01 18:10:00 +02:00
|
|
|
|
2018-11-15 20:13:28 +01:00
|
|
|
GPIO0, Button (inverted),
|
|
|
|
GPIO12, Relay and Red LED,
|
|
|
|
GPIO13, Blue LED (inverted),
|
2018-11-17 10:07:22 +01:00
|
|
|
GPIO1, UART TX pin (for external sensors)
|
|
|
|
GPIO3, UART RX pin (for external sensors)
|
2018-06-01 18:10:00 +02:00
|
|
|
|
|
|
|
Sonoff LED
|
2018-08-24 22:44:01 +02:00
|
|
|
----------
|
2018-06-01 18:10:00 +02:00
|
|
|
|
2018-11-15 20:13:28 +01:00
|
|
|
.. pintable::
|
|
|
|
|
|
|
|
GPIO0, Button (inverted),
|
|
|
|
GPIO13, Blue LED (inverted),
|
|
|
|
GPIO5, Red Channel
|
|
|
|
GPIO4, Green Channel
|
|
|
|
GPIO15, Blue Channel
|
|
|
|
GPIO12, Cold White Channel
|
|
|
|
GPIO14, Warm White Channel
|
|
|
|
|
|
|
|
See :doc:`/esphomeyaml/components/light/rgbww` for controlling the lights together with
|
|
|
|
:doc:`/esphomeyaml/components/output/esp8266_pwm`.
|
|
|
|
|
|
|
|
ElectroDragon
|
|
|
|
-------------
|
|
|
|
|
|
|
|
.. pintable::
|
2018-06-01 18:10:00 +02:00
|
|
|
|
2018-11-15 20:13:28 +01:00
|
|
|
GPIO2, Button 1 (inverted),
|
|
|
|
GPIO0, Button 2 (inverted),
|
|
|
|
GPIO13, Relay 1 and Red LED,
|
|
|
|
GPIO12, Relay 2 and Red LED,
|
|
|
|
GPIO16, Green/Blue LED
|
|
|
|
GPIO17, Analog Input
|
|
|
|
|
|
|
|
|
|
|
|
Sonoff SC
|
|
|
|
---------
|
|
|
|
|
|
|
|
.. pintable::
|
|
|
|
|
|
|
|
GPIO12, Light,
|
|
|
|
GPIO13, Red LED (inverted)
|
|
|
|
|
|
|
|
See :doc:`/esphomeyaml/components/light/monochromatic` and :doc:`/esphomeyaml/components/output/esp8266_pwm`
|
|
|
|
for controlling the light pin.
|
|
|
|
|
|
|
|
Sonoff 4CH Pro
|
|
|
|
--------------
|
|
|
|
|
|
|
|
Same configuration as the :doc:`Sonoff 4CH <sonoff_4ch>`.
|
|
|
|
|
|
|
|
|
|
|
|
Sonoff B1, Ai-Thinker AiLight
|
|
|
|
-----------------------------
|
|
|
|
|
|
|
|
See :doc:`/esphomeyaml/components/my9231`.
|
|
|
|
|
|
|
|
Sonoff T1 1CH, 2CH, 3CH
|
|
|
|
-----------------------
|
|
|
|
|
|
|
|
.. pintable::
|
|
|
|
|
|
|
|
GPIO0, Button 1 (inverted),
|
|
|
|
GPIO12, Relay 1 and Blue LED,
|
|
|
|
GPIO9, Button 2 (inverted),
|
|
|
|
GPIO5, Relay 2 and Blue LED,
|
|
|
|
GPIO10, Button 3 (inverted),
|
|
|
|
GPIO4, Relay 3 and Blue LED,
|
2018-11-17 10:07:22 +01:00
|
|
|
GPIO1, UART TX pin (for external sensors)
|
|
|
|
GPIO3, UART RX pin (for external sensors)
|
2018-11-15 20:13:28 +01:00
|
|
|
|
|
|
|
Arilux LC10, Magic Home
|
|
|
|
-----------------------
|
|
|
|
|
|
|
|
.. pintable::
|
|
|
|
|
|
|
|
GPIO2, Blue LED,
|
|
|
|
GPIO14, Red Channel,
|
|
|
|
GPIO5, Green Channel,
|
|
|
|
GPIO12, Blue Channel,
|
|
|
|
GPIO13, White Channel,
|
|
|
|
|
2018-11-17 10:07:22 +01:00
|
|
|
GPIO1, UART TX pin (for external sensors)
|
|
|
|
GPIO3, UART RX pin (for external sensors)
|
2018-11-15 20:13:28 +01:00
|
|
|
|
|
|
|
See :doc:`/esphomeyaml/components/light/rgbw` for controlling the lights together with
|
|
|
|
:doc:`/esphomeyaml/components/output/esp8266_pwm`.
|
2018-06-01 18:10:00 +02:00
|
|
|
|
|
|
|
Arilux LC01
|
2018-08-24 22:44:01 +02:00
|
|
|
-----------
|
2018-06-01 18:10:00 +02:00
|
|
|
|
2018-11-15 20:13:28 +01:00
|
|
|
.. pintable::
|
2018-06-01 18:10:00 +02:00
|
|
|
|
2018-11-15 20:13:28 +01:00
|
|
|
GPIO0, Button (inverted),
|
|
|
|
GPIO2, Blue LED,
|
|
|
|
GPIO5, Red Channel,
|
|
|
|
GPIO12, Green Channel,
|
|
|
|
GPIO13, Blue Channel,
|
|
|
|
GPIO14, White Channel,
|
2018-06-01 18:10:00 +02:00
|
|
|
|
2018-11-17 10:07:22 +01:00
|
|
|
GPIO1, UART TX pin (for external sensors)
|
|
|
|
GPIO3, UART RX pin (for external sensors)
|
2018-06-01 18:10:00 +02:00
|
|
|
|
2018-11-15 20:13:28 +01:00
|
|
|
See :doc:`/esphomeyaml/components/light/rgbw` for controlling the lights together with
|
|
|
|
:doc:`/esphomeyaml/components/output/esp8266_pwm`.
|
2018-06-01 18:10:00 +02:00
|
|
|
|
2019-01-18 16:28:14 +01:00
|
|
|
Arilux LC02
|
|
|
|
-----------
|
|
|
|
|
|
|
|
.. pintable::
|
|
|
|
|
|
|
|
GPIO0, Button (inverted),
|
|
|
|
GPIO2, Blue LED,
|
|
|
|
GPIO5, Red Channel,
|
|
|
|
GPIO14, Green Channel,
|
|
|
|
GPIO12, Blue Channel,
|
|
|
|
GPIO13, White Channel,
|
|
|
|
|
|
|
|
GPIO1, UART TX pin (for external sensors)
|
|
|
|
GPIO3, UART RX pin (for external sensors)
|
|
|
|
|
|
|
|
See :doc:`/esphomeyaml/components/light/rgbw` for controlling the lights together with
|
|
|
|
:doc:`/esphomeyaml/components/output/esp8266_pwm`.
|
|
|
|
|
2018-11-15 20:13:28 +01:00
|
|
|
Arilux LC11
|
|
|
|
-----------
|
2018-06-01 18:10:00 +02:00
|
|
|
|
2018-11-15 20:13:28 +01:00
|
|
|
.. pintable::
|
2018-06-01 18:10:00 +02:00
|
|
|
|
2018-11-15 20:13:28 +01:00
|
|
|
GPIO0, Button (inverted),
|
|
|
|
GPIO2, Blue LED,
|
|
|
|
GPIO5, Red Channel,
|
|
|
|
GPIO4, Green Channel,
|
|
|
|
GPIO14, Blue Channel,
|
|
|
|
GPIO13, Cold White Channel,
|
|
|
|
GPIO12, Warm White Channel,
|
2018-06-01 18:10:00 +02:00
|
|
|
|
2018-11-17 10:07:22 +01:00
|
|
|
GPIO1, UART TX pin (for external sensors)
|
|
|
|
GPIO3, UART RX pin (for external sensors)
|
2018-06-01 18:10:00 +02:00
|
|
|
|
2018-11-15 20:13:28 +01:00
|
|
|
See :doc:`/esphomeyaml/components/light/rgbww` for controlling the lights together with
|
|
|
|
:doc:`/esphomeyaml/components/output/esp8266_pwm`.
|
2018-06-01 18:10:00 +02:00
|
|
|
|
|
|
|
Sonoff S31
|
2018-08-24 22:44:01 +02:00
|
|
|
----------
|
2018-06-01 18:10:00 +02:00
|
|
|
|
2018-11-15 20:13:28 +01:00
|
|
|
.. pintable::
|
|
|
|
|
|
|
|
GPIO0, Button (inverted),
|
|
|
|
GPIO12, Relay and Red LED,
|
|
|
|
GPIO13, Green LED (inverteD),
|
|
|
|
|
|
|
|
See :doc:`/esphomeyaml/components/sensor/cse7766` for measuring power
|
|
|
|
|
|
|
|
Shelly 1
|
|
|
|
--------
|
|
|
|
|
|
|
|
.. pintable::
|
|
|
|
|
|
|
|
GPIO4, Relay,
|
|
|
|
GPIO5, SW Input,
|
2018-06-01 18:10:00 +02:00
|
|
|
|
2018-12-15 11:09:56 +01:00
|
|
|
Shelly 2
|
|
|
|
--------
|
|
|
|
|
|
|
|
.. pintable::
|
|
|
|
|
|
|
|
GPIO4, Relay #1,
|
|
|
|
GPIO5, Relay #2,
|
|
|
|
GPIO12, SW Input #1,
|
|
|
|
GPIO14, SW Input #2,
|
|
|
|
|
2018-06-01 18:10:00 +02:00
|
|
|
See Also
|
2018-08-24 22:44:01 +02:00
|
|
|
--------
|
2018-06-01 18:10:00 +02:00
|
|
|
|
|
|
|
- :doc:`sonoff_s20`
|
|
|
|
- :doc:`sonoff_4ch`
|
2018-06-03 11:16:39 +02:00
|
|
|
- :doc:`sonoff_basic`
|
2018-06-01 18:10:00 +02:00
|
|
|
- :doc:`esp8266`
|
2018-06-04 08:17:22 +02:00
|
|
|
- `Edit this page on GitHub <https://github.com/OttoWinter/esphomedocs/blob/current/esphomeyaml/devices/sonoff.rst>`__
|
2018-10-12 16:33:22 +02:00
|
|
|
|
|
|
|
.. disqus::
|