Personal log of yet another digital native.
GND
, D4
, and D3
instead of GND
, D1
, and D2
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
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
- 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