-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbtle_gw.yaml
113 lines (96 loc) · 2.33 KB
/
btle_gw.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
substitutions:
device_name: "ble-monitor"
friendly_name: "BLE Monitor Gateway"
esphome:
name: ${device_name}
comment: ${friendly_name}
name_add_mac_suffix: True
external_components:
- source: github://myhomeiot/esphome-components
logger:
esp32:
variant: ESP32
board: featheresp32
framework:
type: arduino
# version: 2.0.7
# platform_version: 6.0.1
api:
reboot_timeout: 1h
encryption:
key: !secret hass_key
web_server:
port: 80
ota:
password: !secret hass_password
wifi:
ap:
ssid: "BLE-MONITOR"
captive_portal:
improv_serial:
esp32_ble_tracker:
sensor:
- platform: uptime
name: Uptime
id: sys_uptime
update_interval: 10s
- platform: wifi_signal
name: RSSI
id: wifi_rssi
update_interval: 10s
entity_category: "diagnostic"
- platform: template
id: esp_memory
icon: mdi:memory
name: ESP Free Memory
lambda: return heap_caps_get_free_size(MALLOC_CAP_INTERNAL) / 1024;
unit_of_measurement: 'kB'
state_class: measurement
entity_category: "diagnostic"
ble_gateway:
id: blegateway
on_ble_advertise:
then:
homeassistant.event:
event: esphome.on_ble_advertise
data:
packet: !lambda return packet;
# gateway_id: ${device_id}
binary_sensor:
- platform: homeassistant
id: ble_gateway_discovery
entity_id: binary_sensor.ble_gateway
attribute: discovery
on_state:
then:
lambda: id(blegateway).set_discovery(x);
- platform: status
name: Online
id: ink_ha_connected
text_sensor:
- platform: homeassistant
id: ble_gateway_devices
entity_id: binary_sensor.ble_gateway
attribute: devices
on_value:
then:
lambda: id(blegateway).set_devices(x);
switch:
- platform: template
id: switch_ble_gateway_discovery
name: BLE Gateway Discovery
icon: mdi:bluetooth-connect
lambda: return id(blegateway).get_discovery();
turn_on_action: [lambda: id(blegateway).set_discovery(true);]
turn_off_action: [lambda: id(blegateway).set_discovery(false);]
disabled_by_default: true
entity_category: config
button:
- platform: restart
# disabled_by_default: True
icon: mdi:power-cycle
name: "ESP Reboot"
- platform: factory_reset
disabled_by_default: True
name: Factory Reset
id: factory_reset_all