Add solar production source
energy_add_solar_sourceRegister a solar production sensor as a new Home Assistant Energy Dashboard source by appending it to current energy preferences and saving the update.
Instructions
Add a solar production source to the Energy Dashboard.
Reads the current preferences, appends a new {"type": "solar", ...}
entry to the energy_sources list, and saves it via WS
energy/save_prefs. Calling it twice with the same stat_energy_from
adds a second, duplicate source.
Use when: registering a solar production sensor as a new Energy
Dashboard source.
Not for: an existing source's export flow — use
energy_add_grid_return; for a full source-list replacement use
energy_save_energy_prefs.
Returns: {"status": "added", "stat_energy_from": ..., "result": ...}.
Errors: {"error": str(e), "stat_energy_from": ...} when either WS call
raises.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stat_energy_from | Yes | Statistic/entity ID of the solar production sensor to add, e.g. 'sensor.solar_production'. Discover candidates with `statistics_list_statistic_ids`. | |
| config_entry_solar_forecast | No | Optional config entry ID of a solar forecast integration (e.g. Forecast.Solar) to link to this source. Omit if no forecast should be linked. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||