When adding a Forecast Provider of type "Home Assistant Api", the configuration form marks entity fields as optional. However, if only some of these fields are filled in while others are left empty, the adapter fails to initialize at runtime with an error that is only visible in the core service logs — not in the UI.
Current Behavior
- User creates a Forecast Provider with adapter type "Home Assistant Api".
- Some entity fields are filled in, while other "optional" fields are left empty.
- The form submits successfully without any validation error.
- At runtime, the adapter fails to initialize with the following error in the
core log:
edge-mining-1 | 2026-04-02 12:00:28 | ERROR | Failed to initialize adapter 'Forecast Solar ARAN HA' (Type: ForecastProviderAdapter.HOME_ASSISTANT_API) using factory: Entity ID for actual solar power forecast is required.
- The user has no feedback in the UI that the Forecast Provider is misconfigured.
Current Pain Points
-
Misleading "optional" labels: The fields are presented as optional in the form, but in practice they are conditionally required — leaving some empty causes a runtime failure.
-
No validation at submission time: The form does not validate field dependencies before saving, allowing an invalid configuration to be persisted.
-
Error only visible in logs: The user must inspect the core service logs to discover the misconfiguration. There is no feedback in the UI (e.g., a status indicator or alert on the Forecast Provider entity).
Proposed Changes
-
Clarify field optionality: Review and update the entity fields for the Home Assistant Api forecast provider. Fields that are actually required for the adapter to function should be marked as required, not optional. If certain fields are truly optional (i.e., the adapter can work without them), this should be clearly documented in the helper text.
-
Add form-level validation: Implement validation logic that checks field dependencies before saving. If a combination of filled/empty fields would result in an invalid configuration, show a clear validation error in the form at submission time.
-
Surface runtime adapter errors in the UI: When an adapter fails to initialize, the error status should be visible on the entity's detail page or in a status indicator (e.g., a badge or warning icon), so the user does not need to check logs manually.
Acceptance Criteria
When adding a Forecast Provider of type "Home Assistant Api", the configuration form marks entity fields as optional. However, if only some of these fields are filled in while others are left empty, the adapter fails to initialize at runtime with an error that is only visible in the
coreservice logs — not in the UI.Current Behavior
corelog:Current Pain Points
Misleading "optional" labels: The fields are presented as optional in the form, but in practice they are conditionally required — leaving some empty causes a runtime failure.
No validation at submission time: The form does not validate field dependencies before saving, allowing an invalid configuration to be persisted.
Error only visible in logs: The user must inspect the
coreservice logs to discover the misconfiguration. There is no feedback in the UI (e.g., a status indicator or alert on the Forecast Provider entity).Proposed Changes
Clarify field optionality: Review and update the entity fields for the Home Assistant Api forecast provider. Fields that are actually required for the adapter to function should be marked as required, not optional. If certain fields are truly optional (i.e., the adapter can work without them), this should be clearly documented in the helper text.
Add form-level validation: Implement validation logic that checks field dependencies before saving. If a combination of filled/empty fields would result in an invalid configuration, show a clear validation error in the form at submission time.
Surface runtime adapter errors in the UI: When an adapter fails to initialize, the error status should be visible on the entity's detail page or in a status indicator (e.g., a badge or warning icon), so the user does not need to check logs manually.
Acceptance Criteria