ESPHome-Devices/components/tuya_dimmer_as_fan
2021-07-13 07:55:29 -05:00
..
__init__.py Rewrite the Tuya dimmer as fan component (#11) 2021-07-13 07:55:29 -05:00
fan.py Rewrite the Tuya dimmer as fan component (#11) 2021-07-13 07:55:29 -05:00
README.md Rewrite the Tuya dimmer as fan component (#11) 2021-07-13 07:55:29 -05:00
tuya_dimmer_as_fan.cpp Rewrite the Tuya dimmer as fan component (#11) 2021-07-13 07:55:29 -05:00
tuya_dimmer_as_fan.h Rewrite the Tuya dimmer as fan component (#11) 2021-07-13 07:55:29 -05:00

Tuya Light Plus Component

Overview

This a modified version of the Tuya fan component I use with Feit Dimmers (but it will likely work with other Tuya dimmers) to control bathroom fans. The major change from the standard Tuya fan component (other than removing options for speed, oscillation, and direction) is adding a function to always change the dimmer back to the maximum "brightness" effectively making this only an on/off device.

Setup

Using the External Components feature in ESPHome you can add this component to your devices directly from my GitHub repo. Note currently this component requires pulling in my custom version of the Tuya component as well to prevent communication issues between the ESP8266 and the Tuya MCU.

external_components:
  - source: github://nuttytree/esphome
    components: [ tuya, tuya_dimmer_as_fan ]

Like the standard Tuya fan component you need to have the UART and Tuya components.

uart:
  rx_pin: GPIO3
  tx_pin: GPIO1
  baud_rate: 9600

tuya:

Add and configure the Tuya Dimmer as Fan component

fan:
  - platform: tuya_dimmer_as_fan
    name: my_fan
    switch_datapoint: 1
    dimmer_datapoint: 2
    dimmer_max_value: 1000

Configuration Variables

  • id (Optional, ID): Manually specify the ID used for code generation.
  • name (Required, string): The name of the light.
  • switch_datapoint (Required, int): The datapoint id number of the power switch.
  • dimmer_datapoint (Required, int): The datapoint id number of the dimmer value.
  • dimmer_max_value (Optional, int, default 255): The highest dimmer value allowed.