Skip to content

Instantly share code, notes, and snippets.

@fachinformatiker
Forked from frenck/doorbell.yaml
Created June 9, 2020 07:49
Show Gist options
  • Select an option

  • Save fachinformatiker/4df485cf5d5ad2c33c0eafede4487640 to your computer and use it in GitHub Desktop.

Select an option

Save fachinformatiker/4df485cf5d5ad2c33c0eafede4487640 to your computer and use it in GitHub Desktop.

Revisions

  1. @frenck frenck revised this gist Aug 4, 2019. No changes.
  2. @frenck frenck revised this gist Aug 3, 2019. 1 changed file with 15 additions and 0 deletions.
    15 changes: 15 additions & 0 deletions home-assistant-doorbell-camera.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    ---
    # This automation triggers when the doorbell button is pushed
    # and out the front door camera stream to the tv.
    #
    automation:
    - alias: "Doorbell Camera"
    trigger:
    platform: state
    entity_id: binary_sensor.doorbell_button
    to: 'on'
    action:
    - service: camera.play_stream
    data:
    entity_id: camera.front_door
    media_player: media_player.living_room_tv
  3. @frenck frenck revised this gist Aug 3, 2019. 2 changed files with 21 additions and 1 deletion.
    20 changes: 20 additions & 0 deletions home-assistant-doorbell-chime.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    ---
    # Turns off the doorbell chime after 8pm.
    # Turns it on again in the morning @ 7am.
    #
    automation:
    - alias: "Doorbell off after 8pm"
    trigger:
    platform: time
    at: "20:00:00"
    action:
    service: switch.turn_off
    entity_id: switch.doorbell_chime_active

    - alias: "Doorbell on after 7am"
    trigger:
    platform: time
    at: "07:00:00"
    action:
    service: switch.turn_on
    entity_id: switch.doorbell_chime_active
    2 changes: 1 addition & 1 deletion home-assistant-doorbell-notification.yaml
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    # and sends out a notification to our Apple iPhones/watches.
    #
    automation:
    - alias: doorbell_notification
    - alias: "Doorbell Notifications"
    trigger:
    platform: state
    entity_id: binary_sensor.doorbell_button
  4. @frenck frenck revised this gist Aug 3, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion home-assistant-doorbell-notification.yaml
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    # This automation triggers when the doorbell button is pushed
    # and sends out a notification to our Apple iPhones/watches.
    #
    automations:
    automation:
    - alias: doorbell_notification
    trigger:
    platform: state
  5. @frenck frenck revised this gist Aug 3, 2019. 1 changed file with 23 additions and 22 deletions.
    45 changes: 23 additions & 22 deletions home-assistant-doorbell-notification.yaml
    Original file line number Diff line number Diff line change
    @@ -2,25 +2,26 @@
    # This automation triggers when the doorbell button is pushed
    # and sends out a notification to our Apple iPhones/watches.
    #
    alias: doorbell_notification
    trigger:
    platform: state
    entity_id: binary_sensor.doorbell_button
    to: 'on'
    action:
    - service: notify.mobile_app_frencks_iphone
    data:
    title: Doorbell
    message: Ding dong! Someone is at the door!
    data:
    attachment:
    content-type: jpeg
    url: http://tiptag.com.ar/wp-content/uploads/2018/06/timbre1.jpg
    - service: notify.mobile_app_ninja_iphone
    data:
    title: Doorbell
    message: Ding dong! Someone is at the door!
    data:
    attachment:
    content-type: jpeg
    url: http://tiptag.com.ar/wp-content/uploads/2018/06/timbre1.jpg
    automations:
    - alias: doorbell_notification
    trigger:
    platform: state
    entity_id: binary_sensor.doorbell_button
    to: 'on'
    action:
    - service: notify.mobile_app_frencks_iphone
    data:
    title: Doorbell
    message: Ding dong! Someone is at the door!
    data:
    attachment:
    content-type: jpeg
    url: http://tiptag.com.ar/wp-content/uploads/2018/06/timbre1.jpg
    - service: notify.mobile_app_ninja_iphone
    data:
    title: Doorbell
    message: Ding dong! Someone is at the door!
    data:
    attachment:
    content-type: jpeg
    url: http://tiptag.com.ar/wp-content/uploads/2018/06/timbre1.jpg
  6. @frenck frenck revised this gist Aug 3, 2019. 1 changed file with 26 additions and 0 deletions.
    26 changes: 26 additions & 0 deletions home-assistant-doorbell-notification.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    ---
    # This automation triggers when the doorbell button is pushed
    # and sends out a notification to our Apple iPhones/watches.
    #
    alias: doorbell_notification
    trigger:
    platform: state
    entity_id: binary_sensor.doorbell_button
    to: 'on'
    action:
    - service: notify.mobile_app_frencks_iphone
    data:
    title: Doorbell
    message: Ding dong! Someone is at the door!
    data:
    attachment:
    content-type: jpeg
    url: http://tiptag.com.ar/wp-content/uploads/2018/06/timbre1.jpg
    - service: notify.mobile_app_ninja_iphone
    data:
    title: Doorbell
    message: Ding dong! Someone is at the door!
    data:
    attachment:
    content-type: jpeg
    url: http://tiptag.com.ar/wp-content/uploads/2018/06/timbre1.jpg
  7. @frenck frenck revised this gist Aug 2, 2019. 1 changed file with 120 additions and 0 deletions.
    120 changes: 120 additions & 0 deletions doorbell.yaml
    Original file line number Diff line number Diff line change
    @@ -1 +1,121 @@
    ---
    esphome:
    name: doorbell
    platform: ESP8266
    board: esp01_1m

    # WiFi connection, correct these
    # with values for your WiFi.
    wifi:
    ssid: !secret wifi_ssid
    password: !secret wifi_password

    # Enable logging.
    logger:

    # Enable Home Assistant API.
    api:

    # Enable over-the-air updates.
    ota:

    # Enable Web server.
    web_server:
    port: 80

    # Sync time with Home Assistant.
    time:
    - platform: homeassistant
    id: homeassistant_time

    # Text sensors with general information.
    text_sensor:
    # Expose ESPHome version as sensor.
    - platform: version
    name: Doorbell ESPHome Version
    # Expose WiFi information as sensors.
    - platform: wifi_info
    ip_address:
    name: Doorbell IP
    ssid:
    name: Doorbell SSID
    bssid:
    name: Doorbell BSSID

    # Sensors with general information.
    sensor:
    # Uptime sensor.
    - platform: uptime
    name: Doorbell Uptime

    # WiFi Signal sensor.
    - platform: wifi_signal
    name: Doorbell WiFi Signal
    update_interval: 60s

    # Global to store the on/off state of the chime
    globals:
    - id: chime
    type: bool
    restore_value: true
    initial_value: 'true'

    # Exposed switches.
    switch:
    # Switch to restart the doorbell.
    - platform: restart
    name: Doorbell Restart

    # Switch to turn on/off the chime.
    - platform: gpio
    id: relay
    inverted: true
    name: Doorbell Chime
    pin: GPIO0

    # Switch to turn on/off chime when
    # doorbell button is pushed.
    #
    # It creates a "virtual" switch based
    # on a global variable.
    - platform: template
    name: Doorbell Chime Active
    id: chime_active
    restore_state: false
    turn_on_action:
    - globals.set:
    id: chime
    value: 'true'
    turn_off_action:
    - globals.set:
    id: chime
    value: 'false'
    lambda: |-
    return id(chime);
    # Binary sensor representing the
    # Doorbell button push.
    binary_sensor:
    - platform: gpio
    id: button
    name: Doorbell Button
    pin:
    # Connected to GPIO on the ESP-01S.
    number: GPIO2
    mode: INPUT_PULLUP
    inverted: true
    filters:
    # Small filter, to debounce the button press.
    - delayed_on: 25ms
    - delayed_off: 25ms
    on_press:
    # Only turn on the chime when it is active.
    then:
    if:
    condition:
    - switch.is_on: chime_active
    then:
    - switch.turn_on: relay
    on_release:
    # On release, turn of the chime.
    - switch.turn_off: relay
  8. @frenck frenck created this gist Aug 2, 2019.
    1 change: 1 addition & 0 deletions doorbell.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    ---