Entropy Reduction

Personal log of yet another digital native.


Project maintained by andre-abadi Hosted on GitHub Pages — Theme by mattgraham

Purpose

References

Design Files

Actions

Reflections

Pictures

doorbell-actual-2

Code

ESPHome

logger:
  logs:
    switch: INFO
switch:
  - platform: gpio
    pin: D4
    id: light
    name: "${friendly_name} Light"
    restore_mode: ALWAYS_ON
    internal: true

binary_sensor:
  - platform: gpio
    id: bin
    icon: mdi:radiobox-marked
    name: "${friendly_name} Button"
    #device_class: garage_door
    pin:
      number: D3
      inverted: true
      mode: INPUT_PULLUP
    filters:
      - delayed_off: 30s
    # automation when button is pressed
    on_press:
      - repeat:
          count: 15
          then:
            - switch.turn_off: light
            - delay: 50ms
            - switch.turn_on: light
      - switch.turn_off: light
    on_release:
      then:
        - switch.turn_on: light

Unused Un-Pressed Strobe

        
         slow strobe when not pressed,
         but only after first press
        
        - while:
            condition:
              binary_sensor.is_off: bin
            
            
            then:
              - switch.turn_off: light
              - delay: 100ms
              - switch.turn_on: light
              - delay: 1s
              

Automation

- id: '1651317777505'
  alias: Doorbell Actual
  description: Ring the doorbell at 25% after 6pm before 6am, otherwise 75%. Notify
    all apps if house unoccupied.
  trigger:
  - platform: state
    entity_id: binary_sensor.doorbell_actual_button
    to: 'on'
  condition: []
  action:
  - choose:
    - conditions:
      - condition: time
        before: '18:00:00'
        after: 06:00:00
      sequence:
      - service: media_player.volume_set
        data:
          volume_level: 0.75
        target:
          entity_id: media_player.living_room_speaker
    default:
    - service: media_player.volume_set
      data:
        volume_level: 0.35
      target:
        entity_id: media_player.living_room_speaker
  - service: media_player.play_media
    data:
      media_content_id: media-source://media_source/local/doorbell.mp3
      media_content_type: audio/mp3
    target:
      entity_id: media_player.living_room_speaker
  - choose:
    - conditions:
      - condition: state
        entity_id: binary_sensor.occupancy
        state: 'off'
        for:
          minutes: 5
      sequence:
      - service: notify.all_hass_apps
        data:
          data:
            clickAction: /lovelace-cctv/main
          title: 🔔 The Doorbell Rang
          message: Tap to see CCTV summary.
    default: []
  mode: single