logo elektroda
logo elektroda
X
logo elektroda

NAS-AB02W6 Ver 2.0 Tuya Siren+Temp+Humidity Sensor: Control LEDs with OpenBK Firmware

rylos78 4074 34
ADVERTISEMENT
  • #31 21135700
    divadiow
    Level 35  
    feel free to upload factory-state unpaired full firmware dump or tuya config file

    OpenBK_BK7231N_CB2S_USB_PLUG software control panel on a webpage.
  • ADVERTISEMENT
  • #32 21278896
    cristian4
    Level 2  
    Is there any way for this doorbell to sound differently based on the events created in Home Assistant? For example, to play melody 12 when someone rings the doorbell and melody 9 when there's an alarm event?
  • ADVERTISEMENT
  • #33 21292842
    cristian4
    Level 2  
    >>20383126
    Does it always work for you and remember channels 4 and 5? For me, it doesn’t work all the time; sometimes, when I restart it, it resets to the factory sound. Do I need to use batteries somehow? In my autoexec.bat, I have these two commands:
    addEventHandler TuyaMCUParsed 0x02 addRepeatingEvent 3 2 setChannel 4 12
    addEventHandler TuyaMCUParsed 0x02 addRepeatingEvent 5 2 setChannel 5 2
  • ADVERTISEMENT
  • #34 21298720
    cristian4
    Level 2  
    jobstjn wrote:
    Hi sir,

    1st it's the startup bug:
    there's a ~50% chance this config gets applied upon boot (so several tries are needed):
    addEventHandler TuyaMCUParsed 0x02 addRepeatingEvent 2.5 1 setChannel 4 7
    addEventHandler TuyaMCUParsed 0x02 addRepeatingEvent 3 1 setChannel 6 30
    (I think it's something similar for retain: true as a mqtt config strategy)

    2nd it's when the device disconnects from mqtt server (server down):
    gui will still report last config but device will act on default values (e.g. song 5, 10s). Regardless of when or if it reconnects.
    a regular hass automation config will stop working here, need to apply the hack above

    Additionally the minor issue of requiring delay between mqtt commands, perhaps network related?.

    I am unsure how would those ideas fix these issues.


    @p.kaczmarek2 Can you still help us with this device? We haven’t found a solution for it to keep the set melody.
  • #35 21600251
    hinneLinks
    Level 1  
    Thanks for this thread, it helped me to got mine to work.
    I've run into the same Issues as @cristian4, wanting to change the ringtone from Home Assistant.
    Since I already had Esphome setup for other devices i tried that, and with that it works.

    My Device, a "NAS-AB02W6 V4" seems to only have the Ringing, the Ringtone Selection, the duration and the Battery Status (the volume datapoint 116 seems to be missing from mine):


    
    # from the Debug-Log of NAS-AB02W6 V4
    # [11:38:22][C][tuya:041]: Tuya:
    # [11:38:22][C][tuya:062]:   Datapoint 101: enum (value: 4)
    # [11:38:22][C][tuya:062]:   Datapoint 102: enum (value: 0)
    # [11:38:22][C][tuya:058]:   Datapoint 103: int value (value: 1)
    # [11:38:22][C][tuya:056]:   Datapoint 104: switch (value: OFF)
    # [11:38:22][C][tuya:074]:   Product: '{"p":"jsm1tlzrta3s7zja","v":"1.0.5","m":2}'
    


    I have those sirens connected via USB, so I didn't bother with the battery.
    Here is the Configuration for the other three, now the Duration and the Ringtone can be set from Home Assistant:

    
    [other stuff like 
    esphome:
    wifi:
    web_server:
        etc. omitted]
    
    
    
    bk72xx:
      board: generic-bk7231n-qfn32-tuya
    
    # tuya needs uart, pins see https://esphome.io/components/libretiny.html
    uart:
      rx_pin: GPIO10
      tx_pin: GPIO11
      baud_rate: 9600
    
    # Register the Tuya MCU connection
    tuya:
    
    
    number:
        # Duration - datapoint 103
      - platform: "tuya"
        name: "Duration (s)"
        icon: "mdi:clock-outline"
        number_datapoint: 103
        min_value: 0
        max_value: 120
        step: 1
    
    # Bell on / off - datapoint 104
    switch:
      - platform: "tuya"
        name: "Bell on / off"
        switch_datapoint: 104
    
        
    select:
        # Ringetone - datapoint 102
      - platform: "tuya"
        name: "Ringtone"
        enum_datapoint: 102
        optimistic: true
        options:
          0: doorbell
          1: fur elise
          2: big ben
          3: ring ring
          4: lone ranger
          5: turkish march
          6: high pitched
          7: red alert
          8: crickets
          9: beep
          10: dog bark
          11: police siren
          12: grandfather clock
          13: phone ring
          14: fire truck
          15: clock chime
          16: alarm clock
          17: school bell
    

Topic summary

The discussion focuses on programming and configuring the NEO Coolcam NAS-AB02W6 Tuya Siren with integrated temperature and humidity sensors, based on the BK7231N chip and using TuyaMCU protocol, flashed with OpenBK firmware. Key challenges include controlling the siren's LEDs, which flash continuously after boot with OpenBK, unlike the original firmware where LEDs flash only during alarm. Users mapped TuyaMCU dpIds for alarm duration (dpid 103), toggle alarm (dpid 104), temperature (dpid 105), humidity (dpid 106), and chime sound selection (dpid 102). Persistent setting of chime sound required using enum mapping and event handlers (e.g., addEventHandler TuyaMCUParsed 0x02) in autoexec.bat to apply values after reboot. The device supports power source detection (dpid 101) and battery backup. MQTT integration with Home Assistant was demonstrated, including configuration for switches and sensors with state retention challenges addressed by channel memory features and MQTT retain flags. Users reported issues with default values resetting on MQTT disconnect and timing sensitivity of event handlers. Flashing instructions include connecting TXD/RXD pins and using OpenBekenFlasher, with no additional pin configuration needed due to direct serial communication between Beken chip and Tuya MCU. Deep sleep and power-saving modes are under development. The community shared photos of device internals and packaging for documentation. Similar devices based on BK7231N and BL602 chips were mentioned, with suggestions to attempt flashing and packet capture for unsupported models. Overall, the device is now fully supported with OpenBK firmware, enabling advanced customization of siren behavior and sensor reporting via MQTT and Home Assistant.
Summary generated by the language model.
ADVERTISEMENT