infra/roles/hass-esphome/templates/includes/common.yaml.j2

95 lines
2.2 KiB
Django/Jinja

---
esphome:
name: ${name}
name_add_mac_suffix: false
logger:
mdns:
disabled: true
api:
# amount of time before rebooting when there are no api connections
reboot_timeout: "15min"
password: !secret api_password
# encryption:
# key: !secret api_encryption_key
ota:
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
domain: .{{ inventory_hostname.split('.')[1:] | join('.') }}
# use_address:
captive_portal:
# from esphome/bluetooth-proxies/esp32-generic.yaml, see https://esphome.io/components/improv_serial.html
# improv_serial:
web_server:
port: 80
version: 2
include_internal: true
js_url: "https://www.{{ domain }}/esphome/webserver-v2.min.js"
switch:
- platform: restart
name: ${name} reboot
icon: "mdi:power-cycle"
binary_sensor:
- platform: status
name: ${name} ESHome status
entity_category: "diagnostic"
id: ${id_prefix}_status
sensor:
- platform: wifi_signal
internal: true
name: ${name} WiFi signal strength
id: ${id_prefix}_wifi_signal_strength
update_interval: 60s
entity_category: "diagnostic"
unit_of_measurement: "dBm"
filters:
- throttle: 900s
- platform: copy
source_id: ${id_prefix}_wifi_signal_strength
name: ${name} WiFi signal
unit_of_measurement: "%"
device_class: power_factor
entity_category: "diagnostic"
filters:
- lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
text_sensor:
- platform: wifi_info
ip_address:
name: ${name} IP address
entity_category: "diagnostic"
ssid:
name: ${name} SSID
entity_category: "diagnostic"
mac_address:
name: ${name} WiFi mac address"
entity_category: "diagnostic"
dns_address:
name: ${name} DNS address
entity_category: "diagnostic"
- platform: version
name: ${name} ESPHome version"
id: ${id_prefix}_version
entity_category: "diagnostic"
button:
- platform: wake_on_lan
name: ${name} Wake-on-LAN TV
target_mac_address: !secret s21_mac_tc