75 lines
1.4 KiB
YAML
75 lines
1.4 KiB
YAML
substitutions:
|
|
name: "esproxy"
|
|
friendly_name: "ESProxy"
|
|
|
|
esphome:
|
|
name: "${name}"
|
|
friendly_name: "${friendly_name}"
|
|
name_add_mac_suffix: true
|
|
build_path: /tmp/esphome
|
|
|
|
esp32:
|
|
board: nodemcu-32s
|
|
framework:
|
|
type: esp-idf
|
|
|
|
wifi:
|
|
ssid: !secret wifi_ssid
|
|
password: !secret wifi_password
|
|
reboot_timeout: 0s
|
|
|
|
logger:
|
|
|
|
api:
|
|
encryption:
|
|
key: !secret encryption_key
|
|
reboot_timeout: 0s
|
|
|
|
ota:
|
|
platform: esphome
|
|
|
|
esp32_ble_tracker:
|
|
scan_parameters:
|
|
active: true
|
|
|
|
bluetooth_proxy:
|
|
active: true
|
|
|
|
debug:
|
|
|
|
time:
|
|
- platform: homeassistant
|
|
id: hass_time
|
|
on_time_sync:
|
|
then:
|
|
- if:
|
|
condition:
|
|
lambda: 'return id(device_last_restart).state == "";'
|
|
then:
|
|
- text_sensor.template.publish:
|
|
id: device_last_restart
|
|
state: !lambda '
|
|
char str[21];
|
|
time_t currTime = id(hass_time).now().timestamp;
|
|
strftime(str, sizeof(str), "%Y-%m-%dT%H:%M:%SZ", gmtime(&currTime));
|
|
return str;'
|
|
|
|
sensor:
|
|
- platform: wifi_signal
|
|
name: "WiFi Signal"
|
|
id: wifi_signal_db
|
|
update_interval: 60s
|
|
entity_category: "diagnostic"
|
|
|
|
text_sensor:
|
|
- platform: debug
|
|
reset_reason:
|
|
name: "Reset Reason"
|
|
|
|
- platform: template
|
|
name: 'Last Restart'
|
|
id: device_last_restart
|
|
icon: mdi:clock
|
|
entity_category: diagnostic
|
|
device_class: timestamp
|