deurbel.yaml 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. esphome:
  2. name: deurbel
  3. platform: ESP8266
  4. board: d1_mini
  5. wifi:
  6. ssid: "<your wifi ssid>"
  7. password: "<secret_password>"
  8. # Enable logging
  9. logger:
  10. # Enable Home Assistant API
  11. api:
  12. ota:
  13. switch:
  14. - platform: gpio
  15. name: "Deurbel Relay"
  16. id: relay
  17. internal: true # NO NEED TO SEE IT IN HOMEASSISTANT
  18. icon: mdi:alarm-bell
  19. pin:
  20. number: D1 # D1 IS USED FOR RELAY ON WEMOS D1 RELAY SHIEL
  21. inverted: false
  22. binary_sensor:
  23. - platform: gpio
  24. pin: D2
  25. name: "Deurbel" # DOORBELL BUTTON
  26. #device_class: window
  27. filters:
  28. - delayed_on: 100ms # THIS DOES THE DEBOUNCE
  29. - delayed_off: 5000ms # THIS PREVENTS FROM MULTIPLE RANGS
  30. on_press:
  31. then:
  32. - if:
  33. condition:
  34. binary_sensor.is_off: mute # IF MUTE DONT RING
  35. then:
  36. - switch.turn_on: relay
  37. - delay: 1000ms
  38. - switch.turn_off: relay
  39. - platform: homeassistant
  40. name: "Input Boolean From Home Assistant"
  41. entity_id: input_boolean.mute_doorbell
  42. id: mute