-
Notifications
You must be signed in to change notification settings - Fork 0
/
agtemplate.yaml
138 lines (116 loc) · 2.82 KB
/
agtemplate.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
substitutions:
name: bt_template
friendly_name: ESP32 BT Template
short_name: ESP32 BT
core_name: $short_name Core
comment: Bluetooth Proxy
esphome:
name: ${name}
name_add_mac_suffix: false
friendly_name: ${friendly_name}
comment: ${comment}
on_boot:
- priority: 900.0
then:
- lambda: |-
id(cpu_speed) = ESP.getCpuFreqMHz();
project:
name: esphome.bluetooth-proxy
version: "1.0"
# Define Card type
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging & ota
logger:
improv_serial:
ota:
- platform: esphome
# Enable Home Assistant API
api:
encryption:
key: "YOUR_KEY"
# Import BT
dashboard_import:
package_import_url: github://esphome/firmware/bluetooth-proxy/esp32-generic.yaml@main
# Enable ESPHome Web
web_server:
local: true
# Local WiFI Config & fix IP
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
static_ip: 192.168.1.177
gateway: 192.168.1.1
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: ${name}
password: !secret wifi_ap_password
captive_portal:
# Define CPU Speed
globals:
- id: cpu_speed
type: int
restore_value: no
initial_value: "0"
# Define time & sync
time:
- platform: sntp
id: time_sntp
- platform: homeassistant
id: current_time
on_time_sync:
- component.update: uptime_timestamp
# Bluetooth config
esp32_ble_tracker:
scan_parameters:
# We currently use the defaults to ensure Bluetooth
# can co-exist with WiFi In the future we may be able to
# enable the built-in coexistence logic in ESP-IDF
active: true
bluetooth_proxy:
active: true
# Sensors
sensor:
# Reports the WiFi signal strength/RSSI in dB
- platform: wifi_signal
name: "$core_name WiFi Signal dB"
id: wifi_signal_db
update_interval: 60s
entity_category: "diagnostic"
# Reports the WiFi signal strength in %
- platform: copy
source_id: wifi_signal_db
name: "$core_name WiFi Signal"
filters:
- lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
unit_of_measurement: "%"
entity_category: "diagnostic"
device_class: ""
# Reports the uptime
- platform: uptime
name: "$core_name Uptime Sensor"
id: uptime_seconds
# Device CPU Speed
- platform: template
name: "$core_name Cpu Speed"
accuracy_decimals: 0
unit_of_measurement: Mhz
lambda: |-
return (id(cpu_speed));
entity_category: "diagnostic"
#Exposes control buttons
button:
- platform: restart
icon: mdi:power-cycle
name: "$core_name Reboot"
- platform: safe_mode
name: "$core_name Safe Mode Boot"
entity_category: diagnostic
- platform: factory_reset
disabled_by_default: True
name: "$core_name Factory Reset"
id: factory_reset_all