When configuring adapters that rely on Home Assistant entities (e.g., Forecast Providers, Energy Monitors, Miner Controllers), users currently have no way to verify whether the entered entity IDs are correct until the system actually tries to use them. This leads to a poor configuration experience where errors are only discovered at runtime.
Current Pain Points
-
No immediate feedback: After entering an entity ID, users must save the configuration, assign it to the entity, and wait for the system to attempt data retrieval before discovering if the entity is valid.
-
Silent misconfiguration: A typo in the entity ID (e.g., sensor.inverter_pwr instead of sensor.inverter_power) goes unnoticed until the adapter fails to retrieve data.
-
No way to cross-check: Users must manually switch between the Edge Mining UI and the Home Assistant dashboard to verify that the correct entity was selected and that it returns the expected values.
Proposed Changes
Add a "Test" / "Fetch Live Value" button next to each entity input field in the configuration form for:
- Forecast Providers
- Energy Monitors
- Miner Controllers
When clicked, the button should:
- Call the Home Assistant API using the entered entity ID.
- Display the live value returned by Home Assistant directly in the configuration UI.
- Allow the user to compare the displayed value with what they see in Home Assistant to confirm correctness.
Feedback Scenarios
| Scenario |
Feedback |
| Entity exists and returns data |
Show the current value (e.g., 245.3 W) with a success indicator |
| Entity exists but returns unexpected data |
Show the value so the user can evaluate if it's the right entity |
| Entity does not exist or is unreachable |
Show a clear error message (e.g., "Entity not found" or "Unable to connect to Home Assistant") |
Auto-fetch unit of measurement from Home Assistant
When the selected adapter type requires Home Assistant (e.g., "Home Assistant Api"), the configuration form currently asks the user to manually specify the unit of measurement for sensor entities (e.g., "Entity Production", "Entity Consumption", "Entity Power"). This is error-prone and redundant, since Home Assistant already exposes the unit_of_measurement attribute for each sensor entity.
Proposed behavior:
- Once the user enters a valid entity ID in a sensor field (e.g.,
sensor.inverter_production), the system should automatically query Home Assistant for that entity's unit_of_measurement attribute.
- The retrieved unit should be auto-populated in the corresponding unit field (e.g.,
W, kW, kWh), removing the need for the user to enter it manually.
- The auto-filled unit should still be editable, in case the user wants to override it.
- If the entity does not have a
unit_of_measurement attribute, leave the field empty and let the user fill it in manually.
This applies to all configuration forms where a Home Assistant entity is paired with a unit field, including Energy Monitors (see screenshot: "Entity Production", "Entity Consumption") and Miner Controllers ("Entity Power" / "Unit Power").
Visual Reference
- The "Test" button should be placed inline next to each entity input field within the configuration section, providing a non-intrusive way to validate the configuration in real time.
- The unit of measurement field should be auto-filled when a valid Home Assistant entity is entered, with a visual hint indicating it was fetched automatically (e.g., a small label or icon).
Acceptance Criteria
When configuring adapters that rely on Home Assistant entities (e.g., Forecast Providers, Energy Monitors, Miner Controllers), users currently have no way to verify whether the entered entity IDs are correct until the system actually tries to use them. This leads to a poor configuration experience where errors are only discovered at runtime.
Current Pain Points
No immediate feedback: After entering an entity ID, users must save the configuration, assign it to the entity, and wait for the system to attempt data retrieval before discovering if the entity is valid.
Silent misconfiguration: A typo in the entity ID (e.g.,
sensor.inverter_pwrinstead ofsensor.inverter_power) goes unnoticed until the adapter fails to retrieve data.No way to cross-check: Users must manually switch between the Edge Mining UI and the Home Assistant dashboard to verify that the correct entity was selected and that it returns the expected values.
Proposed Changes
Add a "Test" / "Fetch Live Value" button next to each entity input field in the configuration form for:
When clicked, the button should:
Feedback Scenarios
245.3 W) with a success indicatorAuto-fetch unit of measurement from Home Assistant
When the selected adapter type requires Home Assistant (e.g., "Home Assistant Api"), the configuration form currently asks the user to manually specify the unit of measurement for sensor entities (e.g., "Entity Production", "Entity Consumption", "Entity Power"). This is error-prone and redundant, since Home Assistant already exposes the
unit_of_measurementattribute for each sensor entity.Proposed behavior:
sensor.inverter_production), the system should automatically query Home Assistant for that entity'sunit_of_measurementattribute.W,kW,kWh), removing the need for the user to enter it manually.unit_of_measurementattribute, leave the field empty and let the user fill it in manually.This applies to all configuration forms where a Home Assistant entity is paired with a unit field, including Energy Monitors (see screenshot: "Entity Production", "Entity Consumption") and Miner Controllers ("Entity Power" / "Unit Power").
Visual Reference
Acceptance Criteria
unit_of_measurementfrom Home Assistant.unit_of_measurementattribute, the unit field is left empty for manual input.