substitutions: device_name: "doorbell" esphome: name: "${device_name}" esp32: board: esp-wrover-kit framework: type: arduino # Enable logging logger: baud_rate: 0 # Enable Home Assistant API api: encryption: key: "MHhpWqaQqGakECxCuyzUl28EHQ0p9UmCPsC1gCR5kVY=" services: - service: update_display then: - component.update: doorbell_display - service: dfplayer_next then: - dfplayer.play_next: - service: dfplayer_previous then: - dfplayer.play_previous: - service: dfplayer_play variables: file: int then: - dfplayer.play: !lambda 'return file;' - service: dfplayer_play_folder variables: folder: int file: int then: - dfplayer.play_folder: folder: !lambda 'return folder;' file: !lambda 'return file;' - service: dfplayer_set_device_tf then: - dfplayer.set_device: TF_CARD - service: dfplayer_set_volume variables: volume: int then: - dfplayer.set_volume: !lambda 'return volume;' - service: dfplayer_set_eq variables: preset: int then: - dfplayer.set_eq: !lambda 'return static_cast(preset);' - service: dfplayer_sleep then: - dfplayer.sleep - service: dfplayer_reset then: - dfplayer.reset - service: dfplayer_start then: - dfplayer.start - service: dfplayer_pause then: - dfplayer.pause - service: dfplayer_stop then: - dfplayer.stop - service: dfplayer_volume_up then: - dfplayer.volume_up - service: dfplayer_volume_down then: - dfplayer.volume_down ota: password: "----password----" time: - platform: homeassistant id: esptime timezone: Europe/Berlin - platform: sntp on_time: # Every minute - seconds: 0 minutes: '*' then: - component.update: doorbell_display wifi: ssid: !secret wifi_ssid password: !secret wifi_password # Enable fallback hotspot (captive portal) in case wifi connection fails ap: ssid: "Doorbell Fallback Hotspot" password: "----password----" captive_portal: # doorbell camera esp32_camera: name: Doorbell_Cam vertical_flip: false horizontal_mirror: false external_clock: pin: GPIO0 frequency: 20MHz i2c_pins: sda: GPIO26 scl: GPIO27 data_pins: [GPIO5, GPIO18, GPIO19, GPIO21, GPIO36, GPIO39, GPIO34, GPIO35] vsync_pin: GPIO25 href_pin: GPIO23 pixel_clock_pin: GPIO22 power_down_pin: GPIO32 #resolution: 640x480 resolution: 800x600 #resolution: 1024x768 #resolution: 1280x1024 #resolution: 1600x1200 #jpeg_quality: 10 output: #flashlight - platform: gpio pin: GPIO4 id: gpio_4 light: #flashlight - platform: binary output: gpio_4 id: cam_flash name: Doorbell Cam flash binary_sensor: - platform: gpio pin: GPIO16 name: "Ring Door" id: ring_door_sensor #on_press: # then: # - component.update: doorbell_display #on_release: # then: # - component.update: doorbell_display - platform: homeassistant id: phone_message entity_id: input_boolean.phone_message internal: true sensor: - platform: wifi_signal id: wifi_strength name: "${device_name} WiFi Signal" update_interval: 5s - platform: homeassistant id: outdoor_temperature entity_id: sensor.aussensensor_temperature internal: true - platform: homeassistant id: outdoor_humidity entity_id: sensor.aussensensor_humidity internal: true text_sensor: - platform: homeassistant id: phone_number entity_id: input_select.door_phone_number internal: true # e-paper display 250x122 (128) font: - file: 'fonts/ComicSansMS3.ttf' id: font_comic24 size: 24 - file: 'fonts/ComicSansMS3_bold.ttf' id: font_comic_bold24 size: 24 - file: "fonts/Roboto-Regular.ttf" id: font_roboto20 size: 20 - file: "fonts/Roboto-Bold.ttf" id: font_roboto_bold24 size: 24 - file: 'fonts/materialdesignicons-webfont.ttf' id: font_icon20 size: 20 glyphs: [ "\U000F092E", # wifi-off "\U000F092F", # wifi-strength-0 "\U000F091F", # wifi-strength-1 "\U000F0922", # wifi-strength-2 "\U000F0925", # wifi-strength-3 "\U000F0928", # wifi-strength-4 "\U000F050F", # temp "\U000F058E", # humidity % "\U000F0150", # clock ] - file: 'fonts/materialdesignicons-webfont.ttf' id: font_icon24 size: 24 glyphs: [ "\U000F009A", # mdi-bell "\U000F009E", # mdi-bell-ring "\U000F1191", # phone ] spi: clk_pin: GPIO14 mosi_pin: GPIO13 display: - platform: waveshare_epaper id: doorbell_display cs_pin: GPIO33 dc_pin: GPIO15 busy_pin: GPIO12 reset_pin: GPIO2 model: 2.13in-ttgo-dke full_update_every: 60 update_interval: never reset_duration: 2ms rotation: 90 auto_clear_enabled: true lambda: |- #define H_WIFI 1 #define V_WIFI 4 #define H_TEMP 30 #define V_TEMP 2 #define H_HUM 115 #define V_HUM 2 #define H_CLOCK 180 #define V_CLOCK 2 // Wifi float wifi_rssi = id(wifi_strength).state; if (wifi_rssi > -50) { it.printf( H_WIFI, V_WIFI, id(font_icon20), "\U000F0928"); } else if (wifi_rssi > -60) { it.printf( H_WIFI, V_WIFI, id(font_icon20), "\U000F0925"); } else if (wifi_rssi > -70) { it.printf( H_WIFI, V_WIFI, id(font_icon20), "\U000F0922"); } else if (wifi_rssi > -80) { it.printf( H_WIFI, V_WIFI, id(font_icon20), "\U000F091F"); } else if (wifi_rssi > -90) { it.printf( H_WIFI, V_WIFI, id(font_icon20), "\U000F092F"); } else { it.printf( H_WIFI, V_WIFI, id(font_icon20), "\U000F092E"); } // Temp it.printf( H_TEMP, V_TEMP+2, id(font_icon20), "\U000F050F"); it.printf(H_TEMP+20, V_TEMP, id(font_roboto20), "%.1f°C", id(outdoor_temperature).state); // Humidity it.printf( H_HUM, V_HUM+2, id(font_icon20), "\U000F058E"); it.printf(H_HUM+20, V_HUM, id(font_roboto20), "%.0f%%", id(outdoor_humidity).state); // Clock it.printf( H_CLOCK, V_CLOCK+2, id(font_icon20), "\U000F0150"); it.strftime(H_CLOCK+20, V_CLOCK, id(font_roboto20), "%H:%M", id(esptime).now()); // ------------------------- it.line(0, 25, 250, 25); // Name plate it.print(70, 30, id(font_comic_bold24), "It's line 1"); it.print(7, 60, id(font_comic_bold24), "It's line 2"); if(id(phone_message).state) { it.printf(05, 100, id(font_icon24), "\U000F1191"); it.printf(35, 97, id(font_roboto_bold24), "%s", id(phone_number).state.c_str()); } else { it.print(53, 97, id(font_roboto_bold24), "It's line 3"); } # DF MP3 Player uart: tx_pin: GPIO1 rx_pin: GPIO3 baud_rate: 9600 dfplayer: on_finished_playback: then: logger.log: 'Playback finished event'