Improve Min/Max (Sum) Helper: Universal unit conversion and configurable output settings

Summary

The Min/Max (Sum) helper currently lacks the ability to handle different scales of the same physical dimension (e.g., mixing Wh/kWh, or g/kg) and offers no way to define the output unit or precision directly in the UI.

The Problem

Currently, the Min/Max helper is very strict. If a user tries to combine entities that share the same device_class but use different scales/units, the helper fails.

  • Example: Mixing a sensor providing Wh with one providing kWh leads to an ERR state or Unknown.
  • Example: Combining weight sensors in g and kg results in a calculation error.

Users are currently forced to create “Template Sensors” for every single source just to align units before they can use the helper. This adds significant overhead and complexity (“Bastelei”) for a task that the system could handle natively.

Proposed Feature
I propose making the Min/Max helper “Unit-Aware”:

  1. Automatic Unit Scaling: If all entities in a group share the same device_class, the helper should automatically convert them to a common scale (preferably the unit of the first entity) instead of failing.
  2. Target Unit Selection: Add a dropdown in the helper configuration to explicitly define the output unit (e.g., “Always output in kWh” or “Always output in °C”).
  3. Display Precision: Include a setting to control the number of decimal places directly within the helper configuration.

Benefit
This enhancement would make helpers much more powerful and user-friendly. It removes the need for manual “intermediate” template sensors and aligns the Min/Max helper with Home Assistant’s goal of being configurable via UI without requiring custom code for standard tasks.

Additional Context
This is especially critical for Energy management (mixing solar production data from different vendors) and environment monitoring.

*I have moved this request to GitHub Discussions to reach the developers more directly. You can find and upvote it here: https://github.com/orgs/home-assistant/discussions/2727