-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathesp-thermostat-bedroom.yaml
142 lines (136 loc) · 5.3 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
substitutions:
node_name: esp-thermostat-bedroom
node_friendly_name: Bedroom Thermostat
project_name: ClimateSprinklerController
project_version: v1
home_page_name: "weather"
rooms_page_name: "rooms"
sensors_page_name: "sensors"
weather_page_name: "weather"
# air quality entity name
air_quality_entity: "sensor.waqi_chi_com_illinois_usa"
# weather entity name
weather_entity: "weather.home_waltham"
# temperature sensor offsets
ntc_reference_voltage: "0.88V"
ntc_temperature_offset: "0.0"
dht22_temperature_offset: "-2.8"
bme280_temperature_offset: "-1.5"
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: 8MB
sensor:
# HA sensors we track - humidity
- platform: homeassistant
id: room_main_humidity_ha
entity_id: sensor.main_thermostat_bme680_humidity
on_value:
then:
- lambda: "id(nextionRoom2Hum).set_state(roundf(x * 10), false, true);"
- platform: homeassistant
id: room_family_room_humidity_ha
entity_id: sensor.family_room_thermostat_bme680_humidity
on_value:
then:
- lambda: "id(nextionRoom3Hum).set_state(roundf(x * 10), false, true);"
- platform: homeassistant
id: room_utility_room_humidity_ha
entity_id: sensor.sprinkler_controller_bme680_humidity
on_value:
then:
- lambda: "id(nextionRoom4Hum).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(nextionRoom5Hum).set_state(roundf(x * 10), false, true);"
# HA sensors we track - temperature
- platform: homeassistant
id: room_main_temperature_ha
entity_id: sensor.main_thermostat_bme680_temperature
on_value:
then:
- lambda: "id(nextionRoom2Temp).set_state(roundf(x * 10), false, true);"
- platform: homeassistant
id: room_family_room_temperature_ha
entity_id: sensor.family_room_thermostat_bme680_temperature
on_value:
then:
- lambda: "id(nextionRoom3Temp).set_state(roundf(x * 10), false, true);"
- platform: homeassistant
id: room_utility_room_temperature_ha
entity_id: sensor.sprinkler_controller_bme680_temperature
on_value:
then:
- lambda: "id(nextionRoom4Temp).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(nextionRoom5Temp).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: https://www.kbx81.net/download/public/climate/v2/NX8048K050.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("Main Floor:", false, true);
id(nextionTextRoom3).set_state("Family Room:", false, true);
id(nextionTextRoom4).set_state("Utility Room:", false, true);
id(nextionTextRoom5).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);