logo elektroda
logo elektroda
X
logo elektroda

Configuring Maxcio WF-CS01 Wifi Shutter Controller with FHEM Server and Openbeken

mcferryn 2472 16
ADVERTISEMENT
  • I recently bought a WiFi Shutter Controller from Maxcio and didn't want to use their app since I have a FHEM Server.
    https://www.amazon.de/dp/B0C3M5CQKS/ref=twister_B0C3M3XNMZ?_encoding=UTF8&th=1

    There are Tasmota Infos on the internet but they are outdated. The current version sold supports percentage setting and works just great.
    I am new here so sorry if I miss something or post it in the wrong area.

    Circuit board with CB3S WiFi module and switch.

    So I flashed the latest version of openbeken on this CB3S Module,
    Pin 8 is VCC, Pin 9 is GND, Pin 15 is RX, and Pin 16 is TX.

    I had to unsolder Pin 15 and 16 since they are already connected to a TuyaMCU (Py32).

    After normal flashing with BK7231N, I resoldered it and started configuring.

    I used the following for the autoexec.bat:
    
    startDriver TuyaMCU
    tuyaMcu_defWiFiState 4
    
    setChannelType 1 LowMidHigh
    linkTuyaMCUOutputToChannel 1 4 1
    setChannelType 2 TextField
    linkTuyaMCUOutputToChannel 2 2 2
    setChannelType 3 TextField
    linkTuyaMCUOutputToChannel 3 4 3
    setChannelType 4 toggle
    linkTuyaMCUOutputToChannel 7 1 4
    setChannelType 5 toggle
    linkTuyaMCUOutputToChannel 101 1 5


    Channel 1: 0 = up, 1 = stop, 2 = down
    Channel 2: Gives the position in %, also you can set the position
    Channel 3: It's normally set to 1. If you set it to 0 and back to 1, the switch starts calibration. It drives once up and once down, then you can select positions in channel 2 in percentage. Very handy for Alexa.
    Channel 7: It's for switching the button light on and off
    Channel 101: I have no clue what it does, it switches to 0 when shutters are moving and after a second or two, it goes to 1 again once the unit is idle.

    I have to admit the Web interface in Openbeken is not as nice as it could be, but I am not experienced with the software and don't use it anyway. I just need it to interact via MQTT with my server.

    It seems that the PY32 Chip is doing everything and the WiFi module is just in place to command the PY32 via WiFi.
    So in theory, someone could exchange it with some esp8266 type module.

    Cool? Ranking DIY
    About Author
    mcferryn
    Level 3  
    Offline 
    mcferryn wrote 9 posts with rating 2, helped 1 times. Been with us since 2023 year.
  • ADVERTISEMENT
  • #2 20758162
    p.kaczmarek2
    Moderator Smart Home
    Thanks for the config. I haven't seen a TuyaMCU shutters controller here yet. Regarding the interface, you can always do your own HTML page and host it in LittleFS, that way you can fully customize the looks, if that's needed.
    Helpful post? Buy me a coffee.
  • #3 20759021
    mcferryn
    Level 3  

    Thanks for me, my FHEM Server does the trick, but I am sure that someone with more experience in OpenBeken, which is an amazing software, can even make it look good. I just started a few days ago with OpenBeken and I am amazed how easy it was to use. And I am sure that sooner or later with many more shutter and blind switches getting Tuya, there will be some automation. I am not a software specialist but only an electronics engineer. :-)
  • ADVERTISEMENT
  • #4 20760444
    p.kaczmarek2
    Moderator Smart Home
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #5 20763740
    mcferryn
    Level 3  

    That's great, thank you very much. I have finally installed all 11 of them at my home now and they work nicely.
    I command it via MQTT by sending the percentage I want. And it's reporting the percentage back.

    I have a question, can I tell openbeken not to send via MQTT every single percentage number during driving.
    It puts a bit of a strain on my little Pi Zero server to receive so many messages from all the shutters at the same time.

    By the way, I found out that these lines are the connection between Pins 15 and 16 and the PY32, so instead of desoldering the chip and resoldering it, it's much easier to cut these lines and resolder them afterwards.
    Electronic module with labeled pins 15 and 16 and soldered wires.
  • ADVERTISEMENT
  • #6 20763759
    p.kaczmarek2
    Moderator Smart Home
    We don't have this feature yet, but it's a very good idea! Let me add that for you. Would something like:
    
    SetChannelPrivate [CH] [1or0]
    

    suit your needs?
    Helpful post? Buy me a coffee.
  • #7 20766664
    mcferryn
    Level 3  
    Thank you, I will have to Test it. I am at the moment just happy that I manage percentage Control of all my Shutters with an affordable System which is under my full control.
  • #8 20766768
    p.kaczmarek2
    Moderator Smart Home
    The following command should be available in the latest build.
    Helpful post? Buy me a coffee.
  • #9 20841599
    nguyenduykhanh88
    Level 1  
    >>20763740
    Amazing, can you share your config, or pinouts you used. Thanks so much
  • #10 20841608
    p.kaczmarek2
    Moderator Smart Home
    @nguyenduykhanh88 hey, isn't his autoexec.bat in the first post?

    Here is how to create autoexec.bat:


    Helpful post? Buy me a coffee.
  • #11 20841697
    mcferryn
    Level 3  
    I put the Text from my initial posting into the autoexec.bat via the Web Interface which was very nice to use.
    I am not sure what kind of Information you Need but I am willing to help.
    Did you manage the Flash already?

    P.S. I have 11 of them working in my house since then without a problem.
    And I found out that in the manufacture manual you get a key combination for calibration which makes the Installation Even easier. So now my Fhem Server is just sending pct values via mqtt and I Even linked my fhem to my Echo dots.
  • #12 20842613
    p.kaczmarek2
    Moderator Smart Home
    I don't know how Fhem setup with OBK may look like, @mcferryn , it sounds interesting. Please consider posting some more information in a form of tutorial here: https://www.elektroda.com/rtvforum/forum517.html I would love to hear more about your setup!
    Helpful post? Buy me a coffee.
  • #13 20844104
    mcferryn
    Level 3  
    I am not good enough in FHEM to write a tutoríal.
    FHEM is a Home Automation server with runs in my case on a raspberry zero.
    Its an old and cloudless system which was invented by a german guy and which is still fully supported and gets new features all the time.
    There is a big german community and of course english documentation is available as well.

    FHEM has a MQTT support with autodiscovery and everything so as soon as i have set up my OpenBeken device and its connects to the MQTT I get the device into my FHEM server and can set up how it should be shown. Tasmota support was impelented first into FHEM and since Openbeken is the new and improved version it works without any problems.

    As an example this is the raw data of one of my shutter devices:


    defmod MQTT2_Shutter_0 MQTT2_DEVICE Shutter_0
    attr MQTT2_Shutter_0 userattr GanzesHaus GanzesHaus_map structexclude
    attr MQTT2_Shutter_0 alexaName Arbeitszimmerrollo
    attr MQTT2_Shutter_0 alias Arbeitszimmerrollo
    attr MQTT2_Shutter_0 autocreate 0
    attr MQTT2_Shutter_0 devStateIcon 100:fts_shutter_10@green:Zu 50:fts_shutter_50@green:Zu 20:fts_shutter_80@green:Zu  0:fts_shutter_100@black:Auf\
    35:fts_shutter_70@green:Zu\
    
    attr MQTT2_Shutter_0 genericDeviceType blind
    attr MQTT2_Shutter_0 group Rollos
    attr MQTT2_Shutter_0 homebridgeMapping TargetPosition=pct
    attr MQTT2_Shutter_0 readingList Shutter_0:Shutter_0/connected:.* connected\
    Shutter_0:Shutter_0/host:.* host\
    Shutter_0:Shutter_0/build:.* build\
    Shutter_0:Shutter_0/mac:.* mac\
    Shutter_0:Shutter_0/ssid:.* ssid\
    Shutter_0:Shutter_0/sockets:.* sockets\
    Shutter_0:Shutter_0/rssi:.* rssi\
    Shutter_0:Shutter_0/uptime:.* uptime\
    Shutter_0:Shutter_0/freeheap:.* freeheap\
    Shutter_0:Shutter_0/ip:.* ip\
    Shutter_0:Shutter_0/1/get:.* Shutter_0_1_get\
    Shutter_0:Shutter_0/2/get:.* pct\
    Shutter_0:Shutter_0/3/get:.* Shutter_0_3_get\
    Shutter_0:Shutter_0/4/get:.* Shutter_0_4_get\
    Shutter_0:Shutter_0/5/get:.* Shutter_0_5_get
    attr MQTT2_Shutter_0 room Rollos,Start
    attr MQTT2_Shutter_0 setList Auf Shutter_0/2/set 100\
    50 Shutter_0/2/set 50\
    35 Shutter_0/2/set 35\
    Zu Shutter_0/2/set 0\
    pct Shutter_0/2/set
    attr MQTT2_Shutter_0 stateFormat pct
    attr MQTT2_Shutter_0 webCmd Zu:35:50:Auf



    This might look complicated at first but more then half of it is autocreated by the server itself.
  • #14 20849570
    mcferryn
    Level 3  
    Hi
    I had finally time to test your suggestion but i am pretty sure i made some syntax errors.

    I tried following line in the command prompt:

    if[channel[5]=1]['then'][SetChannelPrivate [2] [1]]['else'][SetChannelPrivate [2] [0]]

    I would like to not send channel 2 data if channel 5 is 1
  • #15 20879057
    mcferryn
    Level 3  
    >>20841608

    I am really happy about the command you created. It took me a bit to learn up how to use it and i failed at first since i did not understand that i had to update to get the new command implemented.

    But now i have manage to get the shutter only to send position after driving to a commanded position, which really takes a load off the MQTT Server when all my 11 shutters drive the same time.

    So the new autoexec.bat looks like this:

    startDriver TuyaMCU
    tuyaMcu_defWiFiState 4
    
    setChannelType 1 LowMidHigh
    linkTuyaMCUOutputToChannel 1 4 1
    
    setChannelType 2 Dimmer
    linkTuyaMCUOutputToChannel 2 2 2
    
    setChannelType 3 TextField
    linkTuyaMCUOutputToChannel 3 4 3
    
    setChannelType 4 toggle
    linkTuyaMCUOutputToChannel 7 1 4
    
    setChannelType 5 toggle
    linkTuyaMCUOutputToChannel 101 1 5
    
    addChangeHandler Channel5 == 0 setChannelPrivate 2 1
    
    addChangeHandler Channel5 == 1 setChannelPrivate 2 0 
    addChangeHandler Channel5 == 1 publishChannels
  • #16 20879292
    p.kaczmarek2
    Moderator Smart Home
    Nice, btw you can optimize your script by using backlog to put multiple commands together:
    
    addChangeHandler Channel5 == 1 backlog setChannelPrivate 2 0; publishChannels
    
    Helpful post? Buy me a coffee.
  • #17 20879749
    mcferryn
    Level 3  
    You are right of course, I implemented your line of code to make it cleaner.

    Thank you for your help, i am using at the moment about 50 smarthome devices with Tasmota, Openbeken and even some with my own code on 8266, but at the moment the openbeken software is my favourite.

Topic summary

The discussion revolves around configuring the Maxcio WF-CS01 WiFi Shutter Controller with a FHEM server using OpenBeken firmware. The user successfully flashed the latest OpenBeken version onto the CB3S module and shared their configuration settings, including the autoexec.bat file. They sought advice on optimizing MQTT message handling to reduce server load during simultaneous operations of multiple shutters. Community members provided insights on customizing the interface, managing MQTT traffic, and improving the configuration script. The user reported successful integration of 11 shutter controllers, utilizing MQTT for percentage control and linking with Amazon Echo devices.
Summary generated by the language model.
ADVERTISEMENT