I have a simple binary_sensor
that sends an on/off mqtt event with delays.
binary_sensor:
- platform: gpio
name: "Window water level too high GPIO21"
device_class: MOISTURE
pin:
number: GPIO21
inverted: true
mode:
input: true
pullup: true
filters:
- delayed_off: 1s
- delayed_on: 15s
on_press:
then:
######################################################
# Must be turned on before setting frequency & level
######################################################
- output.turn_on: buzzer
######################################################
# Frequency sets the wave size
######################################################
- output.ledc.set_frequency:
id: buzzer
frequency: "1000Hz"
######################################################
# level sets the %age time the PWM is on
######################################################
- output.set_level:
id: buzzer
level: "90%"
on_release:
then:
- output.turn_off: buzzer
The problem I have is that I want the buzzer to follow the same delay logic but I can not understand how to do this since the delay
property in automation just waits and always continues.
Is this possible? I would like the buzzer to work without any external interaction.
Thanks!