Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelkamprath/706d97b4948a16ec9118d34179f70860 to your computer and use it in GitHub Desktop.
Save michaelkamprath/706d97b4948a16ec9118d34179f70860 to your computer and use it in GitHub Desktop.
FEIT Electric Smart WiFi Dimmer Conversion to OpenBK7231T

Converting FEIT Electric Smart Wifi Dimmer to OpenBK7231T

The following steps shuld be taken to convert the FEIT Electic Smart WiFi Dimmer switch to be cloud-free using the OpenBK7231T software.

WARNING - Modifying electrical equipment that operates at mains power can be dangerous, even deadly, if you you make a mistake. Seek professional help with this conversion if you have any doubts (or should have doubts) in your ability to do it.

Reflashing Switch with OpenBK7231T Software

Note that this process requires you to have a UART capable of operating at 3.3 volts, some wires to connect the UART to the switch's circuit board, and a computer the UART can conncet to that has Python 3 installed.

Disassemble the switch, removing the circuit board form the switch unit. Be sure not to lose any of the screws or the platstic PCB cover you had to remove. Then, attach 4 wires tyoe the RX1, TX1, 3V3, and GND points on the circuit board. Also, connected a jumper from the NRST pad to GND. Then connect the wires to a UART capable of operating at 3V3 voltage as follows:

  • RX1 --> UART TX
  • TX1 --> UART RX
  • GND --> UART GND
  • 3v3 --> This will connect to the VCC of the UART, but this connection will be made later during the flashing process.

Download the UART variant of the BK7321T platform build of the OpenBK7231T_App driver software.

Then install the python-based flashing software:

git clone git@github.com:OpenBekenIOT/hid_download_py.git
cd hid_download_py
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

With the UART connected to your computer but the 3V3 connection not yet made to the switch's circuit board, start the flashing process with this command:

python uartprogram /path/to/OpenBK7231T_UA_1.15.601.bin -d /dev/cu.usb00000000 -w

Where OpenBK7231T_UA_1.15.601.bin is the driver software you downloaded above, and the -d option's argument is the computer's serial port that the UART is connected to. When the flashing process has started, then connect the 3V3 line form the switch's circuit board to the UART to boat the circuit board. If the flashing process does not succeed, you may need to repeat the flashing start process a few times to get the timing right.

When the flashing is done but before you disconnect the dimmer switch's circuit board from the UART power, connect your mobile phone's or computer's wifi to the access point that the switch's circuit board is now advertising. It should be named something similar to OpenBK7312T_.... Once connected, update the board's wifi setting to connect to your wifi network.

Next, open the "web app" from the root loevel of the OpenBK web UI. Navigate to the file system tab, create a new file named autoexec.bat, open it for editting, then place the following into the file's editor:'

startDriver TuyaMCU
setChannelType 1 toggle
setChannelType 2 dimmer
setChannelType 4 OffDimBright
tuyaMcu_setDimmerRange 0 1000
linkTuyaMCUOutputToChannel 1 bool 1
linkTuyaMCUOutputToChannel 2 val 2
linkTuyaMCUOutputToChannel 3 val 3
linkTuyaMCUOutputToChannel 101 enum 4

Save the changes to the file, then navigate to the "Change startup Command Text" option under the "Config" page of the root level HTML page for the switch. Here, enter exec autoexec.bat and click submit.

At this point, the switch is fully configured for operating as a dimmer switch. Carefully remove the wires connected to the switch's circuit board, and reassemble the switch, ensuring the six vertical wires from the switch's base unit are properly seated into the receptable on the circuit board that was just modified. Install the switch as desired (review FEIT Electric's wiring diagrams first!!), and reconnect to it's web page at the IP address your wifi provides it. Update the switch's configuration as desired, notably you might wish to change the switch's name.

Home Assistant Configuration

The best way to configure the updated FEIT Electric Smart Wifi Dimmer switch with Home Assistant is to set up the MQTT connection in the switch's configuration UI, then updating Home Assistant's configuration to know where to look on your MQTT message bus for the switch. To do this, first ensure your Home Assistant deployment has the MQTT integration activated. Then confgure the switch's MQTT configuration under the "Configure MQTT" option of the switch's confifuration UI. Be sure to set the "Client Topic" to a unique value for this switch. Then edit the Home Assistant configuration.yaml file a with a block that looks somthing like this:

mqtt:
  light:
    - name: My Switch Name
      unique_id: my_switch_name
      command_topic: my_switch_prefix/1/set
      state_topic: my_switch_prefix/1/get
      brightness_command_topic: my_switch_prefix/2/set
      brightness_state_topic: my_switch_prefix/2/get
      brightness_scale: 100
      payload_on: 1
      payload_off: 0
      qos: 1
      retain: true
      device:
        configuration_url: http://my.switch.ip/index
        manufacturer: FEIT Electric
        model: Smart Wi-Fi Dimmer
        name: Stairway Lights Dimmer
        identifiers: [ 'my_switch_name' ]

Where my_switch_prefix is the "Client Topic" value set in the "MQTT Configuration" of the OpenBK7231T configuration UI running on the switch. Reload the Home Assistant configuration and the switch should appear under the MQTT integration.

Video

Here is a video that walks through this process: Upgrading the FEIT Electric Smart WiFi Dimmer to work with Home Assistant

@evans036a
Copy link

thankyou sooo much for these instructions and vid.

awesome job

steve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment