esphome-docs/cookbook/h801.rst

127 lines
3.4 KiB
ReStructuredText
Raw Normal View History

2019-02-16 23:24:32 +01:00
H801 RGBW LED controller
========================
2020-05-10 21:27:59 +02:00
The H801 is pretty affordable and easy to hack and adapt to your needs. It can be found on `AliExpress <https://s.click.aliexpress.com/e/bbnUDBZW>`__
2019-02-27 18:32:47 +01:00
`Here <http://tinkerman.cat/closer-look-h801-led-wifi-controller/>`__ is an article about the
hardware for those who have an interest for more details about the board.
2019-02-16 23:24:32 +01:00
It can be used as a RGB, RGBW, RGB dual white or even control 5 individual monochromatic strips if you want or combinations of these.
.. figure:: images/h801.jpg
:align: center
:width: 80.0%
2019-02-16 23:25:23 +01:00
For ESPHome, you can then use the :doc:`RGBW </components/light/rgbw>`
2019-02-16 23:24:32 +01:00
and the :doc:`ESP8266 Software PWM output </components/output/esp8266_pwm>` components using below configuration:
.. code-block:: yaml
2019-02-16 23:25:23 +01:00
esphome:
2019-02-16 23:24:32 +01:00
name: h801light
platform: ESP8266
board: esp01_1m
wifi:
ssid: 'WIFI'
password: 'WIFIPASS'
2019-02-27 18:32:47 +01:00
manual_ip:
2019-02-16 23:24:32 +01:00
static_ip: x.x.x.x
gateway: x.x.x.x
subnet: 255.255.255.0
logger:
api:
ota:
sensor:
- platform: wifi_signal
name: "WiFi Signal h801light"
update_interval: 60s
#RGBWarm
output:
- platform: esp8266_pwm
pin: 12
frequency: 1000 Hz
2019-02-27 18:32:47 +01:00
id: pwm_b
2019-02-16 23:24:32 +01:00
- platform: esp8266_pwm
pin: 13
2019-02-16 23:24:32 +01:00
frequency: 1000 Hz
2019-02-27 18:32:47 +01:00
id: pwm_g
2019-02-16 23:24:32 +01:00
- platform: esp8266_pwm
pin: 15
2019-02-16 23:24:32 +01:00
frequency: 1000 Hz
2019-02-27 18:32:47 +01:00
id: pwm_r
2019-02-16 23:24:32 +01:00
- platform: esp8266_pwm
pin: 14
frequency: 1000 Hz
id: pwm_w
light:
- platform: rgbw
name: "H801 Light"
red: pwm_r
green: pwm_g
blue: pwm_b
white: pwm_w
2020-05-10 21:27:59 +02:00
Make your node in the ESPHome dashboard and compile/upload it.
2019-02-16 23:33:36 +01:00
(if it fails OTA it must be uploaded manually with your favorite ESP flasher,
e.g. :ref:`esphome-flasher <esphome-flasher>`)
2019-02-16 23:24:32 +01:00
.. figure:: images/gpio.jpg
:align: center
:width: 80.0%
Front side of board with pins soldered on
.. figure:: images/back.jpg
:align: center
:width: 80.0%
Back side of the board (don't melt the blue and red wire when soldering)
.. figure:: images/rgbwarm.jpg
:align: center
:width: 80.0%
This LED strip can be used with the sketch as-is
.. figure:: images/rgbw.jpg
:align: center
:width: 80.0%
2020-05-10 21:27:59 +02:00
For this type of led strip you have to swap the white and blue GPIO numbers in the sketch.
2019-02-16 23:24:32 +01:00
2020-05-10 21:27:59 +02:00
You will need to solder pins to the board inside the H801 (fortunately it's pretty roomy and
not a lot of components or stuff in the way apart from the 2 wires on the back).
2019-02-16 23:24:32 +01:00
2020-05-10 21:27:59 +02:00
3.3V, GND, TX and RX (RX to RX and TX to TX) needs to be connected to your serial adapter, the
two other pins must be shorted throughout the flashing process by a jumper or a breadboard cable.
2019-02-27 18:32:47 +01:00
(Remember to remove it after flashing)
2019-02-16 23:24:32 +01:00
Add A PIR(Motion) Sensor
------------------------
It's possible to use the header that was soldered on for flashing as an input.
The example below uses the TX pin as a PIR motion sensor input:
.. figure:: images/h801-pir_sensor.jpg
:align: center
:width: 80.0%
H801 shown with PIR connedted to header pins
The following can be appended to the YAML file for your H801 to configure the TX pin as a motion
sensor input.
.. code-block:: yaml
binary_sensor:
- platform: gpio
pin: GPIO3
name: "GPIO3-TX Motion"
device_class: motion
2019-02-16 23:24:32 +01:00
See Also
--------
- :doc:`/components/light/rgbw`
- :doc:`/components/output/esp8266_pwm`
- :ghedit:`Edit`