124 lines
2.5 KiB
YAML
124 lines
2.5 KiB
YAML
esphome:
|
|
name: "tuersprechanlage"
|
|
friendly_name: "Türsprechanlage"
|
|
|
|
esp32:
|
|
board: lolin_s2_mini
|
|
variant: ESP32S2
|
|
framework:
|
|
type: esp-idf
|
|
sdkconfig_options:
|
|
CONFIG_ESP_CONSOLE_USB_CDC: y
|
|
|
|
logger:
|
|
hardware_uart: USB_CDC
|
|
|
|
api:
|
|
encryption:
|
|
key: !secret apikey_tuersprechanlage
|
|
|
|
ota:
|
|
- platform: esphome
|
|
password: !secret otapass_tuersprechanlage
|
|
|
|
wifi:
|
|
ssid: !secret wifi_ssid_bw
|
|
password: !secret wifi_password_bw
|
|
domain: .iot.bw.jalr.de
|
|
enable_on_boot: True
|
|
fast_connect: True
|
|
power_save_mode: none
|
|
output_power: 10
|
|
|
|
sensor:
|
|
- platform: wifi_signal
|
|
name: "WiFi Signal Sensor"
|
|
update_interval: 60s
|
|
|
|
binary_sensor:
|
|
- platform: gpio
|
|
name: Etagenklingel
|
|
id: floor_bell
|
|
pin:
|
|
number: GPIO16
|
|
mode:
|
|
input: true
|
|
pullup: true
|
|
filters:
|
|
- delayed_off: 10s
|
|
|
|
- platform: gpio
|
|
name: Treppenlicht
|
|
id: staircase_light
|
|
pin:
|
|
number: GPIO18
|
|
mode:
|
|
input: true
|
|
pullup: true
|
|
filters:
|
|
- invert
|
|
- delayed_off: 10s
|
|
on_press:
|
|
then:
|
|
- output.turn_on: output_staircase_light_ssr
|
|
- delay: 200ms
|
|
- output.turn_off: output_staircase_light_ssr
|
|
|
|
output:
|
|
- platform: gpio
|
|
pin: GPIO15
|
|
id: output_door_opener
|
|
- platform: ledc
|
|
pin:
|
|
number: GPIO33
|
|
inverted: true
|
|
id: output_staircase_light_ssr
|
|
frequency: 50000
|
|
min_power: 0
|
|
max_power: 0.12
|
|
- platform: template
|
|
type: binary
|
|
id: output_staircase_light_permanent
|
|
write_action:
|
|
- if:
|
|
condition:
|
|
lambda: 'return state;'
|
|
then:
|
|
- script.execute: script_staircase_permanent
|
|
else:
|
|
- script.stop: script_staircase_permanent
|
|
|
|
button:
|
|
- platform: template
|
|
name: "Türöffner"
|
|
id: btn_tueroeffner
|
|
icon: mdi:lock-open
|
|
on_press:
|
|
- output.turn_on: output_door_opener
|
|
- delay: 500ms
|
|
- output.turn_off: output_door_opener
|
|
- platform: template
|
|
name: "Treppenlicht"
|
|
id: btn_staircase_light
|
|
icon: mdi:stairs
|
|
on_press:
|
|
- output.turn_on: output_staircase_light_ssr
|
|
- delay: 200ms
|
|
- output.turn_off: output_staircase_light_ssr
|
|
|
|
light:
|
|
- platform: binary
|
|
id: staircase_permanent
|
|
name: Treppenlicht permanent
|
|
output: output_staircase_light_permanent
|
|
|
|
script:
|
|
- id: script_staircase_permanent
|
|
mode: restart
|
|
then:
|
|
- while:
|
|
condition:
|
|
lambda: 'return true;'
|
|
then:
|
|
- button.press: btn_staircase_light
|
|
- delay: 90s
|