forked from lagerbeer/kegcop_home_assistant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.yaml
158 lines (135 loc) · 5.28 KB
/
template.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
- sensor:
- name: "keg 1 last pour oz"
unit_of_measurement: "oz"
state: >
{{ ((states('sensor.keg_1_pulses') | float ) /
(states('input_number.box1') | float)) | float|round(1) }}
- sensor:
- name: "keg 2 last pour oz"
unit_of_measurement: "oz"
state: >
{{ ((states('sensor.keg_2_pulses') | float ) /
(states('input_number.box2') | float)) | float|round(1) }}
- sensor:
- name: "keg 3 last pour oz"
unit_of_measurement: "oz"
state: >
{{ ((states('sensor.keg_3_pulses') | float ) /
(states('input_number.box3') | float)) | float|round(1) }}
- sensor:
- name: "keg 4 last pour oz"
unit_of_measurement: "oz"
state: >
{{ ((states('sensor.keg_4_pulses') | float) /
(states('input_number.box4') | float)) | float|round(1) }}
- sensor:
- name: "keg 5 last pour oz"
unit_of_measurement: "oz"
state: >
{{ ((states('sensor.keg_5_pulses') | float ) /
(states('input_number.box5') | float)) | float|round(1) }}
- sensor:
- name: "keg 6 last pour oz"
unit_of_measurement: "oz"
state: >
{{ ((states('sensor.keg_6_pulses') | float) /
(states('input_number.box6') | float)) | float|round(1) }}
#Keg remaining gallons
- sensor:
- name: "keg 1 Gallons"
unit_of_measurement: "Gal"
state: >
{{ (((states('sensor.keg_1_totals') | float / (states('input_number.box1')) | float / 128 ) |float|round(2))+0.0 ) }}
- sensor:
- name: "keg 2 Gallons"
unit_of_measurement: "Gal"
state: >
{{ (((states('sensor.keg_2_totals') | float / (states('input_number.box2')) | float / 128 ) |float|round(2))+0.0 ) }}
- sensor:
- name: "keg 3 Gallons"
unit_of_measurement: "Gal"
state: >
{{ (((states('sensor.keg_3_totals') | float / (states('input_number.box3')) | float / 128 ) |float|round(2))+0.0 ) }}
- sensor:
- name: "keg 4 Gallons"
unit_of_measurement: "Gal"
state: >
{{ (((states('sensor.keg_4_totals') | float / (states('input_number.box4')) | float / 128 ) |float|round(2))+0.0 ) }}
- sensor:
- name: "keg 5 Gallons"
unit_of_measurement: "Gal"
state: >
{{ (((states('sensor.keg_5_totals') | float / (states('input_number.box5')) | float / 128 ) |float|round(2))+0.0 ) }}
- sensor:
- name: "keg 6 Gallons"
unit_of_measurement: "Gal"
state: >
{{ (((states('sensor.keg_6_totals') | float / (states('input_number.box6')) | float / 128 ) |float|round(2))+0.0 ) }}
#keg gallons remaining
- sensor:
- name: "keg 1 remaining"
unit_of_measurement: "Gal"
state: >
{{ (states('input_number.keg_1_size') | float - states('sensor.keg_1_Gallons')| float )|float|round(2) }}
- sensor:
- name: "keg 2 remaining"
unit_of_measurement: "Gal"
state: >
{{ (states('input_number.keg_2_size') | float - states('sensor.keg_2_Gallons')| float )|float|round(2) }}
- sensor:
- name: "keg 3 remaining"
unit_of_measurement: "Gal"
state: >
{{ (states('input_number.keg_3_size') | float - states('sensor.keg_3_Gallons')| float )|float|round(2) }}
- sensor:
- name: "keg 4 remaining"
unit_of_measurement: "Gal"
state: >
{{ (states('input_number.keg_4_size') | float - states('sensor.keg_4_Gallons')| float )|float|round(2) }}
- sensor:
- name: "keg 5 remaining"
unit_of_measurement: "Gal"
state: >
{{ (states('input_number.keg_5_size') | float - states('sensor.keg_5_Gallons')| float )|float|round(2) }}
- sensor:
- name: "keg 6 remaining"
unit_of_measurement: "Gal"
state: >
{{ (states('input_number.keg_6_size') | float - states('sensor.keg_6_Gallons')| float )|float|round(2) }}
#keg percentate remaining
- sensor:
- name: "keg 1 percent"
unit_of_measurement: "%"
state: >
{{ (((states('sensor.keg_1_Gallons') | float(0) ) /
(states('input_number.keg_1_size') | float(0))) | float(0) *-100) | float|round(2) + 100 }}
- sensor:
- name: "keg 2 percent"
unit_of_measurement: "%"
state: >
{{ (((states('sensor.keg_2_Gallons') | float(0) ) /
(states('input_number.keg_2_size') | float(0))) | float(0) *-100) | float|round(2) + 100 }}
- sensor:
- name: "keg 3 percent"
unit_of_measurement: "%"
state: >
{{ (((states('sensor.keg_3_Gallons') | float(0) ) /
(states('input_number.keg_3_size') | float(0))) | float(0) *-100) | float|round(2) + 100 }}
- sensor:
- name: "keg 4 percent"
unit_of_measurement: "%"
state: >
{{ (((states('sensor.keg_4_Gallons') | float(0) ) /
(states('input_number.keg_4_size') | float(0))) | float(0) *-100) | float|round(2) + 100 }}
- sensor:
- name: "keg 5 percent"
unit_of_measurement: "%"
state: >
{{ (((states('sensor.keg_5_Gallons') | float(0) ) /
(states('input_number.keg_5_size') | float(0))) | float(0) *-100) | float|round(2) + 100 }}
- sensor:
- name: "keg 6 percent"
unit_of_measurement: "%"
state: >
{{ (((states('sensor.keg_6_Gallons') | float(0) ) /
(states('input_number.keg_6_size') | float(0))) | float(0) *-100) | float|round(2) + 100 }}