p.kaczmarek2 wrote:Here is the basic draft of what has to be done:
1. Cut the RX and TX tracks (between TuyaMCU and CB2S)
2. Read the flash memory of CB2S (to be sure, do it several times) and send flash bin to tuya-cloudcutter guys so futher devices can be programmed remotely
3. Flash OpenBK
4. Connect tracks again
5. Try the dpIDs from Tasmota page.
See this: https://github.com/openshwprojects/OpenBK7231T_App/pull/75 for reference
OpenBK script:// start MCU driver startDriver TuyaMCU // let's say that channel 1 is dpid1 - fan on/off setChannelType 1 toggle // map dpid1 to channel1, var type 1 (boolean) linkTuyaMCUOutputToChannel 1 1 1
Check if it works, you can also do the same for light:// let's say that channel 2 is dpid9 - light on/off setChannelType 2 toggle // map dpid2 to channel2, var type 1 (boolean) linkTuyaMCUOutputToChannel 2 1 2
Check if it works.
![[BK7231T] My HTTP server, configurator, MQTT support from Home Assistant [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant](https://obrazki.elektroda.pl/5105262500_1652972991_thumb.jpg)
![[BK7231T] My HTTP server, configurator, MQTT support from Home Assistant [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant](https://obrazki.elektroda.pl/9104446900_1652972991_thumb.jpg)
It works. Got two relays toggling on/off. Click Click! Wahoo!!! Now I'll have to find a fan and light to connect to for further testing.
p.kaczmarek2 wrote:I see they have several dpIDs:Quote:dpid1 - fan on/off
dpid3 - fan speed (0 = low, 1 = med, 2 = hi)
dpid6 - self timer (0 = off, 1 = 1hr, 2 = 2hr, 4 = 4hr, 8 = 8hr)
dpid9 - light on/off
dpid7 - timer remaining
dpid17 - ???
dpid9 - light on/off is confirmed
setChannelType 2 toggle
linkTuyaMCUOutputToChannel 9 1 2
Added after 4 [hours] 9 [minutes]:
@p.kaczmarek2
Did I do this fan speed correctly? I really need to hook this thing up to my ceiling fan for testing, but I'm only one person, and I'm afraid I'd need 2 people to do it! I have a 3-speed portable fan in the back room I will try to hook it up to that for now.
I added to my script:
//channel 3 is dpid3 - fan speed
setChannelType 3 LowMidHigh
// map dpid3 to channel3, var type 4 (enum)
linkTuyaMCUOutputToChannel 3 4 3
And now I have fan speed control in the UI
![[BK7231T] My HTTP server, configurator, MQTT support from Home Assistant [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant](https://obrazki.elektroda.pl/4345356400_1652988108_thumb.jpg)