Tuya WR3 Smart Siren

I’ve been able to flash the Tuya WR3 module using LibreTiny. I’ll post the .yaml to make the siren and leds work.

esphome:
  name: alarm
  friendly_name: alarm

rtl87xx:
  board: wr3

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

  

ota:
  password: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

wifi:
  ssid:xxx
  password: xxx

switch:
  - platform: restart
    name: "Alarm Restart"
  - platform: gpio
    pin: PA05
    name: "Lichtje"
    id: Lichtje
 
sensor:
    - platform: wifi_signal
      name: "Alarm-wifi"

output:
  - platform: libretiny_pwm
    pin: PA12
    frequency: 2600 Hz
    id: pwm_output


light:
  - platform: monochromatic
    output: pwm_output
    name: "Sirene"
    id: Sirene
button:
- platform: template
  name: "Alarm-buzzer"
  on_press:
  - script.execute: buzzer_five

script: 
- id: buzzer_five # Use the same buzzer name you have given above. 
  then:
    - repeat:
          count: 10
          then:
             - light.turn_on: Sirene
            - switch.turn_on: Lichtje
            - delay: 500ms                
            - light.turn_off: Sirene
            - switch.turn_off: Lichtje
            - delay: 1000ms
1 Like

Thnx for posting this, exactly what I was searching for👍

Do you have some more details how to flash the WR3 Smart Siren?

https://docs.libretiny.eu/boards/wr3/

There’s the information you need.

After a lot of attemps I’ve been able to flash the wr3 chip with esphome. It was difficult for me to place the chip in download mode. Anyway thanks a lot for your esphome config.

I’ve added one of the buttons (PairOnOff) to the esphome config:

binary_sensor:
  - platform: gpio
    name: PairOnOff
    pin:
      number: PA15
      inverted: true
      mode:
        input: true

I’m in the same boat :rofl:. Found the siren while looking for something else, thought it would be a 5 min job with a CP2102 but can’t get it into download mode.

And yes, this is also done.

  • connect CEN to GND
  • connect TX2 to GND
  • release CEN from GND
  • release TX2 from GND

This is what I get:

I’m a bit rusty, so can anyone point me to the right direction?

EDIT:
Spoke too soon. The weird part is, that I only reconncted TXD to GND and didn’t use CEN at all now. Suddenly flashing worked…Weird.

All is working well! Thanks @rudy12767 for sharing the YAML file and @dinant for the addition!