Skip to content

Commit a2921c8

Browse files
Update apps-yaml.md (#1306)
* Update apps-yaml.md * [pre-commit.ci lite] apply automatic fixes * Update apps-yaml.md * Update apps-yaml.md --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
1 parent 43999fe commit a2921c8

File tree

1 file changed

+92
-12
lines changed

1 file changed

+92
-12
lines changed

docs/apps-yaml.md

Lines changed: 92 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,12 @@ will normally configure all timed charges or discharges to be at the inverter's
297297

298298
## Controlling the Inverter
299299

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
301306

302307
### REST Interface inverter control
303308

@@ -320,46 +325,121 @@ Do not set Self Run to too low a value (i.e. retrieve too often) as this may ove
320325
*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.
321326
This may improve reliability of the REST connection as it doesn't need to lookup the HA server IP address each time.
322327

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
327329

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
330331

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.
332333

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).
335335

336336
The **givtcp_rest** line should be commented out/deleted on anything but GivTCP REST mode.
337337

338338
- **charge_rate** - Battery charge rate entity in watts
339339
- **discharge_rate** - Battery discharge max rate entity in watts
340340
- **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)
341343
- **pv_power** - Current PV power in watts
342344
- **load_power** - Current load power in watts
343345
- **soc_kw** - Entity name of the battery SOC in kWh, should be the inverter one not an individual battery
344346
- **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
345348
- **reserve** - sensor name for the reserve setting in %
349+
- **inverter_reserve_max** - When set defines the maximum reserve setting in % (default is 100)
346350
- **inverter_mode** - Givenergy inverter mode control
347-
- **pause_mode** - Givenergy pause mode register (if present)
348-
- **inverter_time** - Inverter timestamp
351+
- **inverter_time** - Inverter timestamp, used to track the last update of the inverter data
349352
- **charge_start_time** - Battery charge start time entity
350353
- **charge_end_time** - Battery charge end time entity
351354
- **charge_limit** - Entity name for used to set the SOC target for the battery in percentage (AC charge target)
352355
- **scheduled_charge_enable** - Scheduled charge enable config
353356
- **scheduled_discharge_enable** - Scheduled discharge enable config
354357
- **discharge_start_time** - scheduled discharge slot_1 start time
355358
- **discharge_end_time** - scheduled discharge slot_1 end time
359+
- **pause_mode** - Givenergy pause mode register (if present)
356360
- **pause_start_time** - scheduled pause start time (only if supported by your inverter)
357361
- **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)
358363

359364
If you are using REST control the configuration items should still be kept as not all controls work with REST.
360365

361366
See section below on [creating the battery charge power curve](#workarounds).
362367

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+
363443
## Solcast Solar Forecast
364444

365445
As described in the [Predbat installation instructions](install.md#solcast-install), Predbat needs a solar forecast

0 commit comments

Comments
 (0)