Enhance Huawei Solar config#4037
Conversation
## Huawei inverter setup with Predbat
This is a beta example configuration for using Predbat with a Huawei inverter and Huawei LUNA battery through the Home Assistant Huawei Solar integration.
It is intended as a practical starting point, not a finished universal configuration.
At the moment, this setup does not require any external Home Assistant automation for the basic Predbat charge, discharge, freeze or hold control. Predbat controls the Huawei inverter directly through the configured Huawei Solar service calls and charge/discharge power limit entities.
> **Beta note**
>
> This setup works in my own installation, but it has not yet been fully reviewed or tested across different Huawei inverter, battery and Home Assistant setups.
>
> Check all entity names, sign conventions, inverter limits, service calls and safety settings before using it.
## Included in this example
This example includes configuration for:
* Huawei inverter support with `inverter_type: "HU"`
* Huawei battery SOC and power sensors
* PV, grid and house load sensors
* Charge and discharge rate control
* Huawei forcible charge/discharge services
* Predbat freeze/hold support
* Direct Predbat control without external Home Assistant automations for basic battery control
* Open-Meteo PV forecast
* Nordpool-based import/export price sensors
* Optional EV charging support
* Optional Huawei LUNA battery charge/discharge curves
## Secrets required
Local values should be stored in `secrets.yaml`, not directly in `apps.yaml`.
Example:
```yaml
predbat_huawei_device_id: "YOUR_HUAWEI_DEVICE_ID_HERE"
predbat_home_latitude: YOUR_LATITUDE
predbat_home_longitude: YOUR_LONGITUDE
```
Do not commit your real `secrets.yaml` to a public repository.
## Huawei inverter operating mode
Before using Predbat, the Huawei inverter should normally be set to:
**Maximum self-consumption / Maximise self-consumption**
Predbat can then temporarily override charging, discharging, freeze and hold behaviour through Huawei Solar service calls and charge/discharge power limits.
Avoid using fixed time-of-use schedules in the Huawei app at the same time, unless you know exactly how they interact with Predbat.
## Important sensor conventions
This example assumes:
* Battery power is positive when charging
* Battery power is negative when discharging
* Grid power is positive when importing
* Grid power is negative when exporting
If your sensors use the opposite direction, adjust the relevant Predbat `_invert` settings.
## Open-Meteo PV forecast
The example uses Open-Meteo for PV forecasting:
```yaml
open_meteo_forecast:
- latitude: !secret predbat_home_latitude
longitude: !secret predbat_home_longitude
kwp: 9.5
declination: 18
azimuth: 47
```
Adjust `kwp`, `declination` and `azimuth` to match your own PV system.
The azimuth follows the normal Predbat convention:
* `0` = North
* `-90` = East
* `90` = West
* `-180` or `180` = South
## Notes
Adapt this example to your own Home Assistant entity names, battery size, inverter limits, price sensors and PV installation.
Use it carefully until it has been tested across more Huawei setups.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 741d7ea61c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| prefix: predbat | ||
| timezone: Europe/Stockholm |
There was a problem hiding this comment.
Restore the template safety flag
Because this is still a file under templates/, removing template: True means a user who copies the Huawei example into apps.yaml no longer hits Predbat's built-in template guard (update_pred exits when that arg is set). In that scenario Predbat can start planning and calling the Huawei services in this file before the user has finished replacing the hard-coded sensors, limits, and device secrets, which is exactly what the other inverter templates and install docs rely on the flag to prevent.
Useful? React with 👍 / 👎.
| notify_devices: | ||
| - mobile_app_iphone13pro |
There was a problem hiding this comment.
Comment out the personal notify target
With this uncommented, every user who copies the template inherits notify/mobile_app_iphone13pro because call_notify prefixes each notify_devices entry with notify/. Unless their Home Assistant instance has that exact mobile app notify service, Predbat notifications will call a non-existent service; the previous template left this example commented so users either got the default notify service or opted into their own device.
Useful? React with 👍 / 👎.
Polish Huawei Predbat example
Restore template: True in the Huawei Predbat template so users do not accidentally run the example configuration before replacing sensors, limits and secrets.
Huawei inverter setup with Predbat
This is a beta example configuration for using Predbat with a Huawei inverter and Huawei LUNA battery through the Home Assistant Huawei Solar integration.
It is intended as a practical starting point, not a finished universal configuration.
At the moment, this setup does not require any external Home Assistant automation for the basic Predbat charge, discharge, freeze or hold control. Predbat controls the Huawei inverter directly through the configured Huawei Solar service calls and charge/discharge power limit entities.
Included in this example
This example includes configuration for:
inverter_type: "HU"Secrets required
Local values should be stored in
secrets.yaml, not directly inapps.yaml.Example:
Do not commit your real
secrets.yamlto a public repository.Huawei inverter operating mode
Before using Predbat, the Huawei inverter should normally be set to:
Maximum self-consumption / Maximise self-consumption
Predbat can then temporarily override charging, discharging, freeze and hold behaviour through Huawei Solar service calls and charge/discharge power limits.
Avoid using fixed time-of-use schedules in the Huawei app at the same time, unless you know exactly how they interact with Predbat.
Important sensor conventions
This example assumes:
If your sensors use the opposite direction, adjust the relevant Predbat
_invertsettings.Open-Meteo PV forecast
The example uses Open-Meteo for PV forecasting:
Adjust
kwp,declinationandazimuthto match your own PV system.The azimuth follows the normal Predbat convention:
0= North-90= East90= West-180or180= SouthNotes
Adapt this example to your own Home Assistant entity names, battery size, inverter limits, price sensors and PV installation.
Use it carefully until it has been tested across more Huawei setups.