logo elektroda
logo elektroda
X
logo elektroda

Tuya IR Blaster S06 - CB3S to ESP-12F Conversion & Tasmota

jkwim 6501 14
ADVERTISEMENT
  • Updated: 2023/12/27
    The IR Codes captured on Tasmota with new compact encoding scheme can be played back as it is through IRSend. See the updates below



    Reference Links about S06 IR Blaster:
    Teardown, flashing and configuration for Smart Tuya IR Blaster S06 [CB3S]
    OpenBeken configuration for WiFi universal IR remotes from aliexpress (S06, S18, IRC02) with BK7231

    I have a requirement to be able to capture/send IR RAW data to make my Panasonic Fan working.

    Since IR RAW feature will take some time to appear in OpenBeken, I decided to go the hard way.

    I had a S06 with CB3S Module.

    When you inspect the CB3S Module alongside ESP-12F you could see a perfect match for critical PINs like Power, Chip Enable and Reset.

    ESP-12F and CB3S modules with S06 IR Blaster board.

    So I decided to replace the CB3S Module with ESP-12F Module.

    I first flashed tasmora_ir.bin image on to ESP-12F (There are plenty of tutorials available on flashing ESP-12F module on the internet).

    I did not do a very good job in de-soldering and soldering in the new module. It was the first time for me to use the heat gun and I accidentally blew off a tiny SMD resistor and a capacitor in the process. Hopefully I can do a better job next time :-)

    Circuit board with ESP-12F module and component labels.

    I blew up R3 & C5 [4] during the process. These are connected to RESET button on the device. For the moment the RESET button is trivial for me as I can always power cycle the device externally. Perhaps I will make some corrections later to the hardware.

    Close-up of a circuit board with a highlighted section showing electronic components.

    Needed to solder 10k pullup/pulldown resistors as shown for Chip Enable [1] and GPIO15 [2] as shown.

    One more issue remains. I could not get the LED8 [3] to light up. When I touch the R13 with a tweezer the LED gets lit up faintly. The output on GPIO4 where the LED is connected to toggles between 0V and 3.2V ish value correctly. Need to see whether R13 needs to be changed. Again this is a trivial matter for me at the moment.

    Tasmota Setup:

    Screenshot showing template parameters settings for S06 IR controller in Tasmota.

    Enabled Option58 for receiving RAW data.

    21:32:50.903 CMD: SetOption58 1
    21:32:50.906 RSL: RESULT = {"SetOption58":"ON"}
    
    21:32:56.983 RSL: RESULT = {"IrReceived":{"Protocol":"UNKNOWN","Bits":78,"Hash":"0x94972B6F","Repeat":0,"RawData":"+3525a+830-2700Bc+825-935DcBcDcBeDeBeDeDeB-2695BeDeDcBeDeDeDcDc+845-2675DfBcDeD-39350+3565-3485DfBcDeDcDc+850hDeL-910D-940DeDeDcBeDeDcDeDeDeBfDcDcDfDcDeDiA-3520DcDcDeDcL-2670+855pLmDnLmDeDnDcQmLmLpDnDeDeLpDcLpQpLpLmD","RawDataInfo":[155,155,0]}}
    


    Update:
    The following conversion is not required. We can directly play back the above raw data string received

    -------------------------------------------------------------------------------
    The RAW data received can be converted in to a string which can be transmitted using IRSend command using the following tool:

    https://tasmota.hadinger.fr/util

    Screenshot of Tasmota Code Tools with raw IR data.
    -------------------------------------------------------------------------------

    Data received in following RAW Date message can be played back:
    21:32:56.983 RSL: RESULT = {"IrReceived":{"Protocol":"UNKNOWN","Bits":78,"Hash":"0x94972B6F","Repeat":0,"RawData":"+3525a+830-2700Bc+825-935DcBcDcBeDeBeDeDeB-2695BeDeDcBeDeDeDcDc+845-2675DfBcDeD-39350+3565-3485DfBcDeDcDc+850hDeL-910D-940DeDeDcBeDeDcDeDeDeBfDcDcDfDcDeDiA-3520DcDcDeDcL-2670+855pLmDnLmDeDnDcQmLmLpDnDeDeLpDcLpQpLpLmD","RawDataInfo":[155,155,0]}}


    IRSend 0, +3525a+830-2700Bc+825-935DcBcDcBeDeBeDeDeB-2695BeDeDcBeDeDeDcDc+845-2675DfBcDeD-39350+3565-3485DfBcDeDcDc+850hDeL-910D-940DeDeDcBeDeDcDeDeDeBfDcDcDfDcDeDiA-3520DcDcDeDcL-2670+855pLmDnLmDeDnDcQmLmLpDnDeDeLpDcLpQpLpLmD


    I did a further optimization by deleting parts of the string from the end, working backwards until I find a +/- symbol. When you press the remote you might press it too longer than required. So the extra data stream can be removed like this on trial & error basis. This way you can figure out the minimum length of data string to play back. See the example of Tasmota rule for the final outcome.


    Defined 5 x Virtual Relays using unused GPIOs to be used as Buttons on WebGUI:

    Screenshot of Tasmota configuration for S06 IR controller


    User interface of S06 IR Controller in Tasmota

    Changed the labels on the buttons:
    02:36:18.449 CMD: WebButton1 PWR
    02:36:18.454 RSL: RESULT = {"WebButton1":"PWR"}
    02:36:29.105 CMD: WebButton2 SPD
    02:36:29.110 RSL: RESULT = {"WebButton2":"SPD"}
    02:36:39.275 CMD: WebButton3 OSC
    02:36:39.281 RSL: RESULT = {"WebButton3":"OSC"}
    02:36:53.438 CMD: WebButton4 RHY
    02:36:53.443 RSL: RESULT = {"WebButton4":"RHY"}
    02:37:03.340 CMD: WebButton5 TMR
    02:37:03.344 RSL: RESULT = {"WebButton5":"TMR"}
    


    Tasmota user interface with five control buttons.

    Created Tasmota Rules for button toggles (here is an example for PWR and SPEED buttons:

    Rule1
    ON POWER1#STATE DO IRSend 0,+3500-3550+875-2650+880dC-885CdCdC-2645EfC-890CfEfCfCdEfCfCdCfCfCfCdCdCdCgEdCfC
      ENDON
    ON POWER2#STATE DO IRSend 0,+3500-3550+855-2670CdC-910+850dFdCdCdFdCdCdCdFeC-905CeCdCeCeFeCeFeFeCgCeCdC ENDON
    


    Now the Fan can be controlled via Web URL or MQTT using POWER1, POWER2, POWER3, POWER4, POWER5 commands.

    Cool? Ranking DIY
    About Author
    jkwim
    Level 12  
    Offline 
    jkwim wrote 169 posts with rating 23, helped 4 times. Been with us since 2022 year.
  • ADVERTISEMENT
  • #2 20876623
    freebsd
    Level 42  
    jkwim wrote:
    my Panasonic fan
    Which fan? ceiling?
  • ADVERTISEMENT
  • #4 20877214
    ferbulous
    Level 18  
    Hi, did you make the stand fan smart by adding one of those ir fan controller board?
    As for the heat gun, you might need to cover the components around the cb3s with heat resistance tapes (kapton) to keep them in place.
  • #5 20877404
    jkwim
    Level 12  

    ferbulous wrote:
    Hi, did you make the stand fan smart by adding one of those IR fan controller boards?
    As for the heat gun, you might need to cover the components around the cb3s with heat resistance tapes (kapton) to keep them in place.


    The fan already had a remote controller with 5 buttons.

    Panasonic remote control for a fan with five buttons in a hand.

    I created 5 buttons on Tasmota GUI.

    [Well, I actually went further. I did a custom build of Tasmota with IR Raw driver only and then activated Philips Hue Bridge in Tasmota. Now I can integrate the 5 buttons as 5 devices to Alexa]

    Tasmota GUI with 5 buttons for fan control.

    A little awkward conversation with Alexa:
    "Alexa, turn on Fan Speed!" and I see the POWER2 ON command on Tasmota.
    Next, I need to implement a script to send the IR commands to the fan.

    OpenBK already supports Wemo but only for a single device. It would be very useful to have Wemo Multidevice support in OpenBK. Then we can emulate multiple devices using Belkin's Wemo protocol. And Alexa works with Wemo too.
  • ADVERTISEMENT
  • #7 20877567
    jkwim
    Level 12  
    ferbulous wrote:
    @jkwim try smartir (hacs)
    Add a new fan config with the raw ir codes for each speed
    Like this one for example

    https://github.com/smartHomeHub/SmartIR/blob/master/codes/fan/1170.json

    Oh wait, you’re using wemo integration probably need some script


    The only issue is that this fan has just one Speed control button on the remote. When you press the button, the speed jumps to the next setting in a round robin fashion. What this means is that without knowing the current speed setting, one cannot jump to a definite speed setting like 1, 2, 3.

    It always jumps from the current setting in the forward direction 1->2->3->1->2 and so on


    Added after 2 [hours] 45 [minutes]:

    Adding WS2812 LED Strip to the IR Blaster 06

    Well, this was my ultimate goal.

    I wanted to add a connector for a WS2812 Led Strip to the same PCB so that I can mount this neat device on the wall and have dual functionality.

    1. Soldered a JST Pigtail's power wires directly to the USB connector so that external 5V can be directly supplied to LED strip.

    PCB with connected JST connector and three wires.

    2. Soldered the Data wire to GPIO2

    Image of a PCB with a WiFi module and additional components.

    3. Prepared the casing with a small cutout for the wires

    Plastic casing with cutout for wires

    Plastic base of an electronic device housing on a blue background.

    PCB board with connected power wires and casing

    Black Wi-Fi enclosure with cables on a blue table background.


    Now I have a neat dual function IOT device.

    Configured GPIO2

    Screenshot of Sonoff Basic module parameters with WS2812 selected for D4 GPIO2.

    And now I have LED strip controls as well.

    12:56:00.452 CMD: webbutton6 LEDs
    12:56:00.457 RSL: RESULT = {"WebButton6":"LEDs"}


    IOT control panel with RGB sliders and six buttons.


    Once I connect this to the MQTT network, many things can be done. Even an animation via MQTT is possible.

    Even DDP is available as an option for custom compiling in Tasmota. That means the LED strip can be controlled via WLED running on a separate device.

    So the options are endless

    PS: You could even add a Temperature/Humidity sensor also. Making this device an all-in-one device.
  • #8 20877729
    freebsd
    Level 42  
    @jkwim Have you considered using a Tuya compatible universal fan controller? Maybe you could reprogram it and adapt it to your needs.
    WiFi controller with remote for BLDC fan.
  • ADVERTISEMENT
  • #9 20878341
    jkwim
    Level 12  

    freebsd wrote:
    @jkwim Have you considered using a Tuya compatible universal fan controller? Maybe you could reprogram it and adapt it to your needs.
    WiFi controller with remote for BLDC fan.


    The main reason that I did all this is that this particular remote requires longer codes which OpenBK does not support at the moment. I was told that adapting Tasmota's RAW codes is in the plan. So until such time, I took the shortcut. The added benefit was that I am able to use Philips Multi Device Hue Emulation and incorporate this into the existing Alexa config easily.

    OpenBK supports Wemo protocol for a single device, and I am currently using it for a different device.

    I would certainly look into the controller that you have mentioned to see whether it can control a 3x switch controlled old desk fan that we have. I don't know how reliably you can implement the 3x switch interlock mechanism found in old fans, i.e., only one of the speed switches can be left pressed at a time. When you use relays, you need to ensure that only one relay gets activated at a time and that there should be a delay between deactivation of the first relay and activation of the second relay to ensure power is fed only to one of the coils.
  • #10 20881134
    krzbor
    Level 27  
    If someone wants to build such a device "from scratch", I recommend my solution Link
  • #12 20897271
    slarti
    Level 1  
    freebsd wrote:
    @jkwim Have you considered using a Tuya compatible universal fan controller? Maybe you could reprogram it and adapt it to your needs.
    WiFi controller with remote for BLDC fan.


    @freebsd Do you have this controller? Have you tried prying it open and see which SoC it uses?
    This is the only WiFi controller I've seen for BLDC fans.
  • #13 20897980
    jkwim
    Level 12  
    ferbulous wrote:
    @krzbor So that one only has 1 LED
    How do you add more LED to cover wider angles? Do i need specific resistors?

    I tried diy following this instruction but transmitting just never worked for me

    https://community.home-assistant.io/t/tasmota-mqtt-irhvac-controler/162915


    If you are building from scratch, there is another option. For Wemos D1 Mini there is a stackable IR Shield available

    IR module for Wemos D1 Mini with labels IR1, IR2, IR3, and IR4.

    Blue PCB of IR shield module for Wemos D1 Mini with labels and pins.

    https://www.aliexpress.com/item/32891173618.html
  • #14 20908206
    ferbulous
    Level 18  
    @jkwim yes, i already have the d1 mini with the ir shield.
    Just curious how to add more ir transmitter properly on the esp01m board
  • #15 20909130
    jkwim
    Level 12  
    ferbulous wrote:
    @jkwim yes, i already have the d1 mini with the ir shield.
    Just curious how to add more ir transmitter properly on the esp01m board


    Above IR Shield board has 1 x transistor and 4 x resistors to drive 4 x LEDs.

    If you trace the paths probably it will be 4x Resistor+LED strings in parallel driven by the transistor.

    Something like this (apologize for my crude way of illustrating it):

    Circuit diagram with MOSFET transistor and LED diodes.

    If you replicate the above circuit on a PCB and connect it to a GPIO, then it should work.

Topic summary

The discussion revolves around the conversion of the Tuya IR Blaster S06 (CB3S) to an ESP-12F module and the integration of Tasmota firmware for enhanced IR control. The user aims to capture and send IR RAW data to operate a Panasonic fan, which has a remote with limited control options. The user successfully flashed a custom Tasmota build with IR Raw driver and integrated it with Philips Hue Bridge for Alexa compatibility. Various suggestions were made regarding the use of smart IR configurations, universal fan controllers, and the addition of WS2812 LED strips for dual functionality. Challenges include the fan's single speed control button, which cycles through settings, complicating direct speed selection. The conversation also touches on building from scratch using Wemos D1 Mini and IR shields for broader IR coverage.
Summary generated by the language model.
ADVERTISEMENT