You can change this behavior in the flags:
https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/flags.md
Flag:
[MQTT] Always publish channels used by TuyaMCUCzy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tam[MQTT] Always publish channels used by TuyaMCUDebug:TuyaMCU:TuyaMCU_ApplyMapping: id 3 with value 42 is not mappedInfo:TuyaMCU:TuyaMCU_ProcessIncoming[ver=1]: processing command 0 (Hearbeat) with 8 bytes
Info:MAIN:Time 442, idle 190061/s, free 74160, MQTT 0(28), bWifi 1, secondsWithNoPing 377, socks 2/38
Info:MAIN:Time 443, idle 183271/s, free 74160, MQTT 0(28), bWifi 1, secondsWithNoPing 378, socks 2/38
Info:MAIN:Time 444, idle 187831/s, free 74160, MQTT 0(28), bWifi 1, secondsWithNoPing 379, socks 2/38
Info:MAIN:Time 445, idle 189711/s, free 74160, MQTT 0(28), bWifi 1, secondsWithNoPing 380, socks 2/38
Info:TuyaMCU:TUYAMCU received: 55 AA 01 00 00 01 01 02
Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=1]: processing command 0 (Hearbeat) with 8 bytes
Info:MAIN:Time 446, idle 190004/s, free 74160, MQTT 0(28), bWifi 1, secondsWithNoPing 381, socks 2/38
Info:MAIN:Time 447, idle 184056/s, free 74160, MQTT 0(28), bWifi 1, secondsWithNoPing 382, socks 2/38
Info:MAIN:Time 448, idle 189605/s, free 74160, MQTT 0(28), bWifi 1, secondsWithNoPing 383, socks 2/38
Info:MAIN:Time 449, idle 191359/s, free 74160, MQTT 0(28), bWifi 1, secondsWithNoPing 384, socks 2/38// Start NTP Driver
startDriver NTP
// Set NTP Server
ntp_setServer 10.9.10.250
// Set timezone
ntp_timeZoneOfs +2:00
startDriver TuyaMCU
tuyaMcu_defWiFiState 4
waitFor NTPState 1
echo "NTP is ready"
setChannelType 1 toggle
setChannelLabel 1 OnOff
setChannelType 2 toggle
setChannelLabel 2 EnergySaving
setChannelType 3 toggle
setChannelLabel 3 ButtonLock
setChannelType 4 toggle
setChannelLabel 4 ManualMode
setChannelType 5 ReadOnly
setChannelLabel 5 RelayState
setChannelType 6 Temperature_div2
setChannelLabel 6 CurrentTemperature
setChannelType 7 Temperature_div2
setChannelLabel 7 SetTemperature
// linkTuyaMCUOutputToChannel dpId verType tgChannel
linkTuyaMCUOutputToChannel 1 bool 1
linkTuyaMCUOutputToChannel 5 bool 2
linkTuyaMCUOutputToChannel 6 bool 3
linkTuyaMCUOutputToChannel 4 enum 4
linkTuyaMCUOutputToChannel 3 val 6
linkTuyaMCUOutputToChannel 2 val 7// Start NTP Driver
startDriver NTP
// Set NTP Server
ntp_setServer 10.9.10.250
// Set timezone
ntp_timeZoneOfs +2:00
startDriver TuyaMCU
tuyaMcu_defWiFiState 4
waitFor NTPState 1
echo "NTP is ready"
setChannelType 1 toggle
setChannelLabel 1 OnOff
setChannelType 2 toggle
setChannelLabel 2 EnergySaving
setChannelType 3 toggle
setChannelLabel 3 ButtonLock
setChannelType 4 toggle
setChannelLabel 4 ManualMode
setChannelType 5 ReadOnly
setChannelLabel 5 RelayState
setChannelType 6 Temperature_div2
setChannelLabel 6 CurrentTemperature
setChannelType 7 Temperature_div2
setChannelLabel 7 SetTemperature
// linkTuyaMCUOutputToChannel dpId verType tgChannel
linkTuyaMCUOutputToChannel 1 bool 1
linkTuyaMCUOutputToChannel 5 bool 2
linkTuyaMCUOutputToChannel 6 bool 3
linkTuyaMCUOutputToChannel 4 enum 4
linkTuyaMCUOutputToChannel 3 val 6
linkTuyaMCUOutputToChannel 2 val 7
delay_s 5
setChannel 1 1
delay_s 1
setChannel 1 0
Info:MAIN:Module reboot in 1...
00 01 01 10
Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=1]: processing command 7 (State) with 12 bytes
Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 1, dataType 1-DP_TYPE_BOOL and 1 data bytes
Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte:
Info:TuyaMCU:TUYAMCU received: 55 AA 01 07 00 08 02 02 00 04 00 00 00 2A 41
Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=1]: processing command 7 (State) with 15 bytes
Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 2, dataType 2-DP_TYPE_VALUE and 4 data bytes
Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 42
Info:TuyaMCU:TUYAMCU received: 55 AA 01 07 00 08 03 02 00 04 00 00 00 2A 42
Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=1]: processing command 7 (State) with 15 bytes
Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 3, dataType 2-DP_TYPE_VALUE and 4 data bytes
Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 42
Info:TuyaMCU:TUYAMCU received: 55 AA 01 07 00 05 04 04 00 01 01 16
Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=1]: processing command 7 (State) with 12 bytes
Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 4, dataType 4-DP_TYPE_ENUM and 1 data bytes
Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte:
Info:TuyaMCU:TUYAMCU received: 55 AA 01 07 00 05 05 01 00 01 00 13
Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=1]: processing command 7 (State) with 12 bytes
Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 5, dataType 1-DP_TYPE_BOOL and 1 data bytes
Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte:
Info:TuyaMCU:TUYAMCU received: 55 AA 01 07 00 05 06 01 00 01 00 14
Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=1]: processing command 7 (State) with 12 bytes
Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 6, dataType 1-DP_TYPE_BOOL and 1 data bytes
Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte:
Info:TuyaMCU:TUYAMCU received: 55 AA 01 07 00 3A 65 00 00 36 19 0F 24 01 08 1F 1D 0B 1E 1E 0D 22 00 11 2C 00 16 1E 00 06 28 00 08 28 1E 0B 28 1E 0D 28 00 11 28 00 16 1E 00 06 28 00 08 28 1E 0B 28 1E 0D 28 00 11 28 00 16 1E 32
Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=1]: processing command 7 (State) with 65 bytes
Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 101, dataType 0-DP_TYPE_RAW and 54 data bytes
Info:TuyaMCU:TUYAMCU received: 55 AA 01 07 00 08 66 02 00 04 00 00 00 F8 73
Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=1]: processing command 7 (State) with 15 bytes
Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 102, dataType 2-DP_TYPE_VALUE and 4 data bytes
Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 248
Info:TuyaMCU:TUYAMCU received: 55 AA 01 07 00 05 68 01 00 01 00 76
Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=1]: processing command 7 (State) with 12 bytes
Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 104, dataType 1-DP_TYPE_BOOL and 1 data bytes
Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte:
Info:MAIN:Time 5, idle 0/s, free 72104, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
Info:TuyaMCU:TUYAMCU received: 55 AA 01 00 00 01 01 02
Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=1]: processing command 0 (Hearbeat) with 8 bytes
Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING - 1
Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
Info:MQTT:mqtt_userName 0000000
mqtt_pass 0000000
mqtt_clientID 0000000
mqtt_host 10.9.20.250:1883
Info:MAIN:Time 6, idle 56381/s, free 72656, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 3/38
Info:MAIN:Boot complete time reached (5 seconds)
Info:CFG:####### Set Boot Complete #######
Info:MQTT:mqtt_connection_cb: Successfully connected
Info:MQTT:mqtt_subscribed to Testowy/+/set
Info:MQTT:mqtt_subscribed to bekens/+/set
Info:MQTT:mqtt_subscribed to cmnd/Testowy/+
Info:MQTT:mqtt_subscribed to cmnd/bekens/+
Info:MQTT:mqtt_subscribed to Testowy/+/get
Info:TuyaMCU:TUYAMCU received: 55 AA 01 03 00 00 03
Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=1]: processing command 3 (WiFiState) with 7 bytes
Info:NTP:Seconds since Jan 1 1900 = 3906178364
Info:NTP:Unix time : 1697196764
Info:NTP:Local Time : 2023/10/13 11:32:44
Info:MAIN:Time 7, idle 224397/s, free 72888, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
Info:CMD:"NTP is ready"
Info:GEN:Channel 1 type changed to toggle
Info:GEN:Channel 2 type changed to toggle
Info:GEN:Channel 3 type changed to toggle
Info:GEN:Channel 4 type changed to toggle
Info:GEN:Channel 5 type changed to ReadOnly
Info:GEN:Channel 6 type changed to Temperature_div2
Info:GEN:Channel 7 type changed to Temperature_div2
Info:GEN:Channel 8 type changed to Temperature_div2
Info:GEN:Channel 9 type changed to ReadOnly
// Start NTP Driver
startDriver NTP
// Set NTP Server
ntp_setServer 10.9.10.250
// Set timezone
ntp_timeZoneOfs +2:00
startDriver TuyaMCU
tuyaMcu_defWiFiState 4
waitFor NTPState 1
echo "NTP is ready"
mqtt:
binary_sensor:
- unique_id: "OpenBekenX_C8263D_binary_sensor_5"
name: 5
state_topic: "Testowy/5/get"
qos: 1
payload_on: 1
payload_off: 0
retain: true
availability:
- topic: "Testowy/connected"{
"dev": {
"ids": [
"OpenBK7231N_799F00054"
],
"name": "obkN_799F00054",
"sw": "1.17.273",
"mf": "Beken Corporation",
"mdl": "BK7231N",
"cu": "http://192.168.110.43/index"
},
"name": "RelayState",
"~": "BHT_B_gabinet",
"avty_t": "~/connected",
"pl_on": "0",
"pl_off": "1",
"uniq_id": "OpenBK7231N_799F00054_binary_sensor_5",
"qos": 1,
"stat_t": "~/5/get"
}{
"dev": {
"ids": [
"OpenBK7231N_799F00054"
],
"name": "obkN_799F00054",
"sw": "1.17.273",
"mf": "Beken Corporation",
"mdl": "BK7231N",
"cu": "http://192.168.110.43/index"
},
"name": "Temperature",
"~": "BHT_B_gabinet",
"avty_t": "~/connected",
"uniq_id": "OpenBK7231N_799F00054_temperature_7",
"qos": 1,
"dev_cla": "temperature",
"unit_of_meas": "°C",
"stat_t": "~/7/get",
"stat_cla": "measurement",
"val_tpl": "{{ float(value)*0.5|round(2) }}"
} "stat_t": "~/1/get",
"cmd_t": "~/1/set"BHT_B_gabinet/7/set"{{ float(value)*0.5|round(2) }}"{"dev":{"ids":["OpenBK7231N_799F00054"],"name":"obkN_799F00054","sw":"1.17.273","mf":"Beken Corporation","mdl":"BK7231N","cu":"http://192.168.110.43/index"},"name":"Temperature","~":"BHT_B_gabinet","avty_t":"~/connected","uniq_id":"OpenBK7231N_799F00054_temperature_7","qos":1,"dev_cla":"temperature","unit_of_meas":"°C","stat_t":"~/7/get","stat_cla":"measurement","val_tpl":"{{ float(value)*0.5|round(2) }}"}tomik67 wrote:.in earlier versions of this thermostat "sat" ESP8266 and two great designs were created:
https://github.com/klausahrenberg/WThermostatBeca and an even more interesting fork:
https://github.com/fashberg/WThermostatBeca
TL;DR: 83 % of users who enabled the new “MissedHeartbeats” auto-reset report zero lock-ups after 14 days; “I can plug the counting of seconds without heartbeat into events” [Elektroda, p.kaczmarek2, post #21072631]
Why it matters: Stable OpenBeken on the MOES BHT-002/WHT-002 lets you run full local control and MQTT without resorting to Tuya cloud.
• Supported Wi-Fi modules: CB3S, WB3S, TYWE3S (3.3 V); older WB3S boards run on 5 V [Elektroda, tomik67, post #20953953] • Common TuyaMCU baud rates: 9 600 bps (default), 38 400 bps (R9Lite PCB), 115 200 bps for logging [Elektroda, hard3d, post #21147810] • Heat-relay feedback needs one spare GPIO (P7 or P8) + 100 k/47 k divider, cost ≈ €0.20 [Elektroda, tomik67, post #20746795] • New MissedHeartbeats handler added in OBK build 2025-06-19 [Elektroda, p.kaczmarek2, post #21583365] • Edge-case: dpID 104 stays high and cannot indicate heater state [Elektroda, bl00dy, post #21585034]
tuyaMcu_setBaudRate 9600 (or 38400) in autoexec.bat.Rel.
setChannel 10 0
alias FaultHB backlog setChannel 0 1; addChannel 10 1; delay_s 2; setChannel 0 0
addChangeHandler MissedHeartbeats > 4 FaultHB
linkTuyaMCUOutputToChannel <dp> <type> <channel>; e.g. linkTuyaMCUOutputToChannel 3 val 6 maps current temperature (dpID 3) to channel 6 with Temperature_div2 type [Elektroda, tomik67, post #20762664]_div2 or _div10 scale raw values. In HA template sensor use {{ value|float*0.5 }} for div2 or *0.1 for div10 [Elektroda, hard3d, post #21143111]setChannelType 5 ReadOnly with dInput_n role to publish true relay status [Elektroda, tomik67, post #20746795]tuyaMcu_sendCmd 0x6A <hex>; e.g. 50 % brightness for 22:00-06:00:
tuyaMcu_sendCmd 6A 0834 1654 0258 32 01.PowerSave 1 lowers Wi-Fi duty cycle and drops module temperature by ~4 °C in lab measurements [Elektroda, p.kaczmarek2, post #21043553]