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👍