-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathepever.yaml
288 lines (260 loc) · 6.82 KB
/
epever.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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
esphome:
name: epever
friendly_name: epever
esp8266:
board: d1_mini
# Enable logging
logger:
baud_rate: 0
uart:
id: mod_bus
tx_pin: TX
rx_pin: RX
baud_rate: 115200
stop_bits: 1
modbus:
flow_control_pin: D1
id: modbus1
send_wait_time: 200ms
modbus_controller:
- id: epever
## the Modbus device addr
address: 0x1
modbus_id: modbus1
setup_priority: -10
command_throttle: 200ms
update_interval: 30s
text_sensor:
- platform: modbus_controller
modbus_controller_id: epever
name: "Charging Mode"
id: chg_mode
address: 0x3201
register_type: read
raw_encode: HEXBYTES
lambda: |-
uint16_t orig_var, local_var = modbus_controller::word_from_hex_str(x, 0);
//ESP_LOGI("mprowe", "The value of local_var is: %d", local_var);
orig_var = local_var;
local_var = local_var >> 2;
//ESP_LOGI("mprowe", "local_var right shift 2 is: %d", local_var);
local_var = local_var & 0x03;
//ESP_LOGI("mprowe", "local_var & 0x03 is: %d", local_var);
switch (local_var) {
case 0: return std::string("Not Charging");
case 1: return std::string("Float Charging");
case 2: return std::string("Boost Charging");
case 3: return std::string("Equalizing");
default: return std::string("Unknown");
}
- platform: modbus_controller
modbus_controller_id: epever
name: "Battery Status"
id: battery_status
address: 0x3200
register_type: read
raw_encode: HEXBYTES
lambda: |-
uint16_t local_var = modbus_controller::word_from_hex_str(x, 0);
//ESP_LOGI("mprowe", "The value of local_var is: %d", local_var);
local_var = local_var >> 2;
//ESP_LOGI("mprowe", "local_var right shift 2 is: %d", local_var);
local_var = local_var & 0x03;
//ESP_LOGI("mprowe", "local_var & 0x03 is: %d", local_var);
switch (local_var) {
case 1: return std::string("Overvolt");
case 0: return std::string("Normal");
case 2: return std::string("Under Volt");
case 3: return std::string("Low Volt Disconnect");
case 4: return std::string("Fault");
default: return std::string("Unknown");
}
switch:
#- platform: modbus_controller
# modbus_controller_id: epever
# id: reset_to_fabric_default
# name: "Reset to Factory Default"
# register_type: coil
# address: 0x15
# bitmask: 1
- platform: modbus_controller
modbus_controller_id: epever
id: manual_control_load
register_type: coil
address: 2
name: "manual control the load"
bitmask: 1
sensor:
- platform: wifi_signal
name: "WiFi Signal"
update_interval: 60s
- platform: modbus_controller
modbus_controller_id: epever
id: generated_energy_today
name: "Generated energy today"
address: 0x330C
device_class: power
unit_of_measurement: "W"
register_type: read
value_type: U_WORD
accuracy_decimals: 1
#filters:
# - multiply: 0.01
- platform: modbus_controller
modbus_controller_id: epever
id: pv_input_voltage
name: "PV array input voltage"
address: 0x3100
device_class: voltage
unit_of_measurement: "V"
register_type: read
value_type: U_WORD
accuracy_decimals: 1
filters:
- multiply: 0.01
- platform: modbus_controller
modbus_controller_id: epever
id: pv_input_current
name: "PV array input current"
address: 0x3101
device_class: current
unit_of_measurement: "A"
register_type: read
value_type: U_WORD
accuracy_decimals: 2
filters:
- multiply: 0.01
- platform: modbus_controller
modbus_controller_id: epever
id: pv_input_power
name: "PV array input power"
address: 0x3102
device_class: power
unit_of_measurement: "W"
register_type: read
value_type: U_DWORD_R
accuracy_decimals: 1
filters:
- multiply: 0.01
- platform: modbus_controller
modbus_controller_id: epever
id: battery_voltage
name: "Battery voltage"
address: 0x3104
device_class: voltage
unit_of_measurement: "V"
register_type: read
value_type: U_WORD
accuracy_decimals: 1
filters:
- multiply: 0.01
- platform: modbus_controller
modbus_controller_id: epever
id: charging_current
name: "Charging current"
address: 0x3105
device_class: current
unit_of_measurement: "A"
register_type: read
value_type: U_WORD
accuracy_decimals: 1
filters:
- multiply: 0.01
- platform: modbus_controller
modbus_controller_id: epever
id: charging_power
name: "Charging power"
address: 0x3106
device_class: power
unit_of_measurement: "W"
register_type: read
value_type: U_DWORD_R
accuracy_decimals: 1
filters:
- multiply: 0.01
- platform: modbus_controller
modbus_controller_id: epever
id: load_voltage
name: "Load voltage"
address: 0x310C
device_class: voltage
unit_of_measurement: "V"
register_type: read
value_type: U_WORD
accuracy_decimals: 1
filters:
- multiply: 0.01
- platform: modbus_controller
modbus_controller_id: epever
id: load_current
name: "Load Current"
address: 0x310D
device_class: current
unit_of_measurement: "A"
register_type: read
value_type: U_WORD
accuracy_decimals: 2
filters:
- multiply: 0.01
- platform: modbus_controller
modbus_controller_id: epever
id: load_power
name: "Load power"
address: 0x310E
device_class: power
unit_of_measurement: "W"
register_type: read
value_type: U_DWORD_R
accuracy_decimals: 1
filters:
- multiply: 0.01
- platform: modbus_controller
modbus_controller_id: epever
id: battery_temperature
name: "Battery temperature"
address: 0x3110
device_class: temperature
unit_of_measurement: °C
register_type: read
value_type: S_WORD
accuracy_decimals: 1
filters:
- multiply: 0.01
- platform: modbus_controller
modbus_controller_id: epever
id: device_temperature
name: "Device temperature"
address: 0x3111
device_class: temperature
unit_of_measurement: °C
register_type: read
value_type: S_WORD
accuracy_decimals: 1
filters:
- multiply: 0.01
- platform: modbus_controller
modbus_controller_id: epever
id: battery_soc
name: "Battery SOC"
address: 0x311A
device_class: battery
unit_of_measurement: "%"
register_type: read
value_type: U_WORD
accuracy_decimals: 0
# Enable Home Assistant API
api:
encryption:
key: ""
ota:
password: "1876349ef83259523a36893c241d1ad2"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Epever Fallback Hotspot"
password: "69fYokgtS49H"
captive_portal:
web_server:
port: 80