-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEspHome code
156 lines (107 loc) · 2.82 KB
/
EspHome code
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
substitutions:
tank_b: sensor.sensor1_2
tank_t: sensor.sensor2
vann_inn: sensor.sensor1
vann_ut: sensor.sensor4
watt: sensor.heavy_duty_switch_electric_consumption_w
state: sensor.vvb_state
esphome:
name: skjerm
esp8266:
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
font:
- file: 'arial.ttf' #'slkscr.ttf'
id: font1
size: 14
ota:
password: "b1587535e576adbe9afb5f933145f06a"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "skjerm Fallback Hotspot"
password: "uOWrMMnT5v9l"
captive_portal:
dallas:
- pin: GPIO2
id: sensor1
- pin: GPIO12
id: sensor2
- pin: GPIO13
id: sensor3
- pin: GPIO3
id: sensor4
sensor:
- platform: dallas
address: 0xFB19985F1E64FF28
name: "sensor1"
dallas_id: sensor1
- platform: dallas
address: 0x613C01F09672C628
name: "sensor2"
dallas_id: sensor2
- platform: dallas
address: 0xDF3C01F0966BF228
name: "sensor3"
dallas_id: sensor3
- platform: dallas
address: 0x2FBF4B5E1E64FF28
name: "sensor4"
dallas_id: sensor4
- platform: homeassistant
id: tank_b
entity_id: sensor.sensor1_2
internal: true
- platform: homeassistant
id: tank_t
entity_id: sensor.sensor2
internal: true
- platform: homeassistant
id: vann_inn
entity_id: sensor.sensor1
internal: true
- platform: homeassistant
id: vann_ut
entity_id: sensor.sensor4
internal: true
- platform: homeassistant
id: watt
entity_id: sensor.heavy_duty_switch_electric_consumption_w
internal: true
binary_sensor:
- platform: homeassistant
id: state
entity_id: switch.heavy_duty_switch
internal: true
spi:
clk_pin: GPIO16
mosi_pin: GPIO5
display:
- platform: ssd1306_spi
model: "SSD1306 128x64"
cs_pin: GPIO4
dc_pin: GPIO0
reset_pin: GPIO14
lambda: |-
if (id(tank_t).has_state()) {
it.printf(75, 35, id(font1) , "T %7.1f°", id(tank_t).state);
}
if (id(tank_b).has_state()) {
it.printf(75,50, id(font1) , "B %7.1f°", id(tank_b).state);
}
if (id(watt).has_state()) {
it.printf(62, 15, id(font1), "%7.1fW", id(watt).state);
}
if (id(vann_inn).has_state()) {
it.printf(5, 25, id(font1) , "Inn%7.1f°", id(vann_inn).state);
}
if (id(vann_ut).has_state()) {
it.printf(5,45, id(font1) , "Ut %7.1f°", id(vann_ut).state);
}
it.printf(90, 0, id(font1), "%s", id(state).state ? "ON" : "OFF");
it.print(10, 0, id(font1), "VVB Tank");