forked from gast777/Zendure-zenSDK-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapps.yaml
More file actions
234 lines (209 loc) · 10 KB
/
Copy pathapps.yaml
File metadata and controls
234 lines (209 loc) · 10 KB
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
## AppDaemon global config reminder:
## Put these settings in AppDaemon appdaemon.yaml, under the global appdaemon:
## section. Do not put production_mode or app_dir under zendure_proxy in apps.yaml.
##
## appdaemon:
## production_mode: true
## app_dir: /homeassistant/appdaemon/apps
##
## With production_mode: true, AppDaemon checks Python app files only on
## restart. This avoids AppDaemon reloading zendure_proxy while HACS is between
## deleting the old release files and writing the new release files.
## With app_dir: /homeassistant/appdaemon/apps, AppDaemon reads the same
## appdaemon/apps directory where HACS installs AppDaemon apps.
zendure_proxy:
module: zendure_proxy
class: ZendureProxy
# Required: IP addresses of your Zendure devices.
# The proxy supports up to 10 devices. Optional per-device watt caps keep a
# device below the hardware maximum reported by chargeMaxLimit and
# inverseMaxPower.
devices:
- ip: "192.168.x.x"
charge_max_watts:
discharge_max_watts:
- ip: "192.168.x.y"
charge_max_watts:
discharge_max_watts:
# Numbered keys also work, and can be used through ip_zendure_10.
# Do not use both forms for the same slot unless you want devices[N-1] to win.
# ip_zendure_1: "192.168.x.x"
# zendure_1_charge_max_watts: 600
# zendure_1_discharge_max_watts: 700
# HTTP server.
# The proxy listens on this port inside the AppDaemon container.
# Home Assistant Core can normally reach this port via the internal add-on DNS:
# http://a0d7b954-appdaemon:<server_port>/properties/report
# http://a0d7b954-appdaemon:<server_port>/properties/write
#
# Use these URLs when the caller can reach the AppDaemon container port directly:
# http://<HA-host>:<server_port>/properties/report
# http://<HA-host>:<server_port>/properties/write
#
# Custom Home Assistant automations can also use AppDaemon's own HTTP API:
# http://a0d7b954-appdaemon:5050/api/appdaemon/zendure_proxy_report
# http://a0d7b954-appdaemon:5050/api/appdaemon/zendure_proxy_write
#
# If the Gielz package appends /properties/report and /properties/write,
# this input_text.zendure_2400_ac_ip_adres value uses AppDaemon port 5050:
# a0d7b954-appdaemon:5050/api/appdaemon/zendure_proxy?path=
server_port: 8120
server_host: "0.0.0.0"
# Timeout in seconds for each HTTP request from AppDaemon to a Zendure device.
# This can be higher than Home Assistant's REST timeout because the proxy can
# answer HA from cache while the Zendure request continues internally.
zendure_request_timeout: 60
# Device HTTP connection behavior.
# true uses one GET session and one POST session per Zendure device, so one
# GET and one POST can run at the same time for the same device.
# false uses one shared GET/POST session per Zendure device.
# idle_connection_close_seconds closes idle sessions after 10 minutes.
separate_get_post_connections: true
idle_connection_close_seconds: 600
# GET cache and health behavior.
# Home Assistant receives a cached GET response after ha_get_response_timeout.
# The proxy keeps using cached device data for get_cache_max_age seconds.
# A recovered device must have successful outgoing GET requests for
# get_recovery_window seconds before it is used for power distribution again.
# A degraded device is excluded from POST commands.
# Power commands are distributed across healthy devices without subtracting
# the degraded device's lastKnownPower.
# degraded_power_hold_seconds controls when a degraded device becomes dead.
ha_get_response_timeout: 8
get_cache_max_age: 300
get_rate_limit_window: 1
get_recovery_window: 30
degraded_power_hold_seconds: 1800
# Mode-switching thresholds.
# Above single_mode_upperlimit_percent * effective capacity, switch to more devices.
# Below single_mode_lowerlimit_percent * effective capacity, switch to fewer devices.
single_mode_upperlimit_percent: 100
single_mode_lowerlimit_percent: 40
# Minimum SoC difference (%) before the active single-mode device is rotated.
single_mode_change_device_diff: 5
# Standby (deep sleep) for inactive devices.
# After this many seconds of inactivity the passive device receives smartMode=0.
single_mode_delayed_standby_timer: 300
single_mode_standby_charging_enable: true
single_mode_standby_discharging_enable: true
# Device-switch transition.
# Smooth ramp duration in seconds when the active single-mode device changes.
singlemode_transition_timer: 40
# SoC balancing.
# Exponent for nonlinear weighting: higher means more aggressive balancing.
balancing_factor: 5
# When one healthy Zendure is below minSoc or above 90% SoC, each active
# Zendure gets at least soc_boundary_min_device_power_watts.
# When the command is too low for that, execute_post(...) uses fewer Zendures.
# During charging, the highest-SoC Zendure can get 0 W until lower-SoC
# Zendures catch up. During discharging, the lowest-SoC Zendure can get 0 W.
# Extra power goes to Zendures that need to catch up in SoC.
# When a fresh GET shows that an active Zendure delivers less packInputPower or
# outputPackPower than the last command, execute_post(...) compensates on the
# next command with the other Zendures. The underdelivering Zendure keeps its
# calculated command share, so the Zendure can still catch up when temperature
# or an internal limit recovers.
# Exception: measured compensation only runs when every Zendure is above
# minSoc. When charging below minSoc and SoC differs by more than 1%, the
# lowest-SoC Zendure gets the command alone, without higher-SoC compensation.
# In the low-power range, execute_post(...) switches at 1% SoC difference.
soc_boundary_min_device_power_watts: 100
soc_boundary_low_power_change_diff: 1
# Dual-mode damper prevents switching around the single-mode threshold.
dualmode_damper_enable: false
dualmode_damper_timer: 120
dualmode_damper_amount: 200
# Special modes.
always_dual_mode: false
equal_mode: false
# Experimental reserve mode for short zero-on-the-meter charge/discharge
# oscillation. Default is false. Enable only after testing the normal proxy
# behavior first.
# Reserve mode is the power anti-pingpong mode. The proxy keeps one or more
# Zendures ready in the opposite direction with a small reserve power. Reserve mode can
# reduce relay switches and react faster to short import peaks, but reserve
# mode uses extra energy because multiple Zendures stay awake and
# intentionally work against each other.
anti_pingpong_enable: false
anti_pingpong_activation_mode: "threshold" # threshold or smart
anti_pingpong_window_seconds: 180
anti_pingpong_min_flips: 3
anti_pingpong_hold_seconds: 300
anti_pingpong_min_power_watts: 100
anti_pingpong_reserve_count: 1
# Commands below the hardware-dependent minimum are raised to 40 W for
# hardware up to 800 W and 80 W for hardware above 800 W.
anti_pingpong_reserve_power_watts: 40
anti_pingpong_reserve_soc_margin_percent: 5
anti_pingpong_mode_switch_delay_seconds: 30
anti_pingpong_mode_switch_dominance_window_seconds: 120
# Smart reserve mode economics.
# Leave anti_pingpong_grid_power_entity empty to autodiscover:
# 1. input_text.afwijkende_p1_sensor
# 2. sensor.homewizard_p1_vermogen
# The expected sign is +W import and -W return/export.
anti_pingpong_grid_power_entity: ""
anti_pingpong_grid_power_autodiscover: true
anti_pingpong_grid_power_import_positive: true
anti_pingpong_smart_window_seconds: 300
anti_pingpong_smart_sample_interval_seconds: 1
anti_pingpong_smart_evaluate_interval_seconds: 60
anti_pingpong_smart_response_time_seconds: 3
anti_pingpong_low_power_roundtrip_efficiency: 0.40
anti_pingpong_energy_price_per_kwh: 0.30
anti_pingpong_smart_disable_bad_minutes: 2
# Experimental relay saver mode for large drops to zero power. Default is
# false. When enabled, a Zendure that would drop from a high measured command
# to 0 W keeps the previous direction at relay_saver_min_power_watts for
# relay_saver_hold_seconds. Enable only after testing the normal proxy
# behavior first. Reserve mode payloads still have priority.
relay_saver_enable: false
relay_saver_min_drop_watts: 900
relay_saver_min_power_watts: 40
relay_saver_hold_seconds: 30
# Solar power fields.
solar_power_info: false
# Manual-mode power repeat.
# Re-applies the last power command on every GET cycle.
manual_mode_repeat: true
# Rotating file log.
# Leave log_file_path empty to write to:
# <appdaemon-config-dir>/logs/zendure_proxy.log
log_file_enabled: true
log_file_path: ""
log_file_max_bytes: 1000000
log_file_backup_count: 5
# AppDaemon UI log dashboard.
# Open this URL in the AppDaemon UI:
# http://a0d7b954-appdaemon:5050/app/zendure_proxy_logs
log_dashboard_enabled: true
log_dashboard_route: "zendure_proxy_logs"
log_dashboard_lines: 300
# Metrics dashboard and HA sensors.
# Open this URL in the AppDaemon UI:
# http://a0d7b954-appdaemon:5050/app/zendure_proxy_metrics
metrics_enabled: true
metrics_dashboard_enabled: true
metrics_dashboard_route: "zendure_proxy_metrics"
metrics_dashboard_refresh: 10
metrics_ha_sensors_enabled: true
metrics_ha_sensors_interval: 30
# Proxy response HA sensors.
# true publishes sensor.zendure_2_soc_limiet_status,
# sensor.zendure_2_serienummer, sensor.dual_mode_demper_status, and related
# proxy sensors through sensor.zendure_10_* directly from AppDaemon when no existing entity with the same
# entity_id exists.
proxy_ha_sensors_enabled: true
proxy_ha_sensors_skip_existing: true
proxy_ha_sensors_mqtt_discovery_enabled: true
proxy_ha_sensors_mqtt_discovery_prefix: "homeassistant"
proxy_ha_sensors_mqtt_state_prefix: "zendure_proxy"
proxy_ha_sensors_mqtt_retain: true
# Debug payload capture.
# false keeps full GET/POST payloads out of the rotating logfile.
debug_payload_capture_enabled: false
# Diagnostics dashboard.
# Open this URL in the AppDaemon UI:
# http://a0d7b954-appdaemon:5050/app/zendure_proxy_diagnostics
diagnostics_dashboard_enabled: true
diagnostics_dashboard_route: "zendure_proxy_diagnostics"