So it's a different model? Or how do you configure it? Do you set Toggle and map dpID in the autoexec.bat?
Helpful post? Buy me a coffee.
Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamlubopetrov wrote:Here is my device id: bfe887d3d3b94ffed6snhu
lubopetrov wrote:the toggle is not functional.
{
"id": 16,
"mode": "rw",
"name": "断路器开关 (Breaker Switch)",
"desc": "",
"desc_en": "",
"property": { "type": "bool" }
},
// Start TuyaMCU driver
startDriver TuyaMCU
// set TuyaMCU baud rate
//tuyaMcu_setBaudRate 115200
// set TuyaMCU default wifi state 0x04, which means "paired",
// because some TuyaMCU MCUs will not report all data
// unless they think they are connected to cloud
tuyaMcu_defWiFiState 4
setChannelType 1 ReadOnly
setChannelType 2 toggle
// linkTuyaMCUOutputToChannel dpId verType tgChannel
linkTuyaMCUOutputToChannel 16 bool 2
// set voltage, current ,power channel types
setChannelType 3 Voltage_div10
setChannelType 4 Current_div1000
setChannelType 5 Power
// map dpID 6, which is VCP format, to first voltage, then current, then power (3, 4, 5)
linkTuyaMCUOutputToChannel 6 RAW_V2C3P3 3
// map dpID 1, which is energy, to channel 1
linkTuyaMCUOutputToChannel 1 val 1
lubopetrov wrote:Even when I press the physical button on the device the UI button "Toggle" switches colors red/green.
[
{
"id": 109,
"type": 3,
"data": "AAAA"
},
{
"id": 106,
"type": 3,
"data": "EwAAAAAAAAAAAA=="
},
{
"id": 105,
"type": 2,
"data": 0
},
{
"id": 12,
"type": 1,
"data": 0
},
{
"id": 13,
"type": 2,
"data": 0
},
{
"id": 11,
"type": 1,
"data": 0
},
{
"id": 9,
"type": 5,
"data": "00"
},
{
"id": 111,
"type": 4,
"data": 1
},
{
"id": 104,
"type": 1,
"data": 1
},
{
"id": 102,
"type": 2,
"data": 5
},
{
"id": 107,
"type": 2,
"data": 10
},
{
"id": 18,
"type": 0,
"data": "01010276"
},
{
"id": 1,
"type": 2,
"data": 25
},
{
"id": 6,
"type": 206,
"data": "092C00018A00005E"
},
{
"id": 16,
"type": 1,
"data": 1
}
]
addRepeatingEvent 10 -1 tuyaMcu_sendQueryState
p.kaczmarek2 wrote:
2. You can specify offset while mapping dpIDs.
https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commands.md
![]()
Use 0 for dpCache, 1 for mult, 0 for bInverse, then specify deltas.
linkTuyaMCUOutputToChannel 6 RAW_V2C3P3 3
setChannelType 3 Voltage_div10
setChannelType 4 Current_div1000
setChannelType 5 Power
linkTuyaMCUOutputToChannel 6 RAW_V2C3P3 3
linkTuyaMCUOutputToChannel 6 RAW_V2C3P3 3 0 1 0
linkTuyaMCUOutputToChannel 6 RAW_V2C3P3 3 0 1 0 50 100 150
linkTuyaMCUOutputToChannel 6 RAW_V2C3P3 3 0 1 0 50
// Start TuyaMCU driver
startDriver TuyaMCU
// set TuyaMCU baud rate
//tuyaMcu_setBaudRate 115200
// set TuyaMCU default wifi state 0x04, which means "paired",
// because some TuyaMCU MCUs will not report all data
// unless they think they are connected to cloud
tuyaMcu_defWiFiState 4
setChannelType 1 EnergyTotal_kWh_div100
setChannelType 2 toggle
// linkTuyaMCUOutputToChannel dpId verType tgChannel
linkTuyaMCUOutputToChannel 16 bool 2
// set voltage, current ,power channel types
setChannelType 3 Voltage_div10
setChannelType 4 Current_div1000
setChannelType 5 Power
// map dpID 6, which is VCP format, to first voltage, then current, then power (3, 4, 5)
linkTuyaMCUOutputToChannel 6 RAW_V2C3P3 3 0 1 0 50
// map dpID 1, which is energy, to channel 1
linkTuyaMCUOutputToChannel 1 val 1