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
esphome:
name: raumklima-wohnzimmer
esp8266:
board: nodemcuv2
logger:
api:
ota:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: "raumklima-wohnzimmer"
password: "E7TE90zuyCxr"
captive_portal:
sensor:
- platform: dht
pin: D2
temperature:
name: "Wohnzimmer Temperatur"
id: "temp_wz"
filters:
- calibrate_linear:
- 0.0 -> 0.0
- 24.4 -> 21.7
humidity:
name: "Wohnzimmer Luftfeuchtigkeit"
id: "feuchte_wz"
update_interval: 10s
- platform: homeassistant
id: temp_aussen
entity_id: sensor.temp_aussen
time:
- platform: homeassistant
id: homeassistant_time
sun:
latitude: 52.3923°
longitude: 13.5170°
on_sunrise:
- then:
- light.turn_on:
id: oled_light2
on_sunset:
- then:
- light.turn_off:
id: oled_light2
font:
- file: 'arial.ttf'
id: font1
size: 20
glyphs:
['&', '@', '!', ',', '.', '?', '"', '%', '(', ')', '+', '-', '_', ':', '°', '0',
'1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E',
'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y', 'z','å', 'Ä', 'ä', 'Ö', 'ö', 'Ü', 'ü', 'ß', '/']
- file: 'arial.ttf'
id: font2
size: 12
glyphs:
['&', '@', '!', ',', '.', '?', '"', '%', '(', ')', '+', '-', '_', ':', '°', '0',
'1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E',
'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y', 'z','å', 'Ä', 'ä', 'Ö', 'ö', 'Ü', 'ü', 'ß', '/']
- file: 'arial.ttf'
id: font3
size: 16
glyphs:
['&', '@', '!', ',', '.', '?', '"', '%', '(', ')', '+', '-', '_', ':', '°', '0',
'1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E',
'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y', 'z','å', 'Ä', 'ä', 'Ö', 'ö', 'Ü', 'ü', 'ß', '/']
- file: 'arial.ttf'
id: font4
size: 18
glyphs:
['&', '@', '!', ',', '.', '?', '"', '%', '(', ')', '+', '-', '_', ':', '°', '0',
'1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E',
'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y', 'z','å', 'Ä', 'ä', 'Ö', 'ö', 'Ü', 'ü', 'ß', '/']
spi:
clk_pin: D5
mosi_pin: D7
display:
- platform: ssd1306_spi
model: "SSD1306 128x64"
id: my_display
cs_pin: D8
dc_pin: D6
reset_pin: D1
pages:
- id: page1
lambda: |-
it.printf(1, 0, id(font1), "%.1f°C", id(temp_wz).state);
it.printf(70, 0, id(font1), "%.1f%%", id(feuchte_wz).state);
it.printf(4, 22, id(font2), "Außentemperatur");
it.printf(1, 33, id(font3), "%.1f°C", id(temp_aussen).state);
it.strftime(56, 45, id(font4), "%X", id(homeassistant_time).now());
switch:
- platform: template
name: "Oled Backlights2"
id: oled_backlight2
assumed_state: true
optimistic: true
turn_on_action:
then:
- lambda: |-
id(my_display).turn_on();
id(my_display).fill(COLOR_ON);
turn_off_action:
then:
- lambda: |-
id(my_display).turn_off();
id(my_display).fill(COLOR_OFF);
light:
- platform: monochromatic
name: "OLED Contrast2"
output: oled_bc
id: oled_light2
output:
- platform: template
id: oled_bc
type: float
write_action:
then:
- lambda: id(my_display).set_contrast(state);