-
Notifications
You must be signed in to change notification settings - Fork 6
/
esp-thermostat-bedroom.yaml
157 lines (150 loc) · 5.75 KB
/
esp-thermostat-bedroom.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
substitutions:
node_name: esp-thermostat-bedroom
node_friendly_name: "Bedroom Thermostat"
home_page_name: "weather"
rooms_page_name: "rooms"
sensors_page_name: "sensors"
weather_page_name: "weather"
# air quality entity name
air_quality_entity: "sensor.aqi_wh41"
# weather entity name
weather_entity: "weather.home_fairfield"
# temperature sensor offsets
ntc_reference_voltage: "0.89V"
ntc_temperature_offset: "0.0"
dht22_temperature_offset: "-2.8"
bme280_temperature_offset: "-1.7"
bme680_temperature_offset: "-2.2"
shtc3_temperature_offset: "-2.4"
tmp117_temperature_offset: "-2.7"
packages:
esp_common: !include shared/esp__common_core.yaml
esp_thermostat_common: !include shared/esp_thermostat_nextion_common_config.yaml
esp_thermostat_common_controller: !include shared/esp_thermostat_common_satellite_config.yaml
esp32:
flash_size: 16MB
# BME680 BSEC sensor
bme680_bsec:
address: 0x77
sensor:
# HA sensors we track - humidity
- platform: homeassistant
id: room_front_room_humidity_ha
entity_id: sensor.front_room_thermostat_bme680_humidity
on_value:
then:
- lambda: "id(nextionRoom2Hum).set_state(roundf(x * 10), false, true);"
- platform: homeassistant
id: room_nook_humidity_ha
entity_id: sensor.nook_thermostat_bme680_humidity
on_value:
then:
- lambda: "id(nextionRoom3Hum).set_state(roundf(x * 10), false, true);"
- platform: homeassistant
id: room_bathroom_humidity_ha
entity_id: sensor.bathroom_thermostat_bme680_humidity
on_value:
then:
- lambda: "id(nextionRoom4Hum).set_state(roundf(x * 10), false, true);"
- platform: homeassistant
id: room_boiler_humidity_ha
entity_id: sensor.boiler_room_bme680_humidity
on_value:
then:
- lambda: "id(nextionRoom5Hum).set_state(roundf(x * 10), false, true);"
- platform: homeassistant
id: room_garage_humidity_ha
entity_id: sensor.garage_sensor_humidity
on_value:
then:
- lambda: "id(nextionRoom6Hum).set_state(roundf(x * 10), false, true);"
# HA sensors we track - temperature
- platform: homeassistant
id: room_front_room_temperature_ha
entity_id: sensor.front_room_thermostat_bme680_temperature
on_value:
then:
- lambda: "id(nextionRoom2Temp).set_state(roundf(x * 10), false, true);"
- platform: homeassistant
id: room_nook_temperature_ha
entity_id: sensor.nook_thermostat_bme680_temperature
on_value:
then:
- lambda: "id(nextionRoom3Temp).set_state(roundf(x * 10), false, true);"
- platform: homeassistant
id: room_bathroom_temperature_ha
entity_id: sensor.bathroom_thermostat_bme680_temperature
on_value:
then:
- lambda: "id(nextionRoom4Temp).set_state(roundf(x * 10), false, true);"
- platform: homeassistant
id: room_boiler_temperature_ha
entity_id: sensor.boiler_room_bme680_temperature
on_value:
then:
- lambda: "id(nextionRoom5Temp).set_state(roundf(x * 10), false, true);"
- platform: homeassistant
id: room_garage_temperature_ha
entity_id: sensor.garage_sensor_temperature
on_value:
then:
- lambda: "id(nextionRoom6Temp).set_state(roundf(x * 10), false, true);"
# DHT22 sensor
- platform: dht
pin: 23
model: DHT22
temperature:
id: esp_thermostat_dht22_temperature
name: DHT22 Temperature
filters:
- offset: ${dht22_temperature_offset}
on_value:
then:
- lambda: |-
auto temperature_string = str_sprintf("%.1f", celsius_to_fahrenheit(id(esp_thermostat_dht22_temperature).state)) + "\xB0";
id(nextionTextSensor5a).set_state(temperature_string, false, true);
humidity:
id: esp_thermostat_dht22_humidity
name: DHT22 Humidity
accuracy_decimals: 1
on_value:
then:
- lambda: |-
auto humidity_string = str_sprintf("%.1f", id(esp_thermostat_dht22_humidity).state) + "%";
id(nextionTextSensor5b).set_state(humidity_string, false, true);
update_interval: 15s
display:
- platform: nextion
id: main_lcd
uart_id: nextion_uart
update_interval: 15s
tft_url: http://10.100.0.81/download/public/climate/v2/NX8048P050-011C.tft
lambda: |-
auto dateTime = id(esptime).now();
// update the Nextion's clock once per hour (and at start-up)
if (id(display_last_full_refresh) != dateTime.hour) {
id(display_last_full_refresh) = dateTime.hour;
main_lcd->set_nextion_rtc_time(dateTime);
}
on_setup:
then:
- script.execute: refresh_display_status_string
- script.execute: refresh_display_climate_mode
- script.execute: refresh_display_climate_fan_mode
- script.execute: refresh_display_set_points
- lambda: |-
main_lcd->goto_page("weather");
id(nextionTextRoom1).set_state("Local:", false, true);
id(nextionTextRoom2).set_state("Front Room:", false, true);
id(nextionTextRoom3).set_state("Nook:", false, true);
id(nextionTextRoom4).set_state("Bathroom:", false, true);
id(nextionTextRoom5).set_state("Boiler Room:", false, true);
id(nextionTextRoom6).set_state("Garage:", false, true);
id(nextionTextSensor1).set_state("BME680:", false, true);
id(nextionTextSensor2).set_state("BME280:", false, true);
id(nextionTextSensor3).set_state("SHTC3:", false, true);
id(nextionTextSensor4).set_state("TMP117:", false, true);
id(nextionTextSensor5).set_state("DHT22:", false, true);
id(nextionTextSensor6).set_state("Thermistor 1:", false, true);
id(nextionTextSensor7).set_state("Thermistor 2:", false, true);
id(nextionTextSensor8).set_state("SGP40:", false, true);