-
Notifications
You must be signed in to change notification settings - Fork 0
/
wattwise.yaml
274 lines (268 loc) · 9.42 KB
/
wattwise.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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
input_boolean:
wattwise_battery_charging_from_grid:
name: WattWise Battery Charging from Grid
icon: mdi:battery-charging
wattwise_battery_discharging_enabled:
name: WattWise Battery Discharging Enabled
icon: mdi:battery-minus
wattwise_manual_optimization:
name: WattWise Manual Optimization Trigger
icon: mdi:play
automation:
- alias: Trigger WattWise Manual Optimization
description: Fires MANUAL_BATTERY_OPTIMIZATION event when turned on
triggers:
- entity_id: input_boolean.wattwise_manual_optimization
to: "on"
trigger: state
conditions: []
actions:
- event: MANUAL_BATTERY_OPTIMIZATION
- target:
entity_id: input_boolean.wattwise_manual_optimization
action: input_boolean.turn_off
data: {}
mode: single
sensor:
- platform: rest
unique_id: wattwise_tibber_prices
name: Wattwise Tibber Prices
resource: https://api.tibber.com/v1-beta/gql
method: POST
payload: '{ "query": "{ viewer { homes { currentSubscription { status priceInfo { current { total level } today { total level } tomorrow { total level } } } } } }" }'
json_attributes_path: "$.data.viewer.homes[0].currentSubscription.priceInfo"
json_attributes:
- today
- tomorrow
value_template: "{{ value_json.data.viewer.homes[0].currentSubscription.priceInfo.current.total | float }}"
scan_interval: 30
headers:
Authorization: !secret tibber_token
Content-Type: application/json
User-Agent: REST
unit_of_measurement: EUR/kWh
template:
- sensor:
- name: "WattWise Battery Charge from Solar"
unique_id: "wattwise_battery_charge_from_solar"
unit_of_measurement: "kW"
state_class: "measurement"
device_class: "power"
icon: "mdi:solar-power"
state: "{{ 0 }}"
attributes:
forecast: "{{ [] }}"
- name: "WattWise Battery Charge from Grid"
unique_id: "wattwise_battery_charge_from_grid"
unit_of_measurement: "kW"
state_class: "measurement"
device_class: "power"
icon: "mdi:transmission-tower"
state: "{{ 0 }}"
attributes:
forecast: "{{ [] }}"
- name: "WattWise Battery Discharge"
unique_id: "wattwise_battery_discharge"
unit_of_measurement: "kW"
state_class: "measurement"
device_class: "power"
icon: "mdi:battery-outline"
state: "{{ 0 }}"
attributes:
forecast: "{{ [] }}"
- name: "WattWise Maximum Discharge Possible"
unique_id: "wattwise_maximum_discharge_possible"
unit_of_measurement: "kW"
state_class: "measurement"
device_class: "power"
icon: "mdi:battery-minus-outline"
state: "{{ 0 }}"
attributes:
forecast: "{{ [] }}"
- name: "WattWise Grid Export"
unique_id: "wattwise_grid_export"
unit_of_measurement: "kW"
state_class: "measurement"
device_class: "power"
icon: "mdi:export"
state: "{{ 0 }}"
attributes:
forecast: "{{ [] }}"
- name: "WattWise Grid Import"
unique_id: "wattwise_grid_import"
unit_of_measurement: "kW"
state_class: "measurement"
device_class: "power"
icon: "mdi:import"
state: "{{ 0 }}"
attributes:
forecast: "{{ [] }}"
- name: "WattWise State of Charge"
unique_id: "wattwise_state_of_charge"
unit_of_measurement: "kWh"
state_class: "measurement"
device_class: "battery"
icon: "mdi:battery"
state: "{{ 0 }}"
attributes:
forecast: "{{ [] }}"
- name: "WattWise State of Charge (%)"
unique_id: "wattwise_state_of_charge_percentage"
unit_of_measurement: "%"
state_class: "measurement"
device_class: "battery"
icon: "mdi:battery"
state: "{{ 0 }}"
attributes:
forecast: "{{ [] }}"
- name: "WattWise Consumption Forecast"
unique_id: "wattwise_consumption_forecast"
unit_of_measurement: "kW"
state_class: "measurement"
device_class: "power"
icon: "mdi:home"
state: "{{ 0 }}"
attributes:
forecast: "{{ [] }}"
- name: "WattWise Solar Production Forecast"
unique_id: "wattwise_solar_production_forecast"
unit_of_measurement: "kW"
state_class: "measurement"
device_class: "power"
icon: "mdi:weather-sunny"
state: "{{ 0 }}"
attributes:
forecast: "{{ [] }}"
- name: "WattWise Forecast Horizon"
unique_id: "wattwise_forecast_horizon"
unit_of_measurement: "h"
state_class: "measurement"
icon: "mdi:clock"
state: "{{ 0 }}"
- name: "WattWise Battery Charge Grid Session"
unique_id: "wattwise_battery_charge_grid_session"
unit_of_measurement: "kWh"
state_class: "total"
device_class: "energy"
icon: "mdi:battery-charging-high"
state: "{{ 0 }}"
attributes:
session_start: "{{ none }}"
session_duration: "{{ 0 }}"
- binary_sensor:
- name: "WattWise Battery Charging from Grid"
unique_id: "wattwise_battery_charging_from_grid"
device_class: power
icon: "mdi:battery-charging"
state: "{{ off }}"
attributes:
forecast: "{{ [] }}"
- name: "WattWise Battery Discharging Enabled"
unique_id: "wattwise_battery_discharging_enabled"
device_class: power
icon: "mdi:battery-minus"
state: "{{ off }}"
attributes:
forecast: "{{ [] }}"
- name: "WattWise Battery Full Charge Status"
unique_id: "wattwise_battery_full_charge_status"
icon: "mdi:battery-charging-100"
state: "{{ 0 }}"
attributes:
forecast: "{{ [] }}"
- name: "WattWise Within cheapest hour"
unique_id: "wattwise_within_cheapest_hour"
icon: "mdi:clock-time-one-outline"
state: "{{ off }}"
attributes:
forecast: "{{ [] }}"
- name: "WattWise Within cheapest 2 hours"
unique_id: "wattwise_within_cheapest_2_hours"
icon: "mdi:clock-time-two-outline"
state: "{{ off }}"
attributes:
forecast: "{{ [] }}"
- name: "WattWise Within cheapest 3 hours"
unique_id: "wattwise_within_cheapest_3_hours"
icon: "mdi:clock-time-three-outline"
state: "{{ off }}"
attributes:
forecast: "{{ [] }}"
- name: "WattWise Within cheapest 4 hours"
unique_id: "wattwise_within_cheapest_4_hours"
icon: "mdi:clock-time-four-outline"
state: "{{ off }}"
attributes:
forecast: "{{ [] }}"
- name: "WattWise Within cheapest 5 hours"
unique_id: "wattwise_within_cheapest_5_hours"
icon: "mdi:clock-time-five-outline"
state: "{{ off }}"
attributes:
forecast: "{{ [] }}"
- name: "WattWise Within cheapest 6 hours"
unique_id: "wattwise_within_cheapest_6_hours"
icon: "mdi:clock-time-six-outline"
state: "{{ off }}"
attributes:
forecast: "{{ [] }}"
- name: "WattWise Within cheapest 7 hours"
unique_id: "wattwise_within_cheapest_7_hours"
icon: "mdi:clock-time-seven-outline"
state: "{{ off }}"
attributes:
forecast: "{{ [] }}"
- name: "WattWise Within cheapest 8 hours"
unique_id: "wattwise_within_cheapest_8_hours"
icon: "mdi:clock-time-eight-outline"
state: "{{ off }}"
attributes:
forecast: "{{ [] }}"
- name: "WattWise Within most expensive hour"
unique_id: "wattwise_within_most_expensive_hour"
icon: "mdi:clock-time-one-outline"
state: "{{ off }}"
attributes:
forecast: "{{ [] }}"
- name: "WattWise Within most expensive 2 hours"
unique_id: "wattwise_within_most_expensive_2_hours"
icon: "mdi:clock-time-two-outline"
state: "{{ off }}"
attributes:
forecast: "{{ [] }}"
- name: "WattWise Within most expensive 3 hours"
unique_id: "wattwise_within_most_expensive_3_hours"
icon: "mdi:clock-time-three-outline"
state: "{{ off }}"
attributes:
forecast: "{{ [] }}"
- name: "WattWise Within most expensive 4 hours"
unique_id: "wattwise_within_most_expensive_4_hours"
icon: "mdi:clock-time-four-outline"
state: "{{ off }}"
attributes:
forecast: "{{ [] }}"
- name: "WattWise Within most expensive 5 hours"
unique_id: "wattwise_within_most_expensive_5_hours"
icon: "mdi:clock-time-five-outline"
state: "{{ off }}"
attributes:
forecast: "{{ [] }}"
- name: "WattWise Within most expensive 6 hours"
unique_id: "wattwise_within_most_expensive_6_hours"
icon: "mdi:clock-time-six-outline"
state: "{{ off }}"
attributes:
forecast: "{{ [] }}"
- name: "WattWise Within most expensive 7 hours"
unique_id: "wattwise_within_most_expensive_7_hours"
icon: "mdi:clock-time-seven-outline"
state: "{{ off }}"
attributes:
forecast: "{{ [] }}"
- name: "WattWise Within most expensive 8 hours"
unique_id: "wattwise_within_most_expensive_8_hours"
icon: "mdi:clock-time-eight-outline"
state: "{{ off }}"
attributes:
forecast: "{{ [] }}"