-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathuzg01-mixed.yaml
227 lines (205 loc) · 4.75 KB
/
uzg01-mixed.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
substitutions:
#Name your Gateway
device_name: uzg01-mixed
#Home Assistant Name
friendly_name: UZG Gateway - Mixed
#Secret YAML is used for next data:
#pi_pw: !secret api_password
#ota_pw: !secret ota_password
esphome:
name: "${device_name}"
name_add_mac_suffix: false
project:
name: ZigStar.UZG01-Mixed
version: "1.0"
on_boot:
priority: 600
then:
- switch.turn_on: zRST_gpio
- delay: 15ms
- switch.turn_off: zRST_gpio
esp32:
board: esp32dev
framework:
type: esp-idf
sdkconfig_options:
CONFIG_FREERTOS_UNICORE: y
CONFIG_ESP_TASK_WDT_TIMEOUT_S: "10"
ethernet:
type: LAN8720
mdc_pin: GPIO23
mdio_pin: GPIO18
clk_mode: GPIO17_OUT
phy_addr: 0
power_pin: GPIO05
## General ESPHome settings
# Home Assistant API is enabled
api:
#password: ${api_pw}
reboot_timeout: 0s
# Logger is enabled
logger:
level: DEBUG
# Enable OTA
ota:
#password: ${ota_pw}
# Enable WEB
web_server:
port: 80
dashboard_import:
package_import_url: github://mercenaruss/zigstar_gateways/files/ESP-HOME/zigstar-uzg-01/uzg01-mixed.yaml@main
import_full_config: true
# BTProxy
esp32_ble_tracker:
scan_parameters:
interval: 1100ms
window: 1100ms
active: true
bluetooth_proxy:
active: true
##Uptime generic sensor
sensor:
- platform: uptime
id: uptime_s
update_interval: 60s
# Enable HA Time
time:
- platform: homeassistant
id: homeassistant_time
#External component Stream Server
external_components:
- source: github://tube0013/esphome-stream-server-v2
#CONTROL SETTINGS
## Buttons
button:
- platform: safe_mode
name: 3.3.Safe Mode Reboot
entity_category: diagnostic
### Zigbee Restart
- platform: template
name: "3.2.Zigbee - Restart"
icon: mdi:restart
id: zRST
on_press:
- switch.turn_on: zRST_gpio
- delay: 15ms
- switch.turn_off: zRST_gpio
### ESP32 Restart
- platform: restart
name: "3.1.ESP32 - Restart"
### Zigbee Flash Mode
- platform: template
name: "2.1.Zigbee - Flash Mode"
icon: mdi:cellphone-arrow-down
on_press:
- script.execute: fw_update_mode
##Status of physical button - sensor
binary_sensor:
- platform: gpio
name: "4.1.Physical button status"
icon: mdi:toggle-switch
id: gpio35btn1
pin:
number: GPIO35
mode:
input: true
inverted: yes
on_press:
then:
- switch.toggle: modeSwitchTemplate
## Socket connection status
- platform: stream_server
stream_server: s_s
name: "4.2.Z2M/ZHA Connected"
## Switches
switch:
### CC2652P Restart
- platform: gpio
pin: 16
id: zRST_gpio
inverted: yes
restore_mode: ALWAYS_OFF
### Zigbee CC2652P to flash mode switch
- platform: gpio
pin: 32
name: "Zigbee Flash Mode internal"
icon: mdi:toggle-switch
id: zBSL
inverted: yes
restore_mode: ALWAYS_OFF
internal: true
### Mode LAN/USB switch
- platform: template
name: "1.0.UZG-01 MODE SWITCH (LAN|OFF| / USB|ON|)"
id: modeSwitchTemplate
turn_on_action:
- switch.turn_on: gpio12LED1
- switch.turn_on: gpio4Select
- switch.template.publish:
id: modeSwitchTemplate
state: ON
turn_off_action:
- switch.turn_off: gpio12LED1
- switch.turn_off: gpio4Select
- switch.template.publish:
id: modeSwitchTemplate
state: OFF
- platform: gpio
name: "DEVICE MODE SWITCH (LAN|OFF| / USB|ON|)"
restore_mode: ALWAYS_OFF
icon: mdi:toggle-switch
internal: true
id: gpio4Select
pin:
number: GPIO33
### LEDs swithces
- platform: gpio
name: "2.3.Mode LED (RED)"
restore_mode: ALWAYS_OFF
icon: mdi:toggle-switch
id: gpio12LED1
pin:
number: GPIO12
- platform: gpio
name: "2.2.Power LED (BLUE)"
restore_mode: ALWAYS_ON
icon: mdi:toggle-switch
id: gpio14LED2
pin:
number: GPIO14
#Update CC2652 Firmware
script:
- id: fw_update_mode
then:
- switch.turn_on: zBSL
- delay: 1s
- switch.turn_on: zRST_gpio
- delay: 1s
- switch.turn_off: zRST_gpio
- logger.log: "Delaying 4 seconds for TI chip to be ready"
- delay: 4s
- switch.turn_off: zBSL
- logger.log: "Update with cc2538-bsl tool now!"
- logger.log: "Usage: cc2538-bsl.py -p socket://ip_or_hostname:6638 -evw firmware.hex"
#UART Settings
uart:
id: uart_bus
rx_pin: GPIO36
tx_pin: GPIO04
baud_rate: 115200
#Serial Bridge Settings,uncomment #port to change default 6638 TCP port
stream_server:
uart_id: uart_bus
id: s_s
# port: 1234
mdns:
services:
- service: "_uzg-01"
protocol: "_tcp"
port: 6638
txt:
version: 1.0
name: UZG-01
radio_type: znp
baud_rate: 115200
data_flow_control: software