Ola, I share the software modification for a bidirectional solar photovoltaic. TuyaMCU
buy on aliexpress


Link
The module uses a CB2S chip
Flashing is simple VCC GND TX RX I did not need to remove the module.
Here is the autoexec
startDriver TuyaMCU
tuyaMcu_setBaudRate
//tuyaMcu_defWiFiState 4
setChannelType 1 ReadOnly
linkTuyaMCUOutputToChannel 1 val 1
setChannelType 2 ReadOnly
linkTuyaMCUOutputToChannel 2 val 2
setChannelType 3 ReadOnly
linkTuyaMCUOutputToChannel 101 val 3
setChannelType 4 ReadOnly
linkTuyaMCUOutputToChannel 102 val 4
setChannelType 6 ReadOnly
linkTuyaMCUOutputToChannel 6 val 6
Values 1 and 2 are the total counters of each direction.
Direction 1 consumption
Direction 2 production (reinjection)
The 101 (val 3) gives the power in W The 102 (val 4) Gives the direction of the current 0 consumption 1 reinjection (or the opposite it will depend on the direction of your clamp)
I still added the value 6 theoretically it is a value in hexadecimal but I cannot use it with OPK