1esphome:
2 name: raumklima-wohnzimmer
3
4esp8266:
5 board: nodemcuv2
6
7logger:
8api:
9ota:
10wifi:
11 ssid: !secret wifi_ssid
12 password: !secret wifi_password
13
14 ap:
15 ssid: "raumklima-wohnzimmer"
16 password: "E7TE90zuyCxr"
17
18captive_portal:
19
20sensor:
21 - platform: dht
22 pin: D2
23 temperature:
24 name: "Wohnzimmer Temperatur"
25 id: "temp_wz"
26 filters:
27 - calibrate_linear:
28 - 0.0 -> 0.0
29 - 24.4 -> 21.7
30 humidity:
31 name: "Wohnzimmer Luftfeuchtigkeit"
32 id: "feuchte_wz"
33 update_interval: 10s
34
35 - platform: homeassistant
36 id: temp_aussen
37 entity_id: sensor.temp_aussen
38
39time:
40 - platform: homeassistant
41 id: homeassistant_time
42
43sun:
44 latitude: 52.3923°
45 longitude: 13.5170°
46 on_sunrise:
47 - then:
48 - light.turn_on:
49 id: oled_light2
50 on_sunset:
51 - then:
52 - light.turn_off:
53 id: oled_light2
54
55font:
56 - file: 'arial.ttf'
57 id: font1
58 size: 20
59 glyphs:
60 ['&', '@', '!', ',', '.', '?', '"', '%', '(', ')', '+', '-', '_', ':', '°', '0',
61 '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E',
62 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
63 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
64 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
65 'u', 'v', 'w', 'x', 'y', 'z','å', 'Ä', 'ä', 'Ö', 'ö', 'Ü', 'ü', 'ß', '/']
66 - file: 'arial.ttf'
67 id: font2
68 size: 12
69 glyphs:
70 ['&', '@', '!', ',', '.', '?', '"', '%', '(', ')', '+', '-', '_', ':', '°', '0',
71 '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E',
72 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
73 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
74 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
75 'u', 'v', 'w', 'x', 'y', 'z','å', 'Ä', 'ä', 'Ö', 'ö', 'Ü', 'ü', 'ß', '/']
76 - file: 'arial.ttf'
77 id: font3
78 size: 16
79 glyphs:
80 ['&', '@', '!', ',', '.', '?', '"', '%', '(', ')', '+', '-', '_', ':', '°', '0',
81 '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E',
82 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
83 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
84 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
85 'u', 'v', 'w', 'x', 'y', 'z','å', 'Ä', 'ä', 'Ö', 'ö', 'Ü', 'ü', 'ß', '/']
86
87 - file: 'arial.ttf'
88 id: font4
89 size: 18
90 glyphs:
91 ['&', '@', '!', ',', '.', '?', '"', '%', '(', ')', '+', '-', '_', ':', '°', '0',
92 '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E',
93 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
94 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
95 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
96 'u', 'v', 'w', 'x', 'y', 'z','å', 'Ä', 'ä', 'Ö', 'ö', 'Ü', 'ü', 'ß', '/']
97
98spi:
99 clk_pin: D5
100 mosi_pin: D7
101
102display:
103 - platform: ssd1306_spi
104 model: "SSD1306 128x64"
105 id: my_display
106 cs_pin: D8
107 dc_pin: D6
108 reset_pin: D1
109 pages:
110 - id: page1
111 lambda: |-
112 it.printf(1, 0, id(font1), "%.1f°C", id(temp_wz).state);
113 it.printf(70, 0, id(font1), "%.1f%%", id(feuchte_wz).state);
114 it.printf(4, 22, id(font2), "Außentemperatur");
115 it.printf(1, 33, id(font3), "%.1f°C", id(temp_aussen).state);
116 it.strftime(56, 45, id(font4), "%X", id(homeassistant_time).now());
117
118switch:
119 - platform: template
120 name: "Oled Backlights2"
121 id: oled_backlight2
122 assumed_state: true
123 optimistic: true
124 turn_on_action:
125 then:
126 - lambda: |-
127 id(my_display).turn_on();
128 id(my_display).fill(COLOR_ON);
129 turn_off_action:
130 then:
131 - lambda: |-
132 id(my_display).turn_off();
133 id(my_display).fill(COLOR_OFF);
134
135light:
136 - platform: monochromatic
137 name: "OLED Contrast2"
138 output: oled_bc
139 id: oled_light2
140
141output:
142 - platform: template
143 id: oled_bc
144 type: float
145 write_action:
146 then:
147 - lambda: id(my_display).set_contrast(state);