...as you can see in my video, I can toggle the switch in the MQTT server and it does change the state of the OpenBeken button, but does not change the actual load (light-bulb) connected to the wall-switch. On the other hand, if I click on the OpenBeken interface, it does switch the light on/off but is not reflecting the state of the MQTT broker sliders...
Can someone show me a sample yaml script for my application?
Side note: I think HA Discovery for TuyaMCU devices would be a great priority feature - would enable using these OpenBeken models as a "Device" in Home Assistant, and would make the platform more approachable for new folks.
Side note: I think HA Discovery for TuyaMCU devices would be a great priority feature - would enable using these OpenBeken models as a "Device" in Home Assistant, and would make the platform more approachable for new folks.
I will try to look into that, which channel types for TuyaMCU should have top priority?
btw it seems that your request just boils down to "make custom channel types discoverable" because the OBK frontend is not aware about TuyaMCU and channel values are seamlessly mapped to TuyaMCU dpIDs.... which TuyaMCu devices do you have in mind with those request? There may be a slight issue with TuyaMCU dimmers because we have Toggle and Dimmer as separate channels and the Discovery would have to pair them somehow... but I will try to figure it out, at least for the common types of devices.
@mattj do you also think that old Hass yaml generator can be removed and instead we can allow copying out the discovery yaml and also modification on that? I think we spoke about that about a month ago
You have TuyaMCU enabled and DGR (Device Groups), did you set something in Config->Device Groups panel?
Why do you have a Power channel? Is it measuring energy? Maybe you need to clear role of one of unused channels, that you have left over from previous experiments?
wesduda wrote:
...if I select everting in the box and delete it, click "Submit" and the whole string reappear in the dialog box.
Should it be like that?
It must be a bug, you can try entering anything like "sagasgs" random string, but I don't know how do you manage to get that bug.
For what it's worth, I pulled together all the various tidbits in this thread into one comprehensive guide on how to update the FEIT Electric Smart WiFi Dimmer switch with OpenBK7231T: feit-electric-dimmer-openbk7231t-conversion.md. This document describes what I have done (based on the comments here) to update a number of these dimmer switches. If I missed anything or could improve the explanation, please tell me and I will update the guide.
Awesome guide @michael6! very easy to follow, and matches the config I used.
Couple minor notes, (on Windows, at least) using the latest flashing tool works like a charm. Even has the ability to download the latest version automatically. I think the UART method is considered obsolete.
Couple minor notes, (on Windows, at least) using the latest flashing tool works like a charm. Even has the ability to download the latest version automatically. I think the UART method is considered obsolete.
Hmmm ... I will have to check that out. I am using a Mac so clearly running a Windows application is not a desirable path. Running a Python script is operating system agnostic hence the method I gravitated to. However I see that this flashing tool claims to be runnable using mono. While I would much rather install Python to run a script (because any hacker usually has Python installed already) than install mono to run a Windows app, I will test it out to see if I can get that path working on my Mac.
Thanks for all help, there is a lot of progress in my knowledge of the subject. ....but as per Murphy's law, I was trying to do the firmware update ota
and I chose the wrong file....I will take the switch apart tomorrow, and flush the right firmware
and follow michael6's guide to tweak this dimmer sw. to work with mqtt.
For many years, I'm an electrician by trade, and I believe those dimmers are well manufactured,
solid and unbelievably cheap, at least in my area.
The open source firmware makes the switch so attractive
I have a follow-up question. Is there any way to enable additional actions? e.g., double click or “hold” actions on the main button. Or is that an issue with the TuyaMCU?
Ideally would love the ability to present those actions via MQTT.
However, they are not possible in TuyaMCU because TuyaMCU only reports new relay states as booleans so there is no way to tell if the button is pressed now or not.
One thing you could do is to cut off the buttons from TuyaMCU and manually route a wire from button to WiFi module unused GPIOs.
Thanks - that does make sense (I had a sneaking suspicion that the TuyaMCU would get in the way). Not going to chance significant hardware mods on a mains-powered switch - not that ambitious
Side note: for others who might be in the same boat - I have ~30 of these running now, been pretty solid. I ended up creating an MQTT group topic for these specific switches which enable me to batch update, and also batch change the state of things like the LED off/dim/bright state. This guide here was super helpful: https://www.elektroda.com/rtvforum/topic3947241.html
I had a few follow-up questions. First off - let me say that these switches have been pretty rock solid if anyone ends up reading this and is looking to buy. Still the best "true" (dimmers on both ends) three-way HA-compatible dimmers I could find.
1) The Off/Dim/Bright toggle for the LED indicator - is there any way to expose this via MQTT (and HA Discovery)? It works via the webUI and via MQTT group commands - but I'd love to add it in as a toggle on Home Assistant.
2) Any idea if transition times would be enabled at some point in the future? MQTT Light appears to support them with the JSON & template schemas. This would be a helpful add for all Beken lights. (Does this work in Tasmota compatible API? - I haven't checked yet.)
3) I assume that the TuyaMCU handles the dimming function.... Adjusting the "SetDimmerRange" lower bound works from the WebUI/MQTT, but if you use the physical controls, it still dims lower. I figure this is outside of the BK-chip controls, but thought I'd ask if anyone knew.
Hello all, I just bought the Feit Dimmer from Amazon.ca and got the new version. The old version had a chip soldered on it. I was used to unsoldering and resoldering an ESP8266 with Tasmota...
Now, I need to work with OpenBK. It was the first time, and I was able to make the switch work and control it with OpenHab. That being said, I tweaked the autoexec.bat file to map the LED status to the state of the power. I like to have the DIM status LED when the light is off and the status OFF when the light is ON. This helps to find the switch when it's dark in the room.
I am not sure if this information will help anyone at this point since it only adds a second dimmer for the ability to set the minimum brightness for use with the physical dimmer buttons only.
First, a word of caution: when separating the two halves of the switch, make sure you lift the top halve straight up from the bottom halve because header pins connect the electronic circuit board in the white button halve to the mechanical portion in the black halve, and you don’t want to bend or break them.
To flash, I used a CH341A serial programmer with male DuPont cables that I had just pushed into each via hole for the 3V, GND, TX1, RX1 and touched CEN to GND to start the programming. After programming, you can move from using TX1/RX1 to TX2/TX2 if you would like to read the UART output. If you try to flash with a CH341A using its supplied 3.3V output, first check to make sure that it actually outputs 3.3V. Most of the black and yellow versions on the market actually incorrectly output 5V on the 3.3V pin, and 5V might damage the FEIT circuit board. A number of CH341A voltage fix how-tos on the internet to fix it.
When I issued the command “startDriver TuyaMCU”, followed by “tuyaMcu_sendQueryState” on the logs screen of the web app, I get the following response:
Debug:CMD:cmd [tuyaMcu_sendQueryState]
Info:CMD:[WebApp Cmd 'tuyaMcu_sendQueryState' Result] OK
Info:TuyaMCU:Received: 55 AA 03 07 00 05 01 01 00 01 00 11
Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
Info:TuyaMCU:ParseState: id 1 type 1-bool len 1
Info:TuyaMCU:ParseState: byte 0
Debug:TuyaMCU:ApplyMapping: id 1 (val 0) not mapped
Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 03 E8 04
Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
Info:TuyaMCU:ParseState: id 2 type 2-val len 4
Info:TuyaMCU:ParseState: int32 1000
Debug:TuyaMCU:ApplyMapping: id 2 (val 1000) not mapped
Info:TuyaMCU:Received: 55 AA 03 07 00 08 03 02 00 04 00 00 00 0A 24
Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
Info:TuyaMCU:ParseState: id 3 type 2-val len 4
Info:TuyaMCU:ParseState: int32 10
Debug:TuyaMCU:ApplyMapping: id 3 (val 10) not mapped
Info:TuyaMCU:Received: 55 AA 03 07 00 05 65 04 00 01 00 78
Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
Info:TuyaMCU:ParseState: id 101 type 4-enum len 1
Info:TuyaMCU:ParseState: byte 2
Debug:TuyaMCU:ApplyMapping: id 101 (val 2) not mapped
This tells us that the switch has the following IDs: id 1 type 1-bool, id 2 type 2-val, id 3 type 2-val, and id 101 type 4-enum that aren't currently mapped. It also gives us the maximum brightness of 1000 on id 2 and factory minimum brightness of 10 id 3.
With that information the following is the autoexec.bat file that I generated to utilize all of the functions of the switch along with descriptions of what each command is doing so that others might learn for themselves.
# Activates the TuyaMCU Driver
startDriver TuyaMCU
# Sets channel 1 to be a toggle to turn device ON/OFF
setChannelType 1 toggle
# Sets channel 2 to be a dimmer to dim the light(s)
setChannelType 2 dimmer
# Sets channel 3 to be a dimmer to set the minimum brightness (This dimmer will allow you to set the minimum brightness level to fix light flicker, premature turning off of light, when using the physical dimmer buttons only)
setChannelType 3 dimmer
# Sets channel 4 to a selector to set the LED indicator brightness level on the switch from Off/Dim/Bright
setChannelType 4 OffDimBright
# Sets the dimmer range from minimum brightness of 10 and max brightness of 1000 (Adjust the minimum brightness level here to fix light flicker, premature turning off of lights, when adjusting brightness from MQTT or in GUI only)
tuyaMcu_setDimmerRange 10 1000
# Links dpId 1 with a boolean(1) variable type to channel 1 to toggle device ON/OFF
linkTuyaMCUOutputToChannel 1 1 1
# Links dpId 2 with a integer value(2) variable type to channel 2 to dim the light(s)
linkTuyaMCUOutputToChannel 2 2 2
# Links dpId 3 with a integer value(2) variable type to channel 3 to set minimum brightness when using physical dimmer buttons on switch
linkTuyaMCUOutputToChannel 3 2 3
# Links dpid 101 with a enum(4) variable type to channel 4 to adjust the LED indicator on the switch from Off/Dim/Bright
linkTuyaMCUOutputToChannel 101 4 4
First, let me say thank you very much for all your contributions. So much useful information.
I have 5 of these switches with bK7231N. Looks like I did something wrong, because out of 5 only 1 shows up in Home Assistant with ability to control light. The other 4 do show up as well, but only have diagnostic info. I’m using MQTT Mosquitto broker, maybe this is my problem and I should just go with hands-on approach and do it in YAML?
Many thanks to all. I have to this point only used TASMOTA and was fortunate that all the globe bulbs and CE Home switches let me install Tasmota OTA. Well I thought I would get some more switches and automate my vacation property. I was at a store called the Big Box Outlet the other day and what would I see but boxes of Feit 3 way switches for the price of $9 CDN for a box of 3. All the items that are returned to Costco usually end up at this store and there were 40 boxes. Couldn't help myself....
So this was my first attempt at opening a device and replacing the binary. I am just wrapping up for the evening and am so grateful for all the content posted here by everyone. In under 3 hours I managed to open the switch, load the current binary (my Feit had the BK7231N version), and install two of them into my house wiring lab. They are working like a charm. Tomorrow I will move on to getting them into Home Assistant.
Thank you and good luck. Btw, you can also try enabling PowerSave on your device, and keep it on if there are no drawbacks. Just add "PowerSave" in separate line in autoexec.bat. This will reduce power usage and stress on the power supply.
Sure, what would you like to publish? Do you want to attach a button to existing device directly, or do you want to script button to publish something?
>>21327936 Thank you for pointing me in the right direction, "Simple example showing how to do MQTT publish on button event (double click, etc). It also includes button hold event to adjust dimmer."
My current devices for this use case either came with or converted to ESP8266 and flashed with Tasmota, but if I pick up some more I'm happy to know that it would work.
Thank you for this thread. It has helped me to switch to OpenBeken with those Feit smart switches. However, it took me a long long time to find the proper recipe. This is what I can say related to the initial setup to flash those switches.
- I have done the steps below on 3 different Feit switches. I believe from memory that they had the version 1.23 written on the electronic board.
- To be able to flash the latest OpenBeken firmware, I just soldered a wire on the NRST indicated by the previous post. However, I didn't try to use the CEN connector as described above by GoofySpeed, so this one may also work so you can avoid soldering something. So, I have used only the following connection points: 3V, GND, TX1, RX1, and NRST.
- For the remaining of the 4 physical connections (3V, GND, TX1, RX1) I just used simple jump wires to connect everything to a UART to USB device. Of course, the NRST wire had to be shortened with ground at the start of the Feit device to be able to flash the switch.
- To flash I have used the "ltchiptool" tool, that you can find here: Link. However, you need to be aware that this is a python module and so you install it with pip. It is worth noting that I have done this flash process with Ubuntu. All the other tools such as "BK7231 GUI Flash Tool" (Link) or some other python applications did not work. "ltchiptool" was the only tool that worked reliably. By the way, I have tried those other tools under Windows or Linux without any success. Also, "ltchiptool" worked fine with the CLI version of it. I was unable to make it work under Linux with the GUI interface but this is probably due to something that I did not do correctly with the wxpython python module.
- Finally, to flash the device I have used the following command.
1- to make a backup of the currently original firmware:
Note that I'm seeing an error at the end of the flash process but it seems to be without consequences. Also, as long as the flash process was ongoing I had to keep the NRST connection grounded. It takes roughly a minute to have the process completely done and you have a "progress bar" that gives you an idea of how far the process is.
Basically that's it. Hope this will help somebody.
I picked up 8 of these 4 with the TYWE3S and 4 with the 7231T chips. So far I have only worked with the 7231T models. I was able to flash them easily with cloud cutter and got the autoexec.bat file working.
My first question is on device groups. I have set a group "patiolights" on both switches but, when I toggle either switch the other does nothing. I did check the send and receive check boxes. I used the web app to test and from either switch's web app it will toggle the other switch but not the local switch. I see send and receive counts on the two devices home pages. Am I doing something wrong?
Second, to flash the TYWE3S, Confirm I need to desolder and flash via the GUI tool?
The discussion revolves around the BK7231T Feit Smart WiFi Dimmer, focusing on programming challenges and solutions related to the TuyaMCU. Users shared experiences with flashing the device using various methods, including grounding the NRST pad and using FTDI USB to TTL chips. Several users reported success in configuring the dimmer for 3-way switching and controlling the LED indicator. Issues with Home Assistant integration and MQTT configuration were also addressed, with suggestions for writing the autoexec.bat script and YAML configurations. The conversation highlighted the importance of using reliable power supplies and provided insights into troubleshooting common problems encountered during setup. Summary generated by the language model.