I have successfully installed OpenBeken on Minoston MT10W in-wall timer switch (US version). Here is the process I did.
It has a BK7231N and all functions use TuyaMCU. No GPIO pins are used.
I made all firmware changes OTA. No UART flashing was required. (Which is good, because the beken chip is not easy to get at. The device has two boards soldered together by header pins, and the beken chip is hidden in the middle.)
First, I used Tuya-Cloudcutter to install kickstart-bk7231n, and then installed ESPHome. However, I found ESPHome was unstable on it. The device would hang and reboot, for no obvious reason. My guess is that LibreTiny is still a little unstable on this device.
So I switched to OpenBeken. I used the ESPHome web interface on the device to OTA flash OpenBeken from https://github.com/BenJamesAndo/OpenBeken_uf2_firmware
Because this device is all TuyaMCU controls, I had to define all channels myself. Fortunately, I got a complete list of the TuyaMCI device IDs from LibreTiny's ltchiptool, and translated that into an autoexec.bat for OBK.
This is working correctly to control all features of the timer from the device's web interface.
Is there a repository of configurations or sample autoexec.bat files where I can submit this, so the next person who tries this device can use it?
I wasn't really sure how to configure the enum devices. I put in ClampChannel to indicate the proper range, but I don't know if that's really correct or helpful. The "Power Status" dpId 109 and "Countdown Status" dpId 110 are LED controls where 0 = solid on and 1 = flicker. I didn't make them "toggle" because they aren't really off/on, but I suppose toggle_inv could sort of work. The "Active Key" dpId 108 uses a number from 1 to 6, showing which button was last pressed, or letting you turn on the timer using one of the 6 preset times.
OBK has been stable, and I have not had any unexpected hangs or reboots, like I had with ESPHome.
My final goal is to get it working properly in Home Assistant. The autodiscovery mades a few good guesses, but didn't quite get it correct.
The device has one main power relay, and it also has a dimmer for the LED indicator light. Unfortunately, HA autodiscovery combined these together to make a single light device, which is wrong. Here is the autodiscovery MQTT entry, where you can see it combined Channel 1, the relay, with Channel 9, the LED brightness:
homeassistant/light/Timer_Switch_light_1/config
Is there a way I can define my OBK channels to keep those separate, with the relay as a switch on one entity, and a separate entity for the LED brightness?
There is also a countdown number that tells how many seconds are left on the timer. It would be nice to expose this in HA as a sensor, because you can use it to turn on the switch for a certain amount of time. Is there a way that I can define the channel that would generate a sensor in HA autodiscovery?
Is there a channel setting for the other number fields that would just provide simple number sensors in HA?
Thanks
It has a BK7231N and all functions use TuyaMCU. No GPIO pins are used.
I made all firmware changes OTA. No UART flashing was required. (Which is good, because the beken chip is not easy to get at. The device has two boards soldered together by header pins, and the beken chip is hidden in the middle.)
First, I used Tuya-Cloudcutter to install kickstart-bk7231n, and then installed ESPHome. However, I found ESPHome was unstable on it. The device would hang and reboot, for no obvious reason. My guess is that LibreTiny is still a little unstable on this device.
So I switched to OpenBeken. I used the ESPHome web interface on the device to OTA flash OpenBeken from https://github.com/BenJamesAndo/OpenBeken_uf2_firmware
Because this device is all TuyaMCU controls, I had to define all channels myself. Fortunately, I got a complete list of the TuyaMCI device IDs from LibreTiny's ltchiptool, and translated that into an autoexec.bat for OBK.
startDriver TuyaMCU
SetChannelLabel 1 Switch_1
setChannelType 1 toggle
linkTuyaMCUOutputToChannel 1 bool 1
SetChannelLabel 2 Countdown_1
setChannelType 2 TextField
linkTuyaMCUOutputToChannel 7 val 2
SetChannelLabel 3 Button_1_(5_min)
setChannelType 3 TimerSeconds
linkTuyaMCUOutputToChannel 101 val 3
SetChannelLabel 4 Button_2_(10_min)
setChannelType 4 TimerSeconds
linkTuyaMCUOutputToChannel 102 val 4
SetChannelLabel 5 Button_3_(30_min)
setChannelType 5 TimerSeconds
linkTuyaMCUOutputToChannel 103 val 5
SetChannelLabel 6 Button_4_(60_min)
setChannelType 6 TimerSeconds
linkTuyaMCUOutputToChannel 104 val 6
SetChannelLabel 7 Button_5_(2_hour)
setChannelType 7 TimerSeconds
linkTuyaMCUOutputToChannel 105 val 7
SetChannelLabel 8 Button_6_(4_hour)
setChannelType 8 TimerSeconds
linkTuyaMCUOutputToChannel 106 val 8
tuyaMcu_setDimmerRange 0 100
SetChannelLabel 9 Led_Brightness
setChannelType 9 dimmer
linkTuyaMCUOutputToChannel 107 val 9
SetChannelLabel 10 Active_Key
setChannelType 10 TextField
linkTuyaMCUOutputToChannel 108 val 10
ClampChannel 10 0 6
SetChannelLabel 11 Power_Status
setChannelType 11 TextField
linkTuyaMCUOutputToChannel 109 enum 11
ClampChannel 11 0 1
SetChannelLabel 12 Countdown_Status
setChannelType 12 TextField
linkTuyaMCUOutputToChannel 110 enum 12
ClampChannel 12 0 1
SetChannelLabel 13 Always_On
setChannelType 13 toggle
linkTuyaMCUOutputToChannel 111 bool 13
This is working correctly to control all features of the timer from the device's web interface.
Is there a repository of configurations or sample autoexec.bat files where I can submit this, so the next person who tries this device can use it?
I wasn't really sure how to configure the enum devices. I put in ClampChannel to indicate the proper range, but I don't know if that's really correct or helpful. The "Power Status" dpId 109 and "Countdown Status" dpId 110 are LED controls where 0 = solid on and 1 = flicker. I didn't make them "toggle" because they aren't really off/on, but I suppose toggle_inv could sort of work. The "Active Key" dpId 108 uses a number from 1 to 6, showing which button was last pressed, or letting you turn on the timer using one of the 6 preset times.
OBK has been stable, and I have not had any unexpected hangs or reboots, like I had with ESPHome.
My final goal is to get it working properly in Home Assistant. The autodiscovery mades a few good guesses, but didn't quite get it correct.
The device has one main power relay, and it also has a dimmer for the LED indicator light. Unfortunately, HA autodiscovery combined these together to make a single light device, which is wrong. Here is the autodiscovery MQTT entry, where you can see it combined Channel 1, the relay, with Channel 9, the LED brightness:
homeassistant/light/Timer_Switch_light_1/config
{
"dev": {
"ids": [
"Timer Switch"
],
"name": "timerswitch_18CAB9",
"sw": "1.17.366",
"mf": "Beken Corporation",
"mdl": "BK7231N",
"cu": "http://x.x.x.x/index"
},
"name": "Switch_1",
"~": "timerswitch_18CAB9",
"avty_t": "~/connected",
"pl_on": "1",
"pl_off": "0",
"uniq_id": "Timer_Switch_light_1",
"qos": 1,
"stat_t": "~/1/get",
"cmd_t": "~/1/set",
"bri_stat_t": "~/9/get",
"bri_cmd_t": "~/9/set",
"bri_scl": 100
}
Is there a way I can define my OBK channels to keep those separate, with the relay as a switch on one entity, and a separate entity for the LED brightness?
There is also a countdown number that tells how many seconds are left on the timer. It would be nice to expose this in HA as a sensor, because you can use it to turn on the switch for a certain amount of time. Is there a way that I can define the channel that would generate a sensor in HA autodiscovery?
Is there a channel setting for the other number fields that would just provide simple number sensors in HA?
Thanks