-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathconfiguration.yaml
265 lines (252 loc) · 7.37 KB
/
configuration.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
# Loads default set of integrations. Do not remove.
default_config:
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
# Text to speech
tts:
- platform: google_translate
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
logger:
default: info
logs:
custom_components.solar_optimizer: debug
input_boolean:
fake_device_a:
name: "Equipement A (1000 W)"
icon: mdi:radiator
fake_device_b:
name: "Equipement B (500 W)"
icon: mdi:radiator
fake_device_c:
name: "Equipement C (800 W)"
icon: mdi:radiator
fake_device_d:
name: "Equipement D (2100 W)"
icon: mdi:radiator
fake_device_e:
name: "Equipement E (120 W)"
icon: mdi:radiator
fake_device_f:
name: "Equipement F (500W)"
icon: mdi:radiator
fake_device_g:
name: "Equipement G (1200 W)"
icon: mdi:radiator
fake_device_h:
name: "Equipement H (Tesla 0 - 3960 W)"
icon: mdi:car-electric
fake_device_i:
name: "Equipement I (20 W)"
icon: mdi:radiator
device_h_enable:
name: "Enable device H"
icon: mdi:check
switch:
- platform: template
switches:
fake_switch_1:
friendly_name: "Fake switch 1 (20 W)"
value_template: "{{ is_state('input_boolean.fake_device_i', 'on') }}"
turn_on:
service: input_boolean.turn_on
data:
entity_id: input_boolean.fake_device_i
turn_off:
service: input_boolean.turn_off
data:
entity_id: input_boolean.fake_device_i
input_number:
consommation_brut:
name: Puissance brut consommée
min: 0
max: 15000
step: 100
icon: mdi:flash
unit_of_measurement: W
mode: slider
consommation_net:
name: Puissance nette consommée
min: -5000
max: 15000
step: 100
icon: mdi:flash
unit_of_measurement: W
mode: slider
production_solaire:
name: Puissance solaire produite
min: 0
max: 4000
step: 100
icon: mdi:flash
unit_of_measurement: W
mode: slider
sell_cost:
name: Cout de revente d'un kWh (en centimes)
min: 0
max: 1
step: 0.01
icon: mdi:euro
unit_of_measurement: €
mode: box
buy_cost:
name: Cout d'achat d'un kWh (en centimes)
min: 0
max: 1
step: 0.01
icon: mdi:euro
unit_of_measurement: €
mode: box
sell_tax_percent:
name: Taxe sur la revente en %
min: 0
max: 100
step: 0.5
icon: mdi:percent
unit_of_measurement: '%'
mode: slider
tesla_amps:
name: Tesla Amps
min: 0
max: 32
icon: mdi:ev-station
unit_of_measurement: A
mode: slider
step: 1
battery_soc:
name: Battery SOC
min: 0
max: 100
icon: mdi:battery
unit_of_measurement: '%'
mode: slider
step: 1
template:
- trigger:
- platform: time_pattern
# This will update every night
seconds: "/2"
sensor:
- name: "Next availability Tesla (sec)"
state: "{{ (as_timestamp(state_attr('switch.solar_optimizer_equipement_h', 'next_date_available')) - as_timestamp(now())) | int(0) }}"
unit_of_measurement: "s"
state_class: measurement
- name: "Next availability Tesla Power (sec)"
state: "{{ (as_timestamp(state_attr('switch.solar_optimizer_equipement_h', 'next_date_available_power')) - as_timestamp(now())) | int(0) }}"
unit_of_measurement: "s"
state_class: measurement
solar_optimizer:
algorithm:
initial_temp: 1000
min_temp: 0.1
cooling_factor: 0.95
max_iteration_number: 1000
devices:
- name: "Equipement A"
entity_id: "input_boolean.fake_device_a"
power_max: 1000
check_usable_template: "{{ True }}"
duration_min: 0.3
action_mode: "service_call"
activation_service: "input_boolean/turn_on"
deactivation_service: "input_boolean/turn_off"
max_on_time_per_day_min: 10
min_on_time_per_day_min: 5
offpeak_time: "14:00"
- name: "Equipement B"
entity_id: "input_boolean.fake_device_b"
power_max: 500
check_usable_template: "{{ True }}"
duration_min: 0.6
action_mode: "service_call"
activation_service: "input_boolean/turn_on"
deactivation_service: "input_boolean/turn_off"
min_on_time_per_day_min: 15
offpeak_time: "13:50"
- name: "Equipement C"
entity_id: "input_boolean.fake_device_c"
power_max: 800
check_usable_template: "{{ True }}"
duration_min: 1
action_mode: "service_call"
activation_service: "input_boolean/turn_on"
deactivation_service: "input_boolean/turn_off"
- name: "Equipement D"
entity_id: "input_boolean.fake_device_d"
power_max: 2100
check_usable_template: "{{ True }}"
duration_min: 0.5
action_mode: "service_call"
activation_service: "input_boolean/turn_on"
deactivation_service: "input_boolean/turn_off"
- name: "Equipement E"
entity_id: "input_boolean.fake_device_e"
power_max: 120
check_usable_template: "{{ True }}"
duration_min: 2
action_mode: "service_call"
activation_service: "input_boolean/turn_on"
deactivation_service: "input_boolean/turn_off"
- name: "Equipement F"
entity_id: "input_boolean.fake_device_f"
power_max: 500
check_usable_template: "{{ True }}"
duration_min: 0.2
action_mode: "service_call"
activation_service: "input_boolean/turn_on"
deactivation_service: "input_boolean/turn_off"
battery_soc_threshold: 30
max_on_time_per_day_min: 50
- name: "Equipement G"
entity_id: "input_boolean.fake_device_g"
power_max: 1200
check_usable_template: "{{ True }}"
duration_min: 1.5
action_mode: "service_call"
activation_service: "input_boolean/turn_on"
deactivation_service: "input_boolean/turn_off"
battery_soc_threshold: 40
max_on_time_per_day_min: 30
- name: "Equipement H"
entity_id: "input_boolean.fake_device_h"
power_entity_id: "input_number.tesla_amps"
power_min: 660
power_max: 3960
power_step: 660
# check_active_template: "{{ not is_state('input_select.fake_tesla_1', '0 A') }}"
check_usable_template: "{{ is_state('input_boolean.device_h_enable', 'on') }}"
duration_min: 1
duration_stop_min: 0.1
duration_power_min: 0.1
action_mode: "service_call"
activation_service: "input_boolean/turn_on"
deactivation_service: "input_boolean/turn_off"
change_power_service: "input_number/set_value"
convert_power_divide_factor: 660
battery_soc_threshold: 50
max_on_time_per_day_min: 10
- name: "Equipement I"
entity_id: "switch.fake_switch_1"
power_max: 20
check_usable_template: "{{ True }}"
duration_min: 0.1
action_mode: "service_call"
activation_service: "switch/turn_on"
deactivation_service: "switch/turn_off"
battery_soc_threshold: 60
- name: "Equipement J"
entity_id: "switch.fake_switch_1"
power_max: 20
check_usable_template: "{{ True }}"
duration_min: 0.1
action_mode: "service_call"
activation_service: "switch/turn_on"
deactivation_service: "switch/turn_off"
battery_soc_threshold: 60
# If you need to debug uncommment the line below (doc: https://www.home-assistant.io/integrations/debugpy/)
debugpy:
start: true
wait: false
port: 5678