mirror of
https://github.com/Anonym-tsk/smart-domofon.git
synced 2025-12-06 19:46:59 +03:00
Sexy config
This commit is contained in:
@@ -1,32 +1,65 @@
|
|||||||
# Smart Intercom project
|
# Smart Intercom project
|
||||||
# https://github.com/Anonym-tsk/smart-domofon/tree/master/esphome
|
# https://github.com/Anonym-tsk/smart-domofon/tree/master/esphome
|
||||||
|
|
||||||
|
############# User configuration #############
|
||||||
|
|
||||||
|
substitutions:
|
||||||
|
# NodeMCU v3 board
|
||||||
|
board: nodemcuv2
|
||||||
|
pin_relay_answer: D0
|
||||||
|
pin_relay_open: D1
|
||||||
|
pin_led_red: D2
|
||||||
|
pin_led_green: D3
|
||||||
|
pin_led_blue: D4
|
||||||
|
pin_call_detect: D5
|
||||||
|
pin_btn_accept: D6
|
||||||
|
|
||||||
|
# Wifi credentials
|
||||||
|
wifi_ssid: !secret wifi_ssid
|
||||||
|
wifi_password: !secret wifi_password
|
||||||
|
ip_address: !secret ip_domofon
|
||||||
|
ap_ssid: "Domofon"
|
||||||
|
ap_password: "1234567890"
|
||||||
|
|
||||||
|
# OTA and API
|
||||||
|
ota_password: "esphome"
|
||||||
|
api_password: "esphome"
|
||||||
|
|
||||||
|
# Software configuration
|
||||||
|
call_end_detect_delay: 3000ms
|
||||||
|
relay_answer_on_time: 1500ms
|
||||||
|
relay_open_on_time: 600ms
|
||||||
|
relay_after_open_delay: 500ms
|
||||||
|
short_click_time_from: 50ms
|
||||||
|
short_click_time_to: 1000ms
|
||||||
|
|
||||||
|
########### End user configuration ###########
|
||||||
|
|
||||||
esphome:
|
esphome:
|
||||||
name: domofon
|
name: domofon
|
||||||
platform: ESP8266
|
platform: ESP8266
|
||||||
# NodeMCU v3 board
|
board: $board
|
||||||
board: nodemcuv2
|
|
||||||
|
|
||||||
wifi:
|
wifi:
|
||||||
ssid: "YOUR_WIFI_SSID"
|
ssid: $wifi_ssid
|
||||||
password: "YOUR_WIFI_PASSWORD"
|
password: $wifi_password
|
||||||
|
use_address: $ip_address
|
||||||
fast_connect: on
|
fast_connect: on
|
||||||
use_address: 192.168.0.174
|
|
||||||
ap:
|
ap:
|
||||||
ssid: "Domofon"
|
ssid: $ap_ssid
|
||||||
password: "1234567890"
|
password: $ap_password
|
||||||
|
|
||||||
logger:
|
logger:
|
||||||
|
|
||||||
ota:
|
ota:
|
||||||
password: "esphome"
|
password: $ota_password
|
||||||
|
|
||||||
# Blue status led
|
# Blue status led
|
||||||
status_led:
|
status_led:
|
||||||
pin: D4
|
pin: $pin_led_blue
|
||||||
|
|
||||||
api:
|
api:
|
||||||
password: "esphome"
|
password: $api_password
|
||||||
reboot_timeout: 0s
|
reboot_timeout: 0s
|
||||||
services:
|
services:
|
||||||
# Accept call service for Home Assistant
|
# Accept call service for Home Assistant
|
||||||
@@ -60,11 +93,11 @@ script:
|
|||||||
- logger.log: "Accept call"
|
- logger.log: "Accept call"
|
||||||
- script.execute: state_no_call
|
- script.execute: state_no_call
|
||||||
- output.turn_on: relay_answer
|
- output.turn_on: relay_answer
|
||||||
- delay: 1500ms
|
- delay: $relay_answer_on_time
|
||||||
- output.turn_on: relay_open
|
- output.turn_on: relay_open
|
||||||
- delay: 600ms
|
- delay: $relay_open_on_time
|
||||||
- output.turn_off: relay_open
|
- output.turn_off: relay_open
|
||||||
- delay: 500ms
|
- delay: $relay_after_open_delay
|
||||||
- output.turn_off: relay_answer
|
- output.turn_off: relay_answer
|
||||||
|
|
||||||
# Reject incoming call
|
# Reject incoming call
|
||||||
@@ -73,7 +106,7 @@ script:
|
|||||||
- logger.log: "Reject call"
|
- logger.log: "Reject call"
|
||||||
- script.execute: state_no_call
|
- script.execute: state_no_call
|
||||||
- output.turn_on: relay_answer
|
- output.turn_on: relay_answer
|
||||||
- delay: 1500ms
|
- delay: $relay_answer_on_time
|
||||||
- output.turn_off: relay_answer
|
- output.turn_off: relay_answer
|
||||||
|
|
||||||
# No call state
|
# No call state
|
||||||
@@ -272,28 +305,28 @@ output:
|
|||||||
- platform: esp8266_pwm
|
- platform: esp8266_pwm
|
||||||
id: led_red
|
id: led_red
|
||||||
pin:
|
pin:
|
||||||
number: D2
|
number: $pin_led_red
|
||||||
mode: OUTPUT
|
mode: OUTPUT
|
||||||
|
|
||||||
# Green LED
|
# Green LED
|
||||||
- platform: esp8266_pwm
|
- platform: esp8266_pwm
|
||||||
id: led_green
|
id: led_green
|
||||||
pin:
|
pin:
|
||||||
number: D3
|
number: $pin_led_green
|
||||||
mode: OUTPUT
|
mode: OUTPUT
|
||||||
|
|
||||||
# Blue LED
|
# Blue LED
|
||||||
- platform: esp8266_pwm
|
- platform: esp8266_pwm
|
||||||
id: led_blue
|
id: led_blue
|
||||||
pin:
|
pin:
|
||||||
number: D4
|
number: $pin_led_blue
|
||||||
mode: OUTPUT
|
mode: OUTPUT
|
||||||
|
|
||||||
# Relay answer
|
# Relay answer
|
||||||
- platform: gpio
|
- platform: gpio
|
||||||
id: relay_answer
|
id: relay_answer
|
||||||
pin:
|
pin:
|
||||||
number: D0
|
number: $pin_relay_answer
|
||||||
mode: OUTPUT
|
mode: OUTPUT
|
||||||
inverted: true
|
inverted: true
|
||||||
|
|
||||||
@@ -301,7 +334,7 @@ output:
|
|||||||
- platform: gpio
|
- platform: gpio
|
||||||
id: relay_open
|
id: relay_open
|
||||||
pin:
|
pin:
|
||||||
number: D1
|
number: $pin_relay_open
|
||||||
mode: OUTPUT
|
mode: OUTPUT
|
||||||
inverted: true
|
inverted: true
|
||||||
|
|
||||||
@@ -312,11 +345,11 @@ binary_sensor:
|
|||||||
id: incoming_call
|
id: incoming_call
|
||||||
device_class: lock
|
device_class: lock
|
||||||
pin:
|
pin:
|
||||||
number: D5
|
number: $pin_call_detect
|
||||||
mode: INPUT_PULLUP
|
mode: INPUT_PULLUP
|
||||||
inverted: True
|
inverted: True
|
||||||
filters:
|
filters:
|
||||||
delayed_off: 3000ms
|
delayed_off: $call_end_detect_delay
|
||||||
on_press:
|
on_press:
|
||||||
then:
|
then:
|
||||||
script.execute: state_call
|
script.execute: state_call
|
||||||
@@ -329,7 +362,7 @@ binary_sensor:
|
|||||||
name: "Domofon button"
|
name: "Domofon button"
|
||||||
id: button
|
id: button
|
||||||
pin:
|
pin:
|
||||||
number: D6
|
number: $pin_btn_accept
|
||||||
mode: INPUT_PULLUP
|
mode: INPUT_PULLUP
|
||||||
inverted: True
|
inverted: True
|
||||||
filters:
|
filters:
|
||||||
@@ -337,7 +370,7 @@ binary_sensor:
|
|||||||
on_multi_click:
|
on_multi_click:
|
||||||
# Short click - open door or enable once auto opening
|
# Short click - open door or enable once auto opening
|
||||||
- timing:
|
- timing:
|
||||||
- ON for 50ms to 1000ms
|
- ON for $short_click_time_from to $short_click_time_to
|
||||||
then:
|
then:
|
||||||
if:
|
if:
|
||||||
condition:
|
condition:
|
||||||
@@ -348,13 +381,13 @@ binary_sensor:
|
|||||||
if:
|
if:
|
||||||
condition:
|
condition:
|
||||||
switch.is_on: auto_open_once
|
switch.is_on: auto_open_once
|
||||||
then:
|
then:
|
||||||
switch.turn_on: auto_open
|
switch.turn_on: auto_open
|
||||||
else:
|
else:
|
||||||
switch.turn_on: auto_open_once
|
switch.turn_on: auto_open_once
|
||||||
# Long click - disable auto opening
|
# Long click - disable auto opening
|
||||||
- timing:
|
- timing:
|
||||||
- ON for at least 1000ms
|
- ON for at least $short_click_time_to
|
||||||
then:
|
then:
|
||||||
if:
|
if:
|
||||||
condition:
|
condition:
|
||||||
|
|||||||
Reference in New Issue
Block a user