forked from GivEnergy/giv_tcp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgivtcp.yaml
236 lines (226 loc) · 11.1 KB
/
givtcp.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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
sensor:
- platform: rest
name: GivTCP
resource: http://192.168.2.10:6345/runAll #GivTCP docker container connection
method: GET
scan_interval: 20 # refresh
timeout: 15
value_template: 'Connected'
json_attributes: # define the entrys I want to retrieve
- Energy
- Power
- Invertor_Details
- Timeslots
- Control
- Battery_Details
template:
- sensor:
- name: "GivTCP Import Energy Total"
unit_of_measurement: "kWh"
device_class: energy
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Energy')['Total']['Import_Energy_Total_kWh'] }}"
- name: "GivTCP Export Energy Total"
unit_of_measurement: "kWh"
device_class: energy
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Energy')['Total']['Export_Energy_Total_kWh'] }}"
- name: "GivTCP Battery Throughput Total"
unit_of_measurement: "kWh"
device_class: energy
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Energy')['Total']['Battery_Throughput_Total_kWh'] }}"
- name: "GivTCP AC Charge Energy Total"
unit_of_measurement: "kWh"
device_class: energy
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Energy')['Total']['AC_Charge_Energy_Total_kWh'] }}"
- name: "GivTCP Invertor Energy Total"
unit_of_measurement: "kWh"
device_class: energy
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Energy')['Total']['Invertor_Energy_Total_kWh'] }}"
- name: "GivTCP PV Energy Total"
unit_of_measurement: "kWh"
device_class: energy
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Energy')['Total']['PV_Energy_Total_kWh'] }}"
- name: "GivTCP Load Energy Total"
unit_of_measurement: "kWh"
device_class: energy
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Energy')['Total']['Load_Energy_Total_kWh'] }}"
- name: "GivTCP Battery Charge Energy Total"
unit_of_measurement: "kWh"
device_class: energy
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Energy')['Total']['Battery_Charge_Energy_Total_kWh'] }}"
- name: "GivTCP Battery Discharge Energy Total"
unit_of_measurement: "kWh"
device_class: energy
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Energy')['Total']['Battery_Discharge_Energy_Total_kWh'] }}"
- name: "GivTCP Self Consumption Energy Total"
unit_of_measurement: "kWh"
device_class: energy
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Energy')['Total']['Self_Consumption_Energy_Total_kWh'] }}"
- name: "GivTCP Import Energy Today"
unit_of_measurement: "kWh"
device_class: energy
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Energy')['Today']['Import_Energy_Today_kWh'] }}"
- name: "GivTCP Export Energy Today"
unit_of_measurement: "kWh"
device_class: energy
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Energy')['Today']['Export_Energy_Today_kWh'] }}"
- name: "GivTCP Battery Throughput Today"
unit_of_measurement: "kWh"
device_class: energy
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Energy')['Today']['Battery_Throughput_Today_kWh'] }}"
- name: "GivTCP AC Charge Energy Today"
unit_of_measurement: "kWh"
device_class: energy
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Energy')['Today']['AC_Charge_Energy_Today_kWh'] }}"
- name: "GivTCP Invertor Energy Today"
unit_of_measurement: "kWh"
device_class: energy
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Energy')['Today']['Invertor_Energy_Today_kWh'] }}"
- name: "GivTCP PV Energy Today"
unit_of_measurement: "kWh"
device_class: energy
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Energy')['Today']['PV_Energy_Today_kWh'] }}"
- name: "GivTCP Load Energy Today"
unit_of_measurement: "kWh"
device_class: energy
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Energy')['Today']['Load_Energy_Today_kWh'] }}"
- name: "GivTCP Battery Charge Energy Today"
unit_of_measurement: "kWh"
device_class: energy
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Energy')['Today']['Battery_Charge_Energy_Today_kWh'] }}"
- name: "GivTCP Battery Discharge Energy Today"
unit_of_measurement: "kWh"
device_class: energy
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Energy')['Today']['Battery_Discharge_Energy_Today_kWh'] }}"
- name: "GivTCP Self Consumption Energy Today"
unit_of_measurement: "kWh"
device_class: energy
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Energy')['Today']['Self_Consumption_Energy_Today_kWh'] }}"
- name: "GivTCP PV Power"
unit_of_measurement: "W"
device_class: power
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Power')['Power']['PV_Power'] }}"
- name: "GivTCP Grid Power"
unit_of_measurement: "W"
device_class: power
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Power')['Power']['Grid_Power'] }}"
- name: "GivTCP Import Power"
unit_of_measurement: "W"
device_class: power
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Power')['Power']['Import_Power'] }}"
- name: "GivTCP Export Power"
unit_of_measurement: "W"
device_class: power
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Power')['Power']['Export_Power'] }}"
- name: "GivTCP EPS Power"
unit_of_measurement: "W"
device_class: power
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Power')['Power']['EPS_Power'] }}"
- name: "GivTCP Invertor Power"
unit_of_measurement: "W"
device_class: power
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Power')['Power']['Invertor_Power'] }}"
- name: "GivTCP Load Power"
unit_of_measurement: "W"
device_class: power
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Power')['Power']['Load_Power'] }}"
- name: "GivTCP Self Consumption Power"
unit_of_measurement: "W"
device_class: power
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Power')['Power']['Self_Consumption_Power'] }}"
- name: "GivTCP Battery Power"
unit_of_measurement: "W"
device_class: power
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Power')['Power']['Battery_Power'] }}"
- name: "GivTCP Battery Charge Power"
unit_of_measurement: "W"
device_class: power
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Power')['Power']['Charge_Power'] }}"
- name: "GivTCP Battery Discharge Power"
unit_of_measurement: "W"
device_class: power
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Power')['Power']['Discharge_Power'] }}"
- name: "GivTCP Battery SOC"
unit_of_measurement: "%"
device_class: battery
state_class: measurement
state: "{{ state_attr('sensor.givtcp','Power')['Power']['SOC'] }}"
- name: "GivTCP Control Mode"
state: "{{ state_attr('sensor.givtcp','Control')['Mode'] }}"
- name: "GivTCP Target Charge SOC"
state: "{{ state_attr('sensor.givtcp','Control')['Target_SOC'] }}"
unit_of_measurement: "%"
device_class: battery
state_class: measurement
- name: "GivTCP Battery Charge Rate"
state: "{{ state_attr('sensor.givtcp','Control')['Battery_Charge_Rate'] }}"
unit_of_measurement: "%"
- name: "GivTCP Battery Discharge Rate"
state: "{{ state_attr('sensor.givtcp','Control')['Battery_Discharge_Rate'] }}"
unit_of_measurement: "%"
- name: "GivTCP Invertor Temperature"
state: "{{ state_attr('sensor.givtcp','Invertor_Details')['Invertor_Temperature'] }}"
device_class: temperature
unit_of_measurement: "°C"
- name: "GivTCP Charge Slot 1 Start"
device_class: timestamp
state: "{{ strptime(state_attr('sensor.givtcp','Timeslots')['Charge_start_time_slot_1'],'%H:%M:%S').replace(year=now().year,month=now().month,day=now().day).timestamp()|timestamp_local() }}"
icon: "mdi:calendar-clock"
- name: "GivTCP Charge Slot 1 End"
device_class: timestamp
state: "{{ strptime(state_attr('sensor.givtcp','Timeslots')['Charge_end_time_slot_1'],'%H:%M:%S').replace(year=now().year,month=now().month,day=now().day).timestamp()|timestamp_local() }}"
icon: "mdi:calendar-clock"
- name: "GivTCP Charge Slot 2 Start"
device_class: timestamp
state: "{{ strptime(state_attr('sensor.givtcp','Timeslots')['Charge_start_time_slot_2'],'%H:%M:%S').replace(year=now().year,month=now().month,day=now().day).timestamp()|timestamp_local() }}"
icon: "mdi:calendar-clock"
- name: "GivTCP Charge Slot 2 End"
device_class: timestamp
state: "{{ strptime(state_attr('sensor.givtcp','Timeslots')['Charge_end_time_slot_2'],'%H:%M:%S').replace(year=now().year,month=now().month,day=now().day).timestamp()|timestamp_local() }}"
icon: "mdi:calendar-clock"
- name: "GivTCP Discharge Slot 1 Start"
device_class: timestamp
state: "{{ strptime(state_attr('sensor.givtcp','Timeslots')['Discharge_start_time_slot_1'],'%H:%M:%S').replace(year=now().year,month=now().month,day=now().day).timestamp()|timestamp_local() }}"
icon: "mdi:calendar-clock"
- name: "GivTCP Discharge Slot 1 End"
device_class: timestamp
state: "{{ strptime(state_attr('sensor.givtcp','Timeslots')['Discharge_end_time_slot_1'],'%H:%M:%S').replace(year=now().year,month=now().month,day=now().day).timestamp()|timestamp_local() }}"
icon: "mdi:calendar-clock"
- name: "GivTCP Discharge Slot 2 Start"
device_class: timestamp
state: "{{ strptime(state_attr('sensor.givtcp','Timeslots')['Discharge_start_time_slot_2'],'%H:%M:%S').replace(year=now().year,month=now().month,day=now().day).timestamp()|timestamp_local() }}"
icon: "mdi:calendar-clock"
- name: "GivTCP Discharge Slot 2 End"
device_class: timestamp
state: "{{ strptime(state_attr('sensor.givtcp','Timeslots')['Discharge_end_time_slot_2'],'%H:%M:%S').replace(year=now().year,month=now().month,day=now().day).timestamp()|timestamp_local() }}"
icon: "mdi:calendar-clock"