logo elektroda
logo elektroda
X
logo elektroda

Avatto DMS16-W1 CBU Dimmer + Puya PY32F002A MCU: OpenBeken Flashing and Autoexec Setup

divadiow 2898 61
ADVERTISEMENT
📢 Listen (AI):
  • #61 21711887
    sp4rk1e
    Level 9  
    great. I didn't realize that 'OnRelease' is *not* sent for other button presses (OnClick etc.) than 'OnHold'. That's why I made the conditionals.

    Testet now the firmware support with a super simple script (but same functionality) - works 👍‍

    // device: Moyes MS-105
    //
    // features:
    // short press: switches on/off
    // long press if device is on: dim either up or down
    // long press if device is off: turn on at brightness zero, continue from there with dim up
    // if brightness reaches the upper or lower bound: reverse dim direction (ping pong)
    // after long press: reverse dim direction

    
    startDriver TuyaMCU
    tuyaMcu_defWiFiState 4
    PowerSave 1
    SetFlag 10 0                // Flag 10 - [MQTT] Broadcast self state on MQTT connect DONT CLUTTER LOG
    SetButtonTimes 2 3 2        // provides fast response and low lag, works with bDPCache==2 only (see below)
                                // must use Version: noread_e8ef72c891b1 for that
    SetChannel 14 4             // define dim stepsize
    
    // P6 connected to the push button
    SetPinChannel 6 10
    SetPinRole 6 Btn
    
    alias turn_on_at_zero backlog SetChannel 1 1; SetChannel 2 1
    
    setChannelType 1 toggle
    linkTuyaMCUOutputToChannel 1 bool 1
    
    setChannelType 2 dimmer
    tuyaMcu_setDimmerRange 0 1000
    linkTuyaMCUOutputToChannel 2 val 2 2    // new "bDPCache" "flags" arg: 2 means "do not read"
    
    addEventHandler OnClick    6 toggleChannel 1
    addEventHandler OnHold     6 if $CH1==0 then turn_on_at_zero else "addChannel 2 $CH14 0 100 2" 
    addEventHandler OnRelease  6 addChannel 2 $CH14 0 100 3  // new flag 3
    
    
  • ADVERTISEMENT
  • #62 21711892
    p.kaczmarek2
    Moderator Smart Home
    It should work, however.... I think it's actually sent for other events than hold, it's just it does not break anything in this approach.
    Helpful post? Buy me a coffee.
📢 Listen (AI):

Topic summary

The discussion focuses on the Avatto DMS16-W1 1-channel dimmer smart switch featuring a CBU module communicating with a Puya PY32F002A MCU (TSSOP-20). Users explore flashing the device with OpenBeken firmware, identifying and mapping Tuya dpIDs for channel control, and configuring autoexec.bat scripts for proper operation. Key findings include dpID assignments for power on/off, brightness control, brightness range, switch type, power-on status, and timer functions, with variations noted in similar models like the Avatto DMS16-Y1 and 2-channel versions. Contributors share firmware dumps, flashing experiences, and configuration examples, including setting dimmer ranges, linking TuyaMCU outputs to channels, and enabling HTTP button drivers. The conversation also references tools and resources for sniffing dpIDs, restoring original firmware, and improving UI via REST pages. Overall, the thread provides practical insights into customizing and controlling Avatto dimmer switches using OpenBeken firmware and Puya MCU integration.
Summary generated by the language model.
ADVERTISEMENT