Qba

buzzer loop

Qba
Jun 18th, 2021
1,211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.47 KB | None | 0 0
  1. ########   BUZZ    ########
  2. output:
  3.   - platform: ledc
  4.     pin: GPIO32
  5.     id: buzzer
  6.  
  7. rtttl:
  8.   output: buzzer
  9.  
  10. switch:
  11.   - platform: template
  12.     name: Switch Buzz
  13.     id: Switch_Buzzer
  14.     icon: mdi:volume-high
  15.     optimistic: true
  16.     turn_on_action:
  17.     - while:
  18.         condition:
  19.           switch.is_on: Switch_Buzzer
  20.         then:
  21.           - rtttl.play: "siren:d=8,o=5,b=100:d,e,d,e,d,e,d,e"
  22.           - delay: 3s
  23.  
  24.     turn_off_action:
  25.    - rtttl.stop
Advertisement
Add Comment
Please, Sign In to add comment