-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgivenergy_dfs_2023.yaml
149 lines (149 loc) · 4.4 KB
/
givenergy_dfs_2023.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
blueprint:
name: GivEnergy and DFS Exporter 2023-2024
description: Sets a forced export on a GivEnergy inverter for up to two hours at a given power output. Create one automation per inverter. This update 2023-12-06 (v05).
domain: automation
input:
dfs_start_time:
name: DFS Start Time
description: Create a time-only helper to contain the start time of the DFS Session
selector:
entity:
domain:
- input_datetime
multiple: false
dfs_end_time:
name: DFS End Time
description: Create a time-only helper to contain the end time of the DFS Session
selector:
entity:
domain:
- input_datetime
multiple: false
inverter_soc:
name: Battery Inverter SOC Entity
description: From GivTCP - sensor.givtcp_xxxxxxxxxx_soc
selector:
entity:
domain:
- sensor
device_class:
- battery
multiple: false
discharge_power:
name: Battery Discharge Power
description: At what speed do you wish to discharge your battery? Don't forget to add on a bit for your normal background usage.
default: 3000
selector:
number:
min: 1000.0
max: 6000.0
step: 100.0
unit_of_measurement: watts
mode: slider
delay_offset_seconds:
name: Delay Offset in Seconds
description: Wait this many seconds after the DFS start and end times to run this automation. Avoids clashing with other automations.
default: 0
selector:
number:
min: 0.0
max: 120.0
step: 5.0
unit_of_measurement: seconds
mode: slider
variables:
dfs_start_time: !input dfs_start_time
dfs_end_time: !input dfs_end_time
discharge_power: !input discharge_power
inverter_soc: !input inverter_soc
inverter_prefix: '{{ inverter_soc[6:-4] }}'
inverter_force_export: '{{ ''select'' + inverter_prefix +''_force_export'' }}'
inverter_mode: '{{ ''select'' + inverter_prefix +''_mode'' }}'
inverter_discharge_rate: '{{ ''number'' + inverter_prefix +''_battery_discharge_rate'' }}'
inverter_max_rate: '{{ ''sensor'' + inverter_prefix +''_invertor_max_bat_rate'' }}'
delay_offset_seconds: !input delay_offset_seconds
enable_discharge: '{{ ''switch'' + inverter_prefix +''_enable_discharge'' }}'
trigger_variables:
trigger_dfs_start_time: !input dfs_start_time
trigger_dfs_end_time: !input dfs_end_time
trigger:
- platform: time
at: !input dfs_start_time
id: start
- platform: time
at: !input dfs_end_time
id: finish
condition: []
action:
- choose:
- conditions:
- condition: trigger
id:
- start
sequence:
- delay:
seconds: '{{ delay_offset_seconds }}'
- service: select.select_option
data:
option: '120'
target:
entity_id: '{{ inverter_force_export }}'
alias: Force Export the Inverter for 120 minutes
- delay:
hours: 0
minutes: 0
seconds: 20
milliseconds: 0
- service: number.set_value
data:
value: '{{ discharge_power }}'
target:
entity_id: '{{ inverter_discharge_rate }}'
alias: Limit Export Rate
alias: Start the export
- conditions:
- condition: trigger
id:
- finish
sequence:
- delay:
seconds: '{{ delay_offset_seconds }}'
- service: select.select_option
data:
option: Cancel
target:
entity_id: '{{ inverter_force_export }}'
alias: Cancel Export
- delay:
hours: 0
minutes: 0
seconds: 20
milliseconds: 0
- service: number.set_value
data:
value: '{{ inverter_max_rate }}'
target:
entity_id: '{{ inverter_discharge_rate }}'
alias: Reset Export Rate to maximum
- delay:
hours: 0
minutes: 0
seconds: 20
milliseconds: 0
- service: select.select_option
data:
option: Eco
target:
entity_id: '{{ inverter_mode }}'
alias: Reset mode to Eco
- delay:
hours: 0
minutes: 0
seconds: 20
milliseconds: 0
- service: switch.turn_on
data: {}
target:
entity_id: '{{ enable_discharge }}'
alias: Stop the export
mode: single