-
Notifications
You must be signed in to change notification settings - Fork 1
/
mcu-gateway.yaml
217 lines (198 loc) · 4.35 KB
/
mcu-gateway.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
substitutions:
device: gateway
name: Gateway
comment: "DEV | BLE Proxy, Modbus"
esphome:
name: mcu-${device}
comment: ${comment}
esp32:
board: esp32doit-devkit-v1
framework:
version: 5.1.2
platform_version: 6.6.0
type: esp-idf
# external_components:
# - source: github://pr#4062
# components: ethernet
# - source: github://pr#4080
# components: [lcd_pcf8574, lcd_base]
# - source: github://pr#3564
# refresh: 0s
# components:
# - esp32
# - ethernet_info
# - ethernet
# # - wifi
# - source: github://pr#2112
# components: ["m5stack_4relay"]
# refresh: 1h
# - source: components
packages:
# common: !include common/common.yaml
common_eth: !include common/common_eth.yaml
## UEXT
# 3V3 1 2 GND
# GPIO4 3 4 GPIO36 U1TXD/U1RXD
# GPIO16 5 6 GPIO13 I2C-SCL/I2C-SDA
# GPIO15 7 8 GPIO2 HS2_CMD/HS2_DATA0
# GPIO14 9 10 GPIO5 HS2_CLK/SPI_CS
#
# SD/MMC; shared with UEXT, no CS!!!
# GPIO15 HS2_CMD
# GPIO14 HS2_CLK
# GPIO2 HS2_DATA0
# GPIO34 BUT1
# GPIO35 Battery Measurment ADC
# GPIO39 Ext Power Sense ADC
i2c:
sda: 13
scl: 16
scan: true
# ethernet:
# type: LAN8720
# mdc_pin: 23
# mdio_pin: 18
# clk_mode: GPIO17_OUT
# phy_addr: 0
# power_pin: 12
# use_address: 10.17.240.245
# # Optional manual IP
# manual_ip:
# static_ip: 10.17.240.254
# gateway: 10.17.240.1
# subnet: 255.255.255.0
uart:
id: uart_modbus
tx_pin: 4
rx_pin: 36
baud_rate: 9600
# stop_bits: 1
# data_bits: 8
# parity: NONE
# debug:
modbus:
id: modbus_id
modbus_controller:
- id: modbus_temp_1
address: 101
modbus_id: modbus_id
# update_interval: 10s
- id: modbus_temp_2
address: 102
modbus_id: modbus_id
# update_interval: 10s
- id: modbus_adc_1
address: 1
modbus_id: modbus_id
update_interval: 10s
sensor:
- platform: modbus_controller
modbus_controller_id: modbus_temp_1
id: temp_1
name: "${name} Temperature 1"
address: 0
unit_of_measurement: "°C"
register_type: read
value_type: U_WORD
accuracy_decimals: 1
register_count: 1
filters:
- multiply: 0.1
- platform: modbus_controller
modbus_controller_id: modbus_temp_1
id: hum_1
name: "${name} Humidity 1"
address: 1
unit_of_measurement: "%"
register_type: read
value_type: U_WORD
accuracy_decimals: 1
filters:
- multiply: 0.1
- platform: modbus_controller
modbus_controller_id: modbus_temp_2
id: temp_2
name: "${name} Temperature 2"
address: 0
unit_of_measurement: "°C"
register_type: read
value_type: U_WORD
accuracy_decimals: 1
register_count: 1
filters:
- multiply: 0.1
- platform: modbus_controller
modbus_controller_id: modbus_temp_2
id: hum_2
name: "${name} Humidity 2"
address: 1
unit_of_measurement: "%"
register_type: read
value_type: U_WORD
accuracy_decimals: 1
filters:
- multiply: 0.1
# - platform: bmp085
# temperature:
# name: "BMP180 Temperature"
# pressure:
# name: "BMP180 Pressure"
# address: 0x77
# update_interval: 60s
# - platform: bme280
# temperature:
# name: "BME280 Temperature"
# oversampling: 16x
# pressure:
# name: "BME280 Pressure"
# humidity:
# name: "BME280 Humidity"
# address: 0x76
# update_interval: 60s
- platform: modbus_controller
modbus_controller_id: modbus_adc_1
id: adc_1_1
name: "Solar Pressure"
address: 0
unit_of_measurement: "MPa"
register_type: holding
value_type: U_WORD
accuracy_decimals: 1
register_count: 2
filters:
- calibrate_linear:
- 50 -> 0
- 450 -> 5
switch:
- platform: modbus_controller
modbus_controller_id: modbus_adc_1
name: "Readress MODBUS"
register_type: holding
address: 0x00FD
entity_category: config
icon: "mdi:toggle-switch"
esp32_ble_tracker:
scan_parameters:
interval: 1100ms
window: 1100ms
active: true
bluetooth_proxy:
active: true
binary_sensor:
- platform: gpio
pin:
number: 34
inverted: true
id: user_button
on_press:
then:
- button.press: safe
button:
- platform: safe_mode
id: safe
# display:
# - platform: lcd_pcf8574
# dimensions: 20x4
# address: 0x27
# lambda: |-
# it.print(0, 3, "10°C or 10~C");