Modbus is the protocol that Home Assistant and Energy Manager will use to access your inverter. It is important that this is configured correctly. Since Modbus is started very early in the Home Assistant startup process, it must obtain some settings from the /config/secrets.yaml file, and not from other entities within Home Assistant.





Note - You don't need to actually press save; the file is updated the moment you edit it, but you will need to restart Home Assistant for the settings to take effect.
If you are using an AlphaESS inverter, you should also update the modbus_slave from 1 to 85.
If you are using a GoodWe EH/ET/ESA inverter, you should also update the modbus_slave from 1 to 247.
For the Modbus integration to start working, you must restart Home Assistant. Please do that before continuing with your configuration. The recommendation is to perform this through Developer Tools > Check Configuration > Restart so you can see if there are any errors that may prevent Home Assistant from restarting.
The following modbus warnings are ok if you have not rebooted your Home Assistant since you updated the secrets.yaml file. The modifications to your secrets.yaml file have not been loaded yet, so modbus will issue warnings.

If you have multiple PV sources, or you are using an A/C coupled system that the solar is taken from another inverter that isn't directly part of the battery system you have, you may need to configure Home Assistant to obtain the PV generation values from an extra source.
1) Install the appropriate non-Energy Manager integration (never install a 3rd-party integration for your main device, except for GoodWe, but you will need to for additional sources).
2) Find the appropriate entity that displays the current PV generation (in Watts) for your additional PV sources. Energy Manager will support up to three additional sources.
3) Paste the following content into your /config/template.yaml file (note, this is NOT the Energy Manager em_templates.yaml fiile). What you place in /config/template.yaml will be retained over EM updates.
- name: "Additional PV Power"
unique_id: em_additional_pv_power_total
unit_of_measurement: W
device_class: power
state_class: measurement
state: >
{% set p1 = states('sensor.SECONDARY_PV_POWER_1') | float(0) %}
{% set p2 = states('sensor.SECONDARY_PV_POWER_2') | float(0) %}
{% set p3 = states('sensor.SECONDARY_PV_POWER_3') | float(0) %}
{{ (p1 + p2 + p3) | round(0) }}
Important: Make sure that the indents are identical to above, so the "- name:" of the first line contains exactly 4 spaces.
4) Replace sensor.SECONDARY_PV_POWER_1 with name of the additional PV generation sensor. Keep everything else in the line the same.
5) Repeat up to two more times for sensor.SECONDARY_PV_POWER_2 and 3, if needed. If you don't have more than one additional PV source, just leave the additional lines exactly how they are. Don't delete them, don't change them.
6) Remove the [] from line 4 of the original configuration.ysml file (not shown above) i.e., the line should read - sensor: without the []
7) Restart Home Assistant
8) Check your PV generation to confirm that the additional sources are now recognised and added to any other existing PV generation total.