-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.yaml
More file actions
202 lines (182 loc) · 5.35 KB
/
Copy pathmain.yaml
File metadata and controls
202 lines (182 loc) · 5.35 KB
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
#
# Floor Heating Actuator Controller
# ESPHome PACKAGE configuration file
# See https://esphome.io/components/packages/
#
# Package available substitutions
substitutions:
# relay names -- these help you understand in HomeAssistant which relay is
# connected to which floor heating zone, without having to remember which
# GPIO pin corresponds to which zone
relay1_name: "Relay1"
relay2_name: "Relay2"
relay3_name: "Relay3"
relay4_name: "Relay4"
relay5_name: "Relay5"
relay6_name: "Relay6"
relay7_name: "Relay7"
relay8_name: "Relay8"
# secrets -- these allow the ESPHome device to "talk" to your Wifi and
# your HomeAssistant instance
encryption_key: "your_encryption_key_here"
ota_password: "your_ota_password_here"
wifi_ssid: "your_wifi_ssid_here"
wifi_password: "your_wifi_password_here"
wifi_ap_password: "your_wifi_ap_password_here"
# logging -- for extra debugging
#syslog_server: "your_syslog_server_ip_here"
#syslog_port: "514" # default syslog port is 514, but you can change it if your server uses a different port
# You might want to override this:
esphome:
name: floorheatingactuatorcontroller
friendly_name: FloorHeatingActuatorController
comment: "Relay board controlling under-floor heating pipes"
# Board
esp32:
board: esp32dev
framework:
type: esp-idf
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: ${encryption_key}
# Wireless Connectivity:
ota:
- platform: esphome
password: ${ota_password}
wifi:
ssid: ${wifi_ssid}
password: ${wifi_password}
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Floorheatingactuatorcontroller"
password: ${wifi_ap_password}
# Extra sensors:
text_sensor:
- platform: wifi_info
ip_address:
name: IP
icon: mdi:ip-network-outline
mac_address:
name: MAC
icon: mdi:network-outline
- platform: version
name: "ESPHome Version"
# Expose Uptime
- platform: template
name: "Uptime Human Readable"
id: uptime_human
icon: mdi:clock-start
# Captive Portal is the portal created by this node when Wifi connection fails
captive_portal:
# Webserver is exposed under regular use
web_server:
port: 80
# Disable OTA updates for web_server only
# Captive portal will still have OTA access since it auto-loads the web server OTA platform
ota: false
# SPI bus configuration
# MOSI is not required because the slave device does not accept any input
# SPI MOSI MISO SCLK CS
# VSPI GPIO23 GPIO19 GPIO18 GPIO5
# HSPI GPIO13 GPIO12 GPIO14 GPIO15
spi:
miso_pin: GPIO16
clk_pin: GPIO17
# Temperature sensors
sensor:
# Temperature sensor on SPI, see https://esphome.io/components/sensor/max6675/
- platform: max6675
id: heating_pipe_sensor
name: "Heating pipe Temperature"
cs_pin: GPIO15
update_interval: 60s
# WiFi information sensors
- platform: wifi_signal
name: Signal Strength
update_interval: 60s
- platform: dht
id: ambient_sensor
pin: GPIO5
model: DHT11
temperature:
name: "Ambient Temperature"
humidity:
name: "Ambient Humidity"
update_interval: 60s
# Uptime Sensor
- platform: uptime
name: "Uptime"
id: uptime_sensor
update_interval: 360s
on_raw_value:
then:
- text_sensor.template.publish:
id: uptime_human
state: !lambda |-
int seconds = round(id(uptime_sensor).raw_state);
int days = seconds / (24 * 3600);
seconds = seconds % (24 * 3600);
int hours = seconds / 3600;
seconds = seconds % 3600;
int minutes = seconds / 60;
seconds = seconds % 60;
return (
(days ? to_string(days) + "d " : "") +
(hours ? to_string(hours) + "h " : "") +
(minutes ? to_string(minutes) + "m " : "") +
(to_string(seconds) + "s")
).c_str();
# Status LED: indicates WiFi/API connection status
# GPIO23 LED will be ON when connected, blinking when disconnected
status_led:
pin: GPIO23
# Main relays controlling the floor heating zones
switch:
# relays use GPIOS 12-14, 25-27, 32-33 (GPIO23 is used for status LED)
- platform: gpio
name: ${relay1_name}
pin: GPIO13
restore_mode: RESTORE_DEFAULT_OFF
- platform: gpio
name: ${relay2_name}
pin: GPIO12
restore_mode: RESTORE_DEFAULT_OFF
- platform: gpio
name: ${relay3_name}
pin: GPIO14
restore_mode: RESTORE_DEFAULT_OFF
- platform: gpio
name: ${relay4_name}
pin: GPIO27
restore_mode: RESTORE_DEFAULT_OFF
- platform: gpio
name: ${relay5_name}
pin: GPIO26
restore_mode: RESTORE_DEFAULT_OFF
- platform: gpio
name: ${relay6_name}
pin: GPIO25
restore_mode: RESTORE_DEFAULT_OFF
- platform: gpio
name: ${relay7_name}
pin: GPIO33
restore_mode: RESTORE_DEFAULT_OFF
- platform: gpio
name: ${relay8_name}
pin: GPIO32
restore_mode: RESTORE_DEFAULT_OFF
#udp:
# syslog server
# addresses: ${syslog_server}
time:
# sync time with HomeAssistant, which in turn can be synced with an NTP server;
# a good time sync is not critical for this project but it can be useful for debugging
# when reading the logs
- platform: homeassistant
id: homeassistant_time
#syslog:
# emit syslog messages to server defined under "udp"
#port: ${syslog_port}