You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/apps-yaml.md
+92-12Lines changed: 92 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -297,7 +297,12 @@ will normally configure all timed charges or discharges to be at the inverter's
297
297
298
298
## Controlling the Inverter
299
299
300
-
There are two ways that Predbat can control GivTCP to control the inverter, either via REST API calls (preferred) or via the GivTCP inverter controls in Home Assistant.
300
+
There are a few different ways to control the inverter:
301
+
302
+
- Home Assistant entity controls (standard)
303
+
- GivTCP REST Interface (GE Inverters only)
304
+
- Service API
305
+
- MQTT API
301
306
302
307
### REST Interface inverter control
303
308
@@ -320,46 +325,121 @@ Do not set Self Run to too low a value (i.e. retrieve too often) as this may ove
320
325
*TIP:* You can replace *homeassistant.local* with the IP address of your Home Assistant server if you have it set to a fixed IP address.
321
326
This may improve reliability of the REST connection as it doesn't need to lookup the HA server IP address each time.
322
327
323
-
### Home Assistant GivTCP inverter control
324
-
325
-
Predbat can control GivEnergy inverters with GivTCP and REST mode, but if this is commented out then regular Home Assistant controls are used and can
326
-
interact with many different inverters.
328
+
### Home Assistant entity inverter control
327
329
328
-
The template `apps.yaml` for Giv Energy is pre-configured with regular expressions for the following configuration items
329
-
that should auto-discover the GivTCP controls for two inverters (givtcp and givtcp2), but may need changing if you have non-standard GivTCP entity names.
330
+
Predbat can control inverters by updating Home Assistant entities
330
331
331
-
If you only have a single inverter then the givtcp2 lines can be commented out if so desired.
332
+
The template `apps.yaml` for is pre-configured with regular expressions for many configuration items, but some of them may need updating to match your system.
332
333
333
-
The template `apps.yaml` is pre-configured with regular expressions for GivEnergy GivTCP controls, but will need to be changed for other inverters or
334
-
if you have multiple inverters.
334
+
If you only have a single inverter then the second inverter lines can be commented out if so desired or left in place (as they are ignored).
335
335
336
336
The **givtcp_rest** line should be commented out/deleted on anything but GivTCP REST mode.
337
337
338
338
- **charge_rate** - Battery charge rate entity in watts
339
339
- **discharge_rate** - Battery discharge max rate entity in watts
340
340
- **battery_power** - Current battery power in watts
341
+
- **battery_voltage** - Current battery voltage (only needed for inverters controlled via amps)
342
+
- **battery_rate_max** - Sets the maximum battery charge/discharge rate in watts (e.g. 2500)
341
343
- **pv_power** - Current PV power in watts
342
344
- **load_power** - Current load power in watts
343
345
- **soc_kw** - Entity name of the battery SOC in kWh, should be the inverter one not an individual battery
344
346
- **soc_max** - Entity name for the maximum charge level for the battery
347
+
- **battery_min_soc** - When set limits the target SOC% setting for charge and discharge to a minimum percentage value
345
348
- **reserve** - sensor name for the reserve setting in %
349
+
- **inverter_reserve_max** - When set defines the maximum reserve setting in % (default is 100)
346
350
- **inverter_mode** - Givenergy inverter mode control
- **pause_start_time** - scheduled pause start time (only if supported by your inverter)
357
361
- **pause_end_time** - scheduled pause start time (only if supported by your inverter)
362
+
- **inverter_battery_rate_min** - Defines the minimum discharge/charge rate of the battery in watts (default is 0)
358
363
359
364
If you are using REST control the configuration items should still be kept as not all controls work with REST.
360
365
361
366
See section below on [creating the battery charge power curve](#workarounds).
362
367
368
+
### Service API
369
+
370
+
Some inverters have the Service API enabled, this allows the configuration to call an arbitrary Home Assistant service to start/stop charging and discharging
371
+
372
+
- **charge_start_service** - Should be set to a service that is called when charging starts
373
+
- **charge_stop_service** - Should be set to a service that is called when charging stops and/or discharging stops
374
+
- **discharge_stop_service** - Should be set to a service that is called when discharging stops
375
+
376
+
Services that are not configuration will not be called.
377
+
378
+
Example service is below:
379
+
380
+
```yaml
381
+
charge_start_service:
382
+
service: switch.turn_off
383
+
entity_id: "switch.sunsynk_inverter_use_timer"
384
+
```
385
+
386
+
Note that **device_id** will be passed to the service automatically, it can be set in apps.yaml.
387
+
388
+
### MQTT API
389
+
390
+
Some Inverters are enabled with an MQTT API, in this case certain MQTT messages are send via the HA MQTT service.
391
+
392
+
The **mqtt_topic** in apps.yaml set in the root of the MQTT topic (shown as **topic** below).
393
+
394
+
#### Set reserve
395
+
396
+
Called when the reserve is changed
397
+
398
+
topic: **topic**/set/reserve
399
+
payload: reserve
400
+
401
+
#### Set target soc
402
+
403
+
Called when the target (charge %) SOC is set.
404
+
405
+
topic: **topic**/set/target_soc
406
+
payload: soc
407
+
408
+
#### Set charge rate
409
+
410
+
Called to change the charge rate in Watts
411
+
412
+
topic: **topic**/set/charge_rate
413
+
payload: charge_rate
414
+
415
+
#### Set discharge rate
416
+
417
+
Called to change the discharge rate in Watts
418
+
419
+
topic: **topic**/set/discharge_rate
420
+
payload: discharge_rate
421
+
422
+
#### Set charge
423
+
424
+
Called when a charge is started
425
+
426
+
topic: **topic**/set/charge
427
+
payload: charge_rate
428
+
429
+
#### Set discharge
430
+
431
+
Called when a forced export (discharge) is started
432
+
433
+
topic: **topic**/set/discharge
434
+
payload: discharge_rate
435
+
436
+
#### Set auto
437
+
438
+
Called when a charge/discharge is cancelled and the inverter goes back to home demand mode.
439
+
440
+
topic: **topic**/set/auto
441
+
payload: true
442
+
363
443
## Solcast Solar Forecast
364
444
365
445
As described in the [Predbat installation instructions](install.md#solcast-install), Predbat needs a solar forecast
0 commit comments