diff --git a/docs/README.md b/docs/README.md
index 1679975a0..7e45e4614 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -17,7 +17,7 @@ Do not add anything here, as it will overwritten with next rebuild.
| [Flags](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/flags.md) (40 total) | Flags are global and allows you to alter behaviour of the device. |
| [Drivers](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/drivers.md) (36 total) | Drivers allows you to control certain peripherals or enable certain features that are off by default. |
| [Script constants](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/constants.md) (24 total) | Every console command that takes an integer argument supports certain constant expansion. |
-| [Channel Types](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/channelTypes.md) (37 total) | Channel types are often not required and don't have to be configured, but in some cases they are required for better device control from OpenBeken web panel. Channel types describes the kind of value stored in channel, for example, if you have a Tuya Fan Controller with 3 speeds control, you can set the channel type to LowMidHigh and it will display the correct UI radiobutton on OpenBeken panel.
Some channels have '_div10' or '_div100' sufixes. This is for TuyaMCU. This is needed because TuyaMCU sends values as integers, so it sends, for example, 215 for 21.5C temperature, and we store it internally as 215 and only convert to float for display. |
+| [Channel Types](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/channelTypes.md) (38 total) | Channel types are often not required and don't have to be configured, but in some cases they are required for better device control from OpenBeken web panel. Channel types describes the kind of value stored in channel, for example, if you have a Tuya Fan Controller with 3 speeds control, you can set the channel type to LowMidHigh and it will display the correct UI radiobutton on OpenBeken panel.
Some channels have '_div10' or '_div100' sufixes. This is for TuyaMCU. This is needed because TuyaMCU sends values as integers, so it sends, for example, 215 for 21.5C temperature, and we store it internally as 215 and only convert to float for display. |
| [FAQ](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/faq.md) (27 total) | Here is a detailed list of questions you may ask. Some information from docs is repeated here. |
| [Console/Script commands](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commands.md) (260 total) | There are multiple console commands that allow you to automate your devices. Commands can be entered manually in command line, can be send by HTTP (just like in Tasmota), can be send by MQTT and also can be scripted. |
| [Command Examples](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commandExamples.md) (10 total) | Here you can find some examples of console commands usage |
diff --git a/docs/channelTypes.md b/docs/channelTypes.md
index c61f8c28e..7dc9574d9 100644
--- a/docs/channelTypes.md
+++ b/docs/channelTypes.md
@@ -41,4 +41,5 @@ Do not add anything here, as it will overwritten with next rebuild.
| OffLowMidHighHighest | Like LowMidHigh, but with 5 options. Some of TuyaMCU fans might require that. |
| Custom | A custom channel type that is still send to HA. |
| Power_div10 | Just like power, but with one decimal place (but stored as integer, for TuyaMCU support) |
+| ChType_ReadOnlyLowMidHigh | Like LowMidHigh, but just read only |
| Max | This is the current total number of available channel types. |
diff --git a/docs/commands-extended.md b/docs/commands-extended.md
index bee3f8da2..c0b4d82c7 100644
--- a/docs/commands-extended.md
+++ b/docs/commands-extended.md
@@ -206,7 +206,7 @@ Do not add anything here, as it will overwritten with next rebuild.
| TMGN_SetupButtons | CMD_TMGN_SetupButtons | | File: driver/drv_tm1637.c
Function: NULL); |
| tuyaMcu_testSendTime | | Sends a example date by TuyaMCU to clock/callendar MCU | File: driver/drv_tuyaMCU.c
Function: TuyaMCU_Send_SetTime_Example |
| tuyaMcu_sendCurTime | | Sends a current date by TuyaMCU to clock/callendar MCU. Time is taken from NTP driver, so NTP also should be already running. | File: driver/drv_tuyaMCU.c
Function: TuyaMCU_Send_SetTime_Current |
-| linkTuyaMCUOutputToChannel | [dpId][varType][channelID] | Used to map between TuyaMCU dpIDs and our internal channels. Mapping works both ways. DpIDs are per-device, you can get them by sniffing UART communication. Vartypes can also be sniffed from Tuya. VarTypes can be following: 0-raw, 1-bool, 2-value, 3-string, 4-enum, 5-bitmap. Please see [Tuya Docs](https://developer.tuya.com/en/docs/iot/tuya-cloud-universal-serial-port-access-protocol?id=K9hhi0xxtn9cb) for info about TuyaMCU. You can also see our [TuyaMCU Analyzer Tool](https://www.elektroda.com/rtvforum/viewtopic.php?p=20528459#20528459) | File: driver/drv_tuyaMCU.c
Function: TuyaMCU_LinkTuyaMCUOutputToChannel |
+| linkTuyaMCUOutputToChannel | [dpId][varType][channelID][bDPCache-Optional] | Used to map between TuyaMCU dpIDs and our internal channels. Last argument is optional and 0 by default. You can set it to 1 for battery powered devices, so a variable is set with DPCache, for example a sampling interval for humidity/temperature sensor. Mapping works both ways. DpIDs are per-device, you can get them by sniffing UART communication. Vartypes can also be sniffed from Tuya. VarTypes can be following: 0-raw, 1-bool, 2-value, 3-string, 4-enum, 5-bitmap. Please see [Tuya Docs](https://developer.tuya.com/en/docs/iot/tuya-cloud-universal-serial-port-access-protocol?id=K9hhi0xxtn9cb) for info about TuyaMCU. You can also see our [TuyaMCU Analyzer Tool](https://www.elektroda.com/rtvforum/viewtopic.php?p=20528459#20528459) | File: driver/drv_tuyaMCU.c
Function: TuyaMCU_LinkTuyaMCUOutputToChannel |
| tuyaMcu_setDimmerRange | [Min][Max] | Set dimmer range used by TuyaMCU | File: driver/drv_tuyaMCU.c
Function: TuyaMCU_SetDimmerRange |
| tuyaMcu_sendHeartbeat | | Send heartbeat to TuyaMCU | File: driver/drv_tuyaMCU.c
Function: TuyaMCU_SendHeartbeat |
| tuyaMcu_sendQueryState | | Send query state command. No arguments needed. | File: driver/drv_tuyaMCU.c
Function: TuyaMCU_SendQueryState |
diff --git a/docs/commands.md b/docs/commands.md
index c7f639889..50f39c6b1 100644
--- a/docs/commands.md
+++ b/docs/commands.md
@@ -209,7 +209,7 @@ Do not add anything here, as it will overwritten with next rebuild.
| TMGN_SetupButtons | CMD_TMGN_SetupButtons | |
| tuyaMcu_testSendTime | | Sends a example date by TuyaMCU to clock/callendar MCU |
| tuyaMcu_sendCurTime | | Sends a current date by TuyaMCU to clock/callendar MCU. Time is taken from NTP driver, so NTP also should be already running. |
-| linkTuyaMCUOutputToChannel | [dpId][varType][channelID] | Used to map between TuyaMCU dpIDs and our internal channels. Mapping works both ways. DpIDs are per-device, you can get them by sniffing UART communication. Vartypes can also be sniffed from Tuya. VarTypes can be following: 0-raw, 1-bool, 2-value, 3-string, 4-enum, 5-bitmap. Please see [Tuya Docs](https://developer.tuya.com/en/docs/iot/tuya-cloud-universal-serial-port-access-protocol?id=K9hhi0xxtn9cb) for info about TuyaMCU. You can also see our [TuyaMCU Analyzer Tool](https://www.elektroda.com/rtvforum/viewtopic.php?p=20528459#20528459) |
+| linkTuyaMCUOutputToChannel | [dpId][varType][channelID][bDPCache-Optional] | Used to map between TuyaMCU dpIDs and our internal channels. Last argument is optional and 0 by default. You can set it to 1 for battery powered devices, so a variable is set with DPCache, for example a sampling interval for humidity/temperature sensor. Mapping works both ways. DpIDs are per-device, you can get them by sniffing UART communication. Vartypes can also be sniffed from Tuya. VarTypes can be following: 0-raw, 1-bool, 2-value, 3-string, 4-enum, 5-bitmap. Please see [Tuya Docs](https://developer.tuya.com/en/docs/iot/tuya-cloud-universal-serial-port-access-protocol?id=K9hhi0xxtn9cb) for info about TuyaMCU. You can also see our [TuyaMCU Analyzer Tool](https://www.elektroda.com/rtvforum/viewtopic.php?p=20528459#20528459) |
| tuyaMcu_setDimmerRange | [Min][Max] | Set dimmer range used by TuyaMCU |
| tuyaMcu_sendHeartbeat | | Send heartbeat to TuyaMCU |
| tuyaMcu_sendQueryState | | Send query state command. No arguments needed. |
diff --git a/docs/json/channelTypes.json b/docs/json/channelTypes.json
index 5fd7b90f2..b8d4a7786 100644
--- a/docs/json/channelTypes.json
+++ b/docs/json/channelTypes.json
@@ -287,6 +287,14 @@
"file": "new_pins.h",
"driver": ""
},
+ {
+ "name": "ChType_ReadOnlyLowMidHigh",
+ "title": "TODO",
+ "descr": "Like LowMidHigh, but just read only",
+ "enum": "ChType_ReadOnlyLowMidHigh",
+ "file": "new_pins.h",
+ "driver": ""
+ },
{
"name": "Max",
"title": "TODO",
diff --git a/docs/json/commands.json b/docs/json/commands.json
index 2bcf8d086..35c24c54c 100644
--- a/docs/json/commands.json
+++ b/docs/json/commands.json
@@ -1810,8 +1810,8 @@
},
{
"name": "linkTuyaMCUOutputToChannel",
- "args": "[dpId][varType][channelID]",
- "descr": "Used to map between TuyaMCU dpIDs and our internal channels. Mapping works both ways. DpIDs are per-device, you can get them by sniffing UART communication. Vartypes can also be sniffed from Tuya. VarTypes can be following: 0-raw, 1-bool, 2-value, 3-string, 4-enum, 5-bitmap. Please see [Tuya Docs](https://developer.tuya.com/en/docs/iot/tuya-cloud-universal-serial-port-access-protocol?id=K9hhi0xxtn9cb) for info about TuyaMCU. You can also see our [TuyaMCU Analyzer Tool](https://www.elektroda.com/rtvforum/viewtopic.php?p=20528459#20528459)",
+ "args": "[dpId][varType][channelID][bDPCache-Optional]",
+ "descr": "Used to map between TuyaMCU dpIDs and our internal channels. Last argument is optional and 0 by default. You can set it to 1 for battery powered devices, so a variable is set with DPCache, for example a sampling interval for humidity/temperature sensor. Mapping works both ways. DpIDs are per-device, you can get them by sniffing UART communication. Vartypes can also be sniffed from Tuya. VarTypes can be following: 0-raw, 1-bool, 2-value, 3-string, 4-enum, 5-bitmap. Please see [Tuya Docs](https://developer.tuya.com/en/docs/iot/tuya-cloud-universal-serial-port-access-protocol?id=K9hhi0xxtn9cb) for info about TuyaMCU. You can also see our [TuyaMCU Analyzer Tool](https://www.elektroda.com/rtvforum/viewtopic.php?p=20528459#20528459)",
"fn": "TuyaMCU_LinkTuyaMCUOutputToChannel",
"file": "driver/drv_tuyaMCU.c",
"requires": "",
diff --git a/src/driver/drv_tuyaMCU.c b/src/driver/drv_tuyaMCU.c
index 45cc8c487..97c3a4bb5 100644
--- a/src/driver/drv_tuyaMCU.c
+++ b/src/driver/drv_tuyaMCU.c
@@ -1699,8 +1699,8 @@ void TuyaMCU_Init()
//cmddetail:"examples":""}
CMD_RegisterCommand("tuyaMcu_sendCurTime", TuyaMCU_Send_SetTime_Current, NULL);
///CMD_RegisterCommand("tuyaMcu_sendSimple","",TuyaMCU_Send_Simple, "Appends a 0x55 0xAA header to a data, append a checksum at end and send");
- //cmddetail:{"name":"linkTuyaMCUOutputToChannel","args":"[dpId][varType][channelID]",
- //cmddetail:"descr":"Used to map between TuyaMCU dpIDs and our internal channels. Mapping works both ways. DpIDs are per-device, you can get them by sniffing UART communication. Vartypes can also be sniffed from Tuya. VarTypes can be following: 0-raw, 1-bool, 2-value, 3-string, 4-enum, 5-bitmap. Please see [Tuya Docs](https://developer.tuya.com/en/docs/iot/tuya-cloud-universal-serial-port-access-protocol?id=K9hhi0xxtn9cb) for info about TuyaMCU. You can also see our [TuyaMCU Analyzer Tool](https://www.elektroda.com/rtvforum/viewtopic.php?p=20528459#20528459)",
+ //cmddetail:{"name":"linkTuyaMCUOutputToChannel","args":"[dpId][varType][channelID][bDPCache-Optional]",
+ //cmddetail:"descr":"Used to map between TuyaMCU dpIDs and our internal channels. Last argument is optional and 0 by default. You can set it to 1 for battery powered devices, so a variable is set with DPCache, for example a sampling interval for humidity/temperature sensor. Mapping works both ways. DpIDs are per-device, you can get them by sniffing UART communication. Vartypes can also be sniffed from Tuya. VarTypes can be following: 0-raw, 1-bool, 2-value, 3-string, 4-enum, 5-bitmap. Please see [Tuya Docs](https://developer.tuya.com/en/docs/iot/tuya-cloud-universal-serial-port-access-protocol?id=K9hhi0xxtn9cb) for info about TuyaMCU. You can also see our [TuyaMCU Analyzer Tool](https://www.elektroda.com/rtvforum/viewtopic.php?p=20528459#20528459)",
//cmddetail:"fn":"TuyaMCU_LinkTuyaMCUOutputToChannel","file":"driver/drv_tuyaMCU.c","requires":"",
//cmddetail:"examples":""}
CMD_RegisterCommand("linkTuyaMCUOutputToChannel", TuyaMCU_LinkTuyaMCUOutputToChannel, NULL);