-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsensor.yaml
117 lines (111 loc) · 3.11 KB
/
sensor.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
text_sensor:
- platform: wifi_info
ip_address:
id: ipaddr
ssid:
id: wifissid
sensor:
- platform: wifi_signal
name: "RSSI"
update_interval: 10s
id: wifirssi
- platform: dallas
index: 0
name: "Pec"
id: "tpec"
dallas_id: pec_hub
- platform: dallas
index: 0
name: "Bojler"
id: "tbojler"
dallas_id: bojler_hub
- platform: rotary_encoder
id: rotacija
pin_a: GPIO27
pin_b: GPIO26
on_clockwise:
- lambda: |-
if(!id(nastavi)){
id(tft).show_next_page();
}else{
if (id(nastavi_pec)){
if (id(temperatura_pec) >= 71) {
id(temperatura_pec) = 30;
} else {
id(temperatura_pec) += 1;
}
}
if (id(nastavi_bojler)){
if (id(temperatura_bojler) >= 71) {
id(temperatura_bojler) = 30;
} else {
id(temperatura_bojler) += 1;
}
}
if (id(nastavi_histereza)){
if (id(histereza) >= 3) {
id(histereza) = -2.5;
} else {
id(histereza) += 0.5;
}
}
}
- component.update: tft
on_anticlockwise:
- lambda: |-
if(!id(nastavi)){
id(tft).show_prev_page();
}else{
if (id(nastavi_pec)){
if (id(temperatura_pec) <= 29) {
id(temperatura_pec) = 70;
} else {
id(temperatura_pec) -= 1;
}
}
if (id(nastavi_bojler)){
if (id(temperatura_bojler) <= 29) {
id(temperatura_bojler) = 70;
} else {
id(temperatura_bojler) -= 1;
}
}
if (id(nastavi_histereza)){
if (id(histereza) <= -3) {
id(histereza) = 2.5;
} else {
id(histereza) -= 0.5;
}
}
}
- component.update: tft
binary_sensor:
- platform: status
id: system_status
- platform: gpio
pin:
number: GPIO25
inverted: true
id: gumb
on_click:
- then:
- lambda: |-
if (id(on_pec)){
id(nastavi_pec) = !id(nastavi_pec);
id(nastavi_histereza) = false;
id(nastavi_bojler) = false;
id(nastavi) = !id(nastavi);
}
if (id(on_bojler)){
id(nastavi_bojler) = !id(nastavi_bojler);
id(nastavi_pec) = false;
id(nastavi_histereza) = false;
id(nastavi) = !id(nastavi);
}
if (id(on_histereza)){
id(nastavi_histereza) = !id(nastavi_histereza);
id(nastavi_pec) = false;
id(nastavi_bojler) = false;
id(nastavi) = !id(nastavi);
}
- component.update: tft